1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sys/net/sock: add sock_aux_rssi

Allow accessing the RSSI value of received UDP datagrams / IP packets with the
sock API.
This commit is contained in:
Marian Buschsieweke 2021-01-12 21:58:27 +01:00
parent 582f8d8430
commit f0ba796e5d
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F
4 changed files with 35 additions and 2 deletions

View File

@ -120,6 +120,7 @@ PSEUDOMODULES += slipdev_stdio
PSEUDOMODULES += sock
PSEUDOMODULES += sock_async
PSEUDOMODULES += sock_aux_local
PSEUDOMODULES += sock_aux_rssi
PSEUDOMODULES += sock_aux_timestamp
PSEUDOMODULES += sock_dtls
PSEUDOMODULES += sock_ip

View File

@ -286,6 +286,22 @@ enum {
* @ref sock_ip_aux_tx_t::timestamp, or @ref sock_dtls_aux_tx_t::timestamp.
*/
SOCK_AUX_GET_TIMESTAMP = (1LU << 1),
/**
* @brief Flag to request the RSSI value of received frame
*
* @note Select module `sock_aux_rssi` and a compatible network stack to
* use this
*
* Set this flag in the auxiliary data structure prior to the call of
* @ref sock_udp_recv_aux / @ref sock_ip_recv_aux / etc. to request the
* RSSI value of a received frame. This flag will be cleared if the
* timestamp was stored, otherwise it remains set.
*
* Depending on the family of the socket, the RSSI value will be stored in
* @ref sock_udp_aux_rx_t::rssi, @ref sock_ip_aux_rx_t::rssi, or
* @ref sock_dtls_aux_rx_t::rssi.
*/
SOCK_AUX_GET_RSSI = (1LU << 2),
};
/**

View File

@ -316,7 +316,15 @@ typedef struct {
* @see SOCK_AUX_GET_TIMESTAMP
*/
uint64_t timestamp;
#endif /* MODULE_SOCK_AUX_TIMESTAP*/
#endif /* MODULE_SOCK_AUX_TIMESTAP */
#if defined(MODULE_SOCK_AUX_RSSI) || defined(DOXYGEN)
/**
* @brief RSSI value of the received frame
*
* @see SOCK_AUX_GET_RSSI
*/
int16_t rssi;
#endif /* MODULE_SOCK_AUX_RSSI */
sock_aux_flags_t flags; /**< Flags used request information */
} sock_ip_aux_rx_t;

View File

@ -318,7 +318,15 @@ typedef struct {
* @see SOCK_AUX_GET_TIMESTAMP
*/
uint64_t timestamp;
#endif /* MODULE_SOCK_AUX_TIMESTAP*/
#endif /* MODULE_SOCK_AUX_TIMESTAP */
#if defined(MODULE_SOCK_AUX_RSSI) || defined(DOXYGEN)
/**
* @brief RSSI value of the received frame
*
* @see SOCK_AUX_GET_RSSI
*/
int16_t rssi;
#endif /* MODULE_SOCK_AUX_RSSI */
sock_aux_flags_t flags; /**< Flags used request information */
} sock_udp_aux_rx_t;