Contiki 3.x
|
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 device driver for a radio in Contiki. More... | |
Macros | |
#define | RADIO_RX_MODE_ADDRESS_FILTER (1 << 0) |
The radio reception mode controls address filtering and automatic transmission of acknowledgements in the radio (if such operations are supported by the radio). More... | |
#define | RADIO_TX_MODE_SEND_ON_CCA (1 << 0) |
The radio transmission mode controls whether transmissions should be done using clear channel assessment (if supported by the radio). 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... | |
The radio API module defines a set of functions that a radio device driver must implement.
#define RADIO_RX_MODE_ADDRESS_FILTER (1 << 0) |
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.
To enable both address filter and transmissions of automatic acknowledgments:
NETSTACK_RADIO.set_value(RADIO_PARAM_RX_MODE, RADIO_RX_MODE_ADDRESS_FILTER | RADIO_RX_MODE_AUTOACK);
#define RADIO_TX_MODE_SEND_ON_CCA (1 << 0) |
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.