Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
MAC API Encoder

The API Encoder Module Encodes the MAC Api's into appropriate command byte stream.

Macros

#define MAX_MAC_PIB_ATTRIBUTE_ID   (macMinSIFSPeriod)
 
#define MAX_PHY_PIB_ATTRIBUTE_ID   (phySymbolsPerOctet)
 
#define MIN_MAC_PIB_ATTRIBUTE_ID   (macAckWaitDuration)
 
#define MIN_PRIVATE_PIB_ATTRIBUTE_ID   (macIeeeAddress)
 

Functions

static FLASH_DECLARE (uint8_t phy_pib_size[])
 
uint8_t mac_get_pib_attribute_size (uint8_t pib_attribute_id)
 
retval_t wpan_init (void)
 The stack initialization function. More...
 
bool wpan_mcps_data_req (uint8_t SrcAddrMode, wpan_addr_spec_t *DstAddrSpec, uint8_t msduLength, uint8_t *msdu, uint8_t msduHandle, uint8_t TxOptions)
 Initiate MCPS-DATA.request service and have it placed in the MCPS-SAP queue. More...
 
bool wpan_mlme_gts_req (uint16_t DevShortAddr, gts_char_t GtsChar)
 
bool wpan_mlme_reset_req (bool SetDefaultPib)
 Initiate MLME-RESET.request service and have it placed in the MLME-SAP queue. More...
 
bool wpan_mlme_set_req (uint8_t PIBAttribute, void *PIBAttributeValue)
 Initiate MLME-SET.request service and have it placed in MLME_SAP queue. More...
 

Variables

static uint8_t length = 0
 
static uint8_t * tx_buff_ptr = &tx_buffer[CMD_POS]
 
static uint8_t tx_buffer [TX_BUFFER_LENGTH] = {0}
 

#define MAX_MAC_PIB_ATTRIBUTE_ID   (macMinSIFSPeriod)
#define MAX_PHY_PIB_ATTRIBUTE_ID   (phySymbolsPerOctet)
#define MIN_MAC_PIB_ATTRIBUTE_ID   (macAckWaitDuration)
#define MIN_PRIVATE_PIB_ATTRIBUTE_ID   (macIeeeAddress)

static FLASH_DECLARE ( uint8_t  phy_pib_size[])
static
uint8_t mac_get_pib_attribute_size ( uint8_t  pib_attribute_id)
retval_t wpan_init ( void  )

The stack initialization function.

This function initializes all resources, which are used from the stack. It has to be called before any other function of the stack is called.

References MAC_SUCCESS, PROTOCOL_ID, PROTOCOL_ID_POS, rcv_buffer, rcv_frame_ptr, sio2ncp_init(), SOT, and SOT_POS.

bool wpan_mcps_data_req ( uint8_t  SrcAddrMode,
wpan_addr_spec_t DstAddrSpec,
uint8_t  msduLength,
uint8_t *  msdu,
uint8_t  msduHandle,
uint8_t  TxOptions 
)

Initiate MCPS-DATA.request service and have it placed in the MCPS-SAP queue.

Parameters
SrcAddrModeAddress Mode of the source address.
DstAddrSpecPointer to wpan_addr_spec_t structure for destination.
msduHandleHandle (identification) of the MSDU.
TxOptionsBitmap for transmission options. Valid values:
msduPointer to the data to be transmitted.
msduLengthLength of the data to be transmitted.
SecurityLevelUsed security level; this parameter is only available if MAC security is enabled via MAC_SECURITY_ZIP
KeyIdModeUsed mode to identify the key; this parameter is only available if MAC security is enabled via MAC_SECURITY_ZIP
KeyIndexUsed index of the key; this parameter is only available if MAC security is enabled via MAC_SECURITY_ZIP
Returns
true - success; false - buffer not available or queue full.

References wpan_addr_spec_tag::Addr, wpan_addr_spec_tag::AddrMode, CMD_POS, EOT, LEN_POS, MCPS_DATA_REQUEST, wpan_addr_spec_tag::PANId, and sio2ncp_tx().

bool wpan_mlme_gts_req ( uint16_t  DevShortAddr,
gts_char_t  GtsChar 
)
bool wpan_mlme_reset_req ( bool  SetDefaultPib)

Initiate MLME-RESET.request service and have it placed in the MLME-SAP queue.

Parameters
SetDefaultPibBoolean to set all PIB values to their respective defaults.
Returns
true - success; false - buffer not available or queue full.

References CMD_POS, EOT, LEN_POS, MLME_RESET_REQUEST, and sio2ncp_tx().

bool wpan_mlme_set_req ( uint8_t  PIBAttribute,
void *  PIBAttributeValue 
)

Initiate MLME-SET.request service and have it placed in MLME_SAP queue.

Parameters
PIBAttributePIB attribute to be set.
PIBAttributeIndexIndex of the PIB attribute to be set.
PIBAttributeValuePointer to new PIB attribute value.
Returns
true - success; false - buffer not available or queue full.

References CMD_POS, EOT, LEN_POS, mac_get_pib_attribute_size(), macBeaconPayload, and sio2ncp_tx().

uint8_t* tx_buff_ptr = &tx_buffer[CMD_POS]
static
uint8_t tx_buffer[TX_BUFFER_LENGTH] = {0}
static