Contiki-NG
radio.h File Reference

Header file for the radio API. More...

#include <stddef.h>

Go to the source code of this file.

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...
 
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 value argument of get_value() and set_value() when the param argument is RADIO_PARAM_RX_MODE.

To enable both address filter and transmissions of automatic acknowledgments:

NETSTACK_RADIO.set_value(RADIO_PARAM_RX_MODE,
#define RADIO_RX_MODE_ADDRESS_FILTER
Enable address-based frame filtering.
Definition: radio.h:451
#define RADIO_RX_MODE_AUTOACK
Enable automatic transmission of ACK frames.
Definition: radio.h:456
@ RADIO_PARAM_RX_MODE
Radio receiver mode determines if the radio has address filter (RADIO_RX_MODE_ADDRESS_FILTER) and aut...
Definition: radio.h:173
#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.
 

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.
 

Enumerations

enum  radio_param_e {
  RADIO_PARAM_POWER_MODE , RADIO_PARAM_CHANNEL , RADIO_PARAM_PAN_ID , RADIO_PARAM_16BIT_ADDR ,
  RADIO_PARAM_RX_MODE , RADIO_PARAM_TX_MODE , RADIO_PARAM_TXPOWER , RADIO_PARAM_CCA_THRESHOLD ,
  RADIO_PARAM_RSSI , RADIO_PARAM_LAST_RSSI , RADIO_PARAM_IQ_LSBS , RADIO_PARAM_LAST_LINK_QUALITY ,
  RADIO_PARAM_64BIT_ADDR , RADIO_PARAM_LAST_PACKET_TIMESTAMP , RADIO_PARAM_SHR_SEARCH , RADIO_CONST_CHANNEL_MIN ,
  RADIO_CONST_CHANNEL_MAX , RADIO_CONST_TXPOWER_MIN , RADIO_CONST_TXPOWER_MAX , RADIO_CONST_TSCH_TIMING ,
  RADIO_CONST_PHY_OVERHEAD , RADIO_CONST_BYTE_AIR_TIME , RADIO_CONST_DELAY_BEFORE_TX , RADIO_CONST_DELAY_BEFORE_RX ,
  RADIO_CONST_DELAY_BEFORE_DETECT , RADIO_CONST_MAX_PAYLOAD_LEN
}
 Radio parameters and constants. More...
 
enum  radio_power_mode_e { RADIO_POWER_MODE_OFF , RADIO_POWER_MODE_ON , RADIO_POWER_MODE_CARRIER_ON , RADIO_POWER_MODE_CARRIER_OFF }
 Radio power modes. More...
 
enum  radio_shr_search_e { RADIO_SHR_SEARCH_DIS = 0 , RADIO_SHR_SEARCH_EN = 1 }
 Possible values of the get_value() / set_value() value argument when the param argument is RADIO_PARAM_SHR_SEARCH. More...
 
enum  radio_result_e { RADIO_RESULT_OK , RADIO_RESULT_NOT_SUPPORTED , RADIO_RESULT_INVALID_VALUE , RADIO_RESULT_ERROR }
 Radio return values when setting or getting radio parameters. More...
 
enum  radio_tx_e { RADIO_TX_OK , RADIO_TX_ERR , RADIO_TX_COLLISION , RADIO_TX_NOACK }
 Radio return values for the transmit() function. More...
 

Detailed Description

Header file for the radio API.

Author
Adam Dunkels adam@.nosp@m.sics.nosp@m..se Joakim Eriksson joaki.nosp@m.me@s.nosp@m.ics.s.nosp@m.e Niclas Finne nfi@s.nosp@m.ics..nosp@m.se Nicolas Tsiftes nvt@s.nosp@m.ics..nosp@m.se

Definition in file radio.h.