Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
rssi.c
Go to the documentation of this file.
1/*
2 * Copyright (C) Kirk Scheper
3 *
4 * This file is part of paparazzi
5 *
6 * paparazzi is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * paparazzi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with paparazzi; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
19 */
26#include "modules/multi/rssi.h"
27
29#include "pprzlink/messages.h"
30
31#include "modules/core/abi.h" // rssi messages subscription
32#include "generated/airframe.h" // AC_ID
33
34#ifndef NB_ACS_ID
35#define NB_ACS_ID 256
36#endif
37#ifndef NB_ACS
38#define NB_ACS 24
39#endif
40
44
46
51
53{
55
56 rssi_acs_id[0] = 0; // ground station
57 rssi_acs_id[AC_ID] = 1;
59 rssi_acs_idx = 2;
60
61 /* register for rssi messages */
63}
64
66{
68 uint8_t msg_id = IdOfPprzMsg(buf);
69
70 if (sender_id > 0 && msg_id == DL_RSSI) {
73 DL_RSSI_rssi(buf));
74 }
75}
76
89
Main include for ABI (AirBorneInterface).
#define ABI_BROADCAST
Broadcast address.
Definition abi_common.h:58
Event structure to store callbacks in a linked list.
Definition abi_common.h:67
uint16_t foo
Definition main_demo5.c:58
abi_event ev
Definition rssi.c:45
static void rssi_cb(uint8_t sender_id, uint8_t _ac_id, int8_t _tx_strength, int8_t _rssi)
Definition rssi.c:47
struct rssi_info_ get_rssi(uint8_t _ac_id)
Definition rssi.c:90
void set_rssi(uint8_t _ac_id, int8_t _tx_strength, int8_t _rssi)
Definition rssi.c:77
void rssi_init()
Definition rssi.c:52
uint8_t rssi_acs_id[NB_ACS_ID]
Definition rssi.c:43
uint8_t rssi_acs_idx
Definition rssi.c:41
struct rssi_info_ rssi_acs[NB_ACS]
Definition rssi.c:42
void parse_rssi_dl(uint8_t *buf)
Definition rssi.c:65
#define NB_ACS_ID
Definition rssi.c:35
#define NB_ACS
Definition rssi.c:38
int8_t rssi
Definition rssi.h:33
uint8_t rssi_acs_id[]
Definition rssi.c:43
uint8_t ac_id
Definition rssi.h:32
struct rssi_info_ rssi_acs[]
Definition rssi.c:42
int8_t tx_strength
Definition rssi.h:34
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
signed char int8_t
Typedef defining 8 bit char type.