Contiki-NG
|
The radio API module defines a set of functions that a radio device driver must implement. More...
Data Structures | |
struct | radio_driver |
The structure of a Contiki-NG radio device driver. More... | |
Macros | |
#define | RADIO_TX_MODE_SEND_ON_CCA (1 << 0) |
Radio TX mode control / retrieval. More... | |
Typedefs | |
typedef int | radio_value_t |
Each radio has a set of parameters that designate the current configuration and state of the radio. More... | |
typedef enum radio_result_e | radio_result_t |
Radio return values when setting or getting radio parameters. | |
Radio RX mode | |
The radio reception mode controls address filtering and automatic transmission of acknowledgements in the radio (if such operations are supported by the radio). A single parameter is used to allow setting these features simultaneously as an atomic operation. These macros are meant to be used as the To enable both address filter and transmissions of automatic acknowledgments: NETSTACK_RADIO.set_value(RADIO_PARAM_RX_MODE, | |
#define | RADIO_RX_MODE_ADDRESS_FILTER (1 << 0) |
Enable address-based frame filtering. More... | |
#define | RADIO_RX_MODE_AUTOACK (1 << 1) |
Enable automatic transmission of ACK frames. | |
#define | RADIO_RX_MODE_POLL_MODE (1 << 2) |
Enable/disable/get the state of radio driver poll mode operation. | |
The radio API module defines a set of functions that a radio device driver must implement.
#define RADIO_RX_MODE_ADDRESS_FILTER (1 << 0) |
#define RADIO_TX_MODE_SEND_ON_CCA (1 << 0) |
Radio TX mode control / retrieval.
The radio transmission mode controls whether transmissions should be done using clear channel assessment (if supported by the radio). If send-on-CCA is enabled, the radio's send function will wait for a radio-specific time window for the channel to become clear. If this does not happen, the send function will return RADIO_TX_COLLISION
.
typedef int radio_value_t |
Each radio has a set of parameters that designate the current configuration and state of the radio.
Parameters can either have values of type radio_value_t
, or, when this type is insufficient, a generic object that is specified by a memory pointer and the size of the object.
The radio_value_t
type is set to an integer type that can hold most values used to configure the radio, and is therefore the most common type used for a parameter. Certain parameters require objects of a considerably larger size than radio_value_t
, however, and in these cases the documentation below for the parameter will indicate this.
All radio parameters that can vary during runtime are prefixed by RADIO_PARAM_
, whereas those "parameters" that are guaranteed to remain immutable are prefixed by RADIO_CONST_
. Each mutable parameter has a set of valid parameter values. When attempting to set a parameter to an invalid value, the radio will return RADIO_RESULT_INVALID_VALUE
.
Some radios support only a subset of the defined radio parameters. When trying to set or get such an unsupported parameter, the radio will return RADIO_RESULT_NOT_SUPPORTED
.
enum radio_param_e |
Radio parameters and constants.
The fields of this enum are expected to be used as the param
argument of get_value()
, set_value()
, get_object()
and set_object()
.
More specifically, fields prefixed with RADIO_PARAM_
may be passed as an argument to any of those four functions. Exceptions are documented on a per-field basis. Fields prefixed with RADIO_CONST_
will only be passed as an argument to get_value()
and get_object()
.
enum radio_power_mode_e |
Radio power modes.
Used as the value
argument of get_value()
/ set_value()
when param
is RADIO_PARAM_POWER_MODE
.
enum radio_result_e |
Radio return values when setting or getting radio parameters.
enum radio_shr_search_e |
enum radio_tx_e |
Radio return values for the transmit()
function.