Contiki-NG
Files | Macros | Functions

Files

file  ieee-mode.c
 Implementation of the CC13xx/CC26xx IEEE mode NETSTACK_RADIO driver.
 

Macros

#define RF_RADIO_OP_GET_STATUS(a)   (((rfc_radioOp_t *)a)->status)
 Returns the current status of a running Radio Op command. More...
 

Functions

static uint8_t rf_is_on (void)
 Checks whether the RFC domain is accessible and the RFC is in IEEE RX. More...
 
static uint8_t transmitting (void)
 Check the RF's TX status. More...
 
static uint8_t get_cca_info (void)
 Returns CCA information. More...
 
static radio_value_t get_rssi (void)
 Reads the current signal strength (RSSI) More...
 
static uint8_t rf_cmd_ieee_rx ()
 Set up radio in IEEE802.15.4 RX mode. More...
 

Detailed Description

Macro Definition Documentation

#define RF_RADIO_OP_GET_STATUS (   a)    (((rfc_radioOp_t *)a)->status)

Returns the current status of a running Radio Op command.

Parameters
aA pointer with the buffer used to initiate the command
Returns
The value of the Radio Op buffer's status field

This macro can be used to e.g. return the status of a previously initiated background operation, or of an immediate command

Definition at line 131 of file ieee-mode.c.

Referenced by rf_cmd_ieee_rx(), and rf_is_on().

Function Documentation

static uint8_t get_cca_info ( void  )
static

Returns CCA information.

Returns
RF_GET_CCA_INFO_ERROR if the RF was not on
On success, the return value is formatted as per the ccaInfo field of CMD_IEEE_CCA_REQ

It is the caller's responsibility to make sure the RF is on. This function will return RF_GET_CCA_INFO_ERROR if the RF is off

This function will in fact wait for a valid CCA state

Definition at line 381 of file ieee-mode.c.

References rf_core_send_cmd(), and rf_is_on().

Referenced by rf_cmd_ieee_rx().

static radio_value_t get_rssi ( void  )
static

Reads the current signal strength (RSSI)

Returns
The current RSSI in dBm or CMD_GET_RSSI_UNKNOWN

This function reads the current RSSI on the currently configured channel.

Definition at line 417 of file ieee-mode.c.

References rf_core_init_radio_op(), rf_core_is_accessible(), rf_core_send_cmd(), rf_core_wait_cmd_done(), and rf_is_on().

Referenced by rf_cmd_ieee_rx().

static uint8_t rf_cmd_ieee_rx ( )
static
static uint8_t rf_is_on ( void  )
static

Checks whether the RFC domain is accessible and the RFC is in IEEE RX.

Returns
1: RFC in RX mode (and therefore accessible too). 0 otherwise

Definition at line 324 of file ieee-mode.c.

References rf_core_is_accessible(), and RF_RADIO_OP_GET_STATUS.

Referenced by get_cca_info(), get_rssi(), and rf_cmd_ieee_rx().

static uint8_t transmitting ( void  )
static

Check the RF's TX status.

Returns
1 RF is transmitting
0 RF is not transmitting

TX mode may be triggered either by a CMD_IEEE_TX or by the automatic transmission of an ACK frame.

Definition at line 342 of file ieee-mode.c.

References rf_core_is_accessible(), and rf_core_send_cmd().

Referenced by rf_cmd_ieee_rx(), uart0_init(), and uart1_init().