All Definitions used by the MAC Layer is described here.
Macros | |
#define | LAST_MESSAGE MLME_POLL_CONFIRM |
Bump this when extending the list! More... | |
#define | MAC (4) |
#define | MAC_NHLE_QUEUE_CAPACITY 255 |
Capacity of queue between MAC and Next Higher Layer. More... | |
#define | MCPS_DATA_CON_LEN (7) |
The following defines describe the minimum length of a primitive message. More... | |
#define | MCPS_DATA_IND_LEN (31) |
#define | MCPS_PURGE_CONF_LEN (3) |
#define | MLME_ASSOCIATE_CONF_LEN (4) |
#define | MLME_ASSOCIATE_IND_LEN (10) |
#define | MLME_BEACON_NOTIFY_IND_LEN (2) |
#define | MLME_COMM_STATUS_IND_LEN (22) |
#define | MLME_DISASSOCIATE_CONF_LEN (13) |
#define | MLME_DISASSOCIATE_IND_LEN (10) |
#define | MLME_GET_CONF_LEN (4) |
#define | MLME_GTS_CONF_LEN (3) |
#define | MLME_GTS_IND_LEN (4) |
#define | MLME_ORPHAN_IND_LEN (9) |
#define | MLME_POLL_CONF_LEN (2) |
#define | MLME_RESET_CONF_LEN (2) |
#define | MLME_RX_ENABLE_CONF_LEN (2) |
#define | MLME_SCAN_CONF_LEN (10) |
#define | MLME_SET_CONF_LEN (3) |
#define | MLME_START_CONF_LEN (2) |
#define | MLME_SYNC_LOSS_IND_LEN (6) |
#define | NUMBER_OF_MAC_BEACON_SUPPORT_TIMERS (4) |
#define | NUMBER_OF_MAC_INDIRECT_DATA_SUPPORT_TIMERS (1) |
#define | NUMBER_OF_MAC_RX_ENABLE_SUPPORT_TIMERS (1) |
#define | NUMBER_OF_MAC_SCAN_SUPPORT_TIMERS (1) |
#define | NUMBER_OF_MAC_TIMERS |
#define | WPAN_ADDRMODE_LONG (0x03) |
Value for the address mode, where a 64 bit long address is given. More... | |
#define | WPAN_ADDRMODE_NONE (0x00) |
Value for the address mode, where no address is given. More... | |
#define | WPAN_ADDRMODE_SHORT (0x02) |
Value for the address mode, where a 16 bit short address is given. More... | |
#define | WPAN_CAP_ALLOCADDRESS (0x80) |
Flag value for capability information field (see wpan_mlme_associate_req()). More... | |
#define | WPAN_CAP_ALTPANCOORD (0x01) |
Flag value for capability information field (see wpan_mlme_associate_req()). More... | |
#define | WPAN_CAP_FFD (0x02) |
Flag value for capability information field (see wpan_mlme_associate_req()). More... | |
#define | WPAN_CAP_PWRSOURCE (0x04) |
Flag value for capability information field (see wpan_mlme_associate_req()). More... | |
#define | WPAN_CAP_RXONWHENIDLE (0x08) |
Flag value for capability information field (see wpan_mlme_associate_req()). More... | |
#define | WPAN_DESCRIPTOR_LEN (21) |
#define | WPAN_DISASSOC_BYCHILD (0x02) |
Symbolic constant for disassociate reason - initiated by child (see wpan_mlme_disassociate_req()) More... | |
#define | WPAN_DISASSOC_BYPARENT (0x01) |
Symbolic constant for disassociate reason - initiated by parent (see wpan_mlme_disassociate_req()) More... | |
#define | WPAN_NUM_EXTENDED_ADDR_PENDING(x) (((x) >> 4) & 0x7) |
Macro to extract size of extended address list in PAN descriptor. More... | |
#define | WPAN_NUM_SHORT_ADDR_PENDING(x) ((x) & 0x7) |
Marco to extract size of short address list in PAN descriptor. More... | |
Functions | |
retval_t | mac_timers_init (void) |
retval_t | mac_timers_stop (void) |
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_mcps_purge_req (const uint8_t msduHandle) |
Initiate MCPS-PURGE.request service and have it placed in the MCPS-SAP queue. More... | |
bool | wpan_mlme_associate_req (uint8_t LogicalChannel, uint8_t ChannelPage, wpan_addr_spec_t *CoordAddrSpec, uint8_t CapabilityInformation) |
Initiate MLME-ASSOCIATE.request service and have it placed in the MLME-SAP queue. More... | |
bool | wpan_mlme_associate_resp (uint64_t DeviceAddress, uint16_t AssocShortAddress, uint8_t status) |
Initiate MLME-ASSOCIATE.response service and place it in the MLME-SAP queue. More... | |
bool | wpan_mlme_disassociate_req (wpan_addr_spec_t *DeviceAddrSpec, uint8_t DisassociateReason, bool TxIndirect) |
Inititate MLME-DISASSOCIATE.request service and have it placed in the MLME-SAP queue. More... | |
bool | wpan_mlme_get_req (uint8_t PIBAttribute) |
Initiate MLME-GET.request service and have it placed in the MLME-SAP queue. More... | |
bool | wpan_mlme_gts_req (uint16_t DevShortAddr, gts_char_t GtsChar) |
bool | wpan_mlme_orphan_resp (uint64_t OrphanAddress, uint16_t ShortAddress, bool AssociatedMember) |
Initiate MLME-ORPHAN.response service and have it placed in MLME_SAP queue. More... | |
bool | wpan_mlme_poll_req (wpan_addr_spec_t *CoordAddrSpec) |
Initiate MLME-POLL.request service and have it placed in the MLME-SAP queue. More... | |
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_rx_enable_req (bool DeferPermit, uint32_t RxOnTime, uint32_t RxOnDuration) |
Initiate MLME-RX-ENABLE.request service and have it placed in the MLME-SAP queue. More... | |
bool | wpan_mlme_scan_req (uint8_t ScanType, uint32_t ScanChannels, uint8_t ScanDuration, uint8_t ChannelPage) |
Initiate MLME-SCAN.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... | |
bool | wpan_mlme_start_req (uint16_t PANId, uint8_t LogicalChannel, uint8_t ChannelPage, uint8_t BeaconOrder, uint8_t SuperframeOrder, bool PANCoordinator, bool BatteryLifeExtension, bool CoordRealignment) |
Initiate MLME-START service and have it placed in the MLME-SAP queue. More... | |
bool | wpan_mlme_sync_req (uint8_t LogicalChannel, uint8_t ChannelPage, bool TrackBeacon) |
Initiate MLME-SYNC.request service and have it placed in the MLME-SAP queue. More... | |
bool | wpan_task (void) |
The stack task function called by the application. More... | |
Variables | |
enum msg_code | SHORTENUM |
uint8_t | T_Beacon_Tracking_Period |
uint8_t | T_CAP |
uint8_t | T_Missed_Beacon |
uint8_t | T_Poll_Wait_Time |
uint8_t | T_Rx_Enable |
uint8_t | T_Scan_Duration |
uint8_t | T_Superframe |
#define LAST_MESSAGE MLME_POLL_CONFIRM |
Bump this when extending the list!
#define MAC (4) |
#define MAC_NHLE_QUEUE_CAPACITY 255 |
Capacity of queue between MAC and Next Higher Layer.
#define MCPS_DATA_CON_LEN (7) |
The following defines describe the minimum length of a primitive message.
Referenced by usr_mcps_data_conf().
#define MCPS_DATA_IND_LEN (31) |
Referenced by usr_mcps_data_ind().
#define MCPS_PURGE_CONF_LEN (3) |
#define MLME_ASSOCIATE_CONF_LEN (4) |
Referenced by usr_mlme_associate_conf().
#define MLME_ASSOCIATE_IND_LEN (10) |
#define MLME_BEACON_NOTIFY_IND_LEN (2) |
Referenced by usr_mlme_beacon_notify_ind().
#define MLME_COMM_STATUS_IND_LEN (22) |
#define MLME_DISASSOCIATE_CONF_LEN (13) |
Referenced by usr_mlme_disassociate_conf().
#define MLME_DISASSOCIATE_IND_LEN (10) |
Referenced by usr_mlme_disassociate_ind().
#define MLME_GET_CONF_LEN (4) |
Referenced by usr_mlme_get_conf().
#define MLME_GTS_CONF_LEN (3) |
Referenced by usr_mlme_gts_conf().
#define MLME_GTS_IND_LEN (4) |
Referenced by usr_mlme_gts_ind().
#define MLME_ORPHAN_IND_LEN (9) |
#define MLME_POLL_CONF_LEN (2) |
Referenced by usr_mlme_poll_conf().
#define MLME_RESET_CONF_LEN (2) |
Referenced by usr_mlme_reset_conf().
#define MLME_RX_ENABLE_CONF_LEN (2) |
Referenced by usr_mlme_rx_enable_conf().
#define MLME_SCAN_CONF_LEN (10) |
Referenced by usr_mlme_scan_conf().
#define MLME_SET_CONF_LEN (3) |
Referenced by usr_mlme_set_conf().
#define MLME_START_CONF_LEN (2) |
#define MLME_SYNC_LOSS_IND_LEN (6) |
Referenced by usr_mlme_sync_loss_ind().
#define NUMBER_OF_MAC_BEACON_SUPPORT_TIMERS (4) |
#define NUMBER_OF_MAC_INDIRECT_DATA_SUPPORT_TIMERS (1) |
#define NUMBER_OF_MAC_RX_ENABLE_SUPPORT_TIMERS (1) |
#define NUMBER_OF_MAC_SCAN_SUPPORT_TIMERS (1) |
#define NUMBER_OF_MAC_TIMERS |
#define WPAN_ADDRMODE_LONG (0x03) |
Value for the address mode, where a 64 bit long address is given.
#define WPAN_ADDRMODE_NONE (0x00) |
Value for the address mode, where no address is given.
#define WPAN_ADDRMODE_SHORT (0x02) |
Value for the address mode, where a 16 bit short address is given.
#define WPAN_CAP_ALLOCADDRESS (0x80) |
Flag value for capability information field (see wpan_mlme_associate_req()).
The allocate address subfield shall be set if the device wishes the coordinator to allocate a short address as a result of the association procedure. If this subfield is set to 0, the special short address of 0xfffe shall be allocated to the device and returned through the association response command. In this case, the device shall communicate on the PAN using only its 64 bit extended address.
#define WPAN_CAP_ALTPANCOORD (0x01) |
Flag value for capability information field (see wpan_mlme_associate_req()).
The alternate PAN coordinator subfield shall be set if the device is capable of becoming a PAN coordinator. Otherwise, the alternate PAN coordinator subfield shall be set to 0.
#define WPAN_CAP_FFD (0x02) |
Flag value for capability information field (see wpan_mlme_associate_req()).
The device type subfield shall be set if the device is an FFD. Otherwise, the device type subfield shall be set to 0 to indicate an RFD.
#define WPAN_CAP_PWRSOURCE (0x04) |
Flag value for capability information field (see wpan_mlme_associate_req()).
The power source subfield shall be set if the device is receiving power from the alternating current mains. Otherwise, the power source subfield shall be set to 0.
#define WPAN_CAP_RXONWHENIDLE (0x08) |
Flag value for capability information field (see wpan_mlme_associate_req()).
The receiver on when idle subfield shall be set if the device does not disable its receiver to conserve power during idle periods. Otherwise, the receiver on when idle subfield shall be set to 0.
#define WPAN_DESCRIPTOR_LEN (21) |
Referenced by handle_rx_frame(), usr_mlme_beacon_notify_ind(), and usr_mlme_scan_conf().
#define WPAN_DISASSOC_BYCHILD (0x02) |
Symbolic constant for disassociate reason - initiated by child (see wpan_mlme_disassociate_req())
#define WPAN_DISASSOC_BYPARENT (0x01) |
Symbolic constant for disassociate reason - initiated by parent (see wpan_mlme_disassociate_req())
#define WPAN_NUM_EXTENDED_ADDR_PENDING | ( | x | ) | (((x) >> 4) & 0x7) |
Macro to extract size of extended address list in PAN descriptor.
Referenced by usr_mlme_beacon_notify_ind().
#define WPAN_NUM_SHORT_ADDR_PENDING | ( | x | ) | ((x) & 0x7) |
Marco to extract size of short address list in PAN descriptor.
Referenced by usr_mlme_beacon_notify_ind().
enum msg_code |
This type contains the service primitives of the PHY-, MAC- and Network-layer as well the command-interface primitives.
retval_t mac_timers_init | ( | void | ) |
retval_t mac_timers_stop | ( | void | ) |
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.
Referenced by main().
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.
SrcAddrMode | Address Mode of the source address. |
DstAddrSpec | Pointer to wpan_addr_spec_t structure for destination. |
msduHandle | Handle (identification) of the MSDU. |
TxOptions | Bitmap for transmission options. Valid values: |
msdu | Pointer to the data to be transmitted. |
msduLength | Length of the data to be transmitted. |
SecurityLevel | Used security level; this parameter is only available if MAC security is enabled via MAC_SECURITY_ZIP |
KeyIdMode | Used mode to identify the key; this parameter is only available if MAC security is enabled via MAC_SECURITY_ZIP |
KeyIndex | Used index of the key; this parameter is only available if MAC security is enabled via MAC_SECURITY_ZIP |
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().
Referenced by handle_incoming_msg().
bool wpan_mcps_purge_req | ( | const uint8_t | msduHandle | ) |
Initiate MCPS-PURGE.request service and have it placed in the MCPS-SAP queue.
msduHandle | Handle of MSDU to be purged. |
Referenced by handle_incoming_msg().
bool wpan_mlme_associate_req | ( | uint8_t | LogicalChannel, |
uint8_t | ChannelPage, | ||
wpan_addr_spec_t * | CoordAddrSpec, | ||
uint8_t | CapabilityInformation | ||
) |
Initiate MLME-ASSOCIATE.request service and have it placed in the MLME-SAP queue.
LogicalChannel | The logical channel on which to attempt association. |
ChannelPage | The channel page on which to attempt association. |
CoordAddrSpec | Pointer to wpan_addr_spec_t structure for coordinator. |
CapabilityInformation | Bitmap that describes the nodes capabilities. (WPAN_CAP_ALTPANCOORD | WPAN_CAP_FFD | WPAN_CAP_PWRSOURCE | WPAN_CAP_RXONWHENIDLE | WPAN_CAP_ALLOCADDRESS) |
References wpan_addr_spec_tag::Addr, wpan_addr_spec_tag::AddrMode, CMD_POS, EOT, LEN_POS, MLME_ASSOCIATE_REQUEST, wpan_addr_spec_tag::PANId, and sio2ncp_tx().
Referenced by handle_incoming_msg().
bool wpan_mlme_associate_resp | ( | uint64_t | DeviceAddress, |
uint16_t | AssocShortAddress, | ||
uint8_t | status | ||
) |
Initiate MLME-ASSOCIATE.response service and place it in the MLME-SAP queue.
DeviceAddress | Extended address for device requesting association. |
AssocShortAddress | Short address allocated on successful association. |
status | Status of the association attempt. Valid values: |
Referenced by handle_incoming_msg().
bool wpan_mlme_disassociate_req | ( | wpan_addr_spec_t * | DeviceAddrSpec, |
uint8_t | DisassociateReason, | ||
bool | TxIndirect | ||
) |
Inititate MLME-DISASSOCIATE.request service and have it placed in the MLME-SAP queue.
DeviceAddrSpec | Pointer to wpan_addr_spec_t structure for device to which to send the disassociation notification command. |
DisassociateReason | Reason for disassociation. Valid values: |
TxIndirect | TRUE if the disassociation notification command is to be sent indirectly |
References wpan_addr_spec_tag::Addr, wpan_addr_spec_tag::AddrMode, CMD_POS, EOT, LEN_POS, MLME_DISASSOCIATE_REQUEST, wpan_addr_spec_tag::PANId, and sio2ncp_tx().
Referenced by handle_incoming_msg().
bool wpan_mlme_get_req | ( | uint8_t | PIBAttribute | ) |
Initiate MLME-GET.request service and have it placed in the MLME-SAP queue.
PIBAttribute | PIB attribute to be retrieved. |
PIBAttributeIndex | Index of the PIB attribute to be read. |
References CMD_POS, EOT, LEN_POS, MLME_GET_REQUEST, and sio2ncp_tx().
Referenced by handle_incoming_msg().
bool wpan_mlme_gts_req | ( | uint16_t | DevShortAddr, |
gts_char_t | GtsChar | ||
) |
References CMD_POS, EOT, LEN_POS, MLME_GTS_REQUEST, and sio2ncp_tx().
Referenced by handle_incoming_msg().
Initiate MLME-ORPHAN.response service and have it placed in MLME_SAP queue.
OrphanAddress | Address of orphaned device. |
ShortAddress | Short address allocated to orphaned device. |
AssociatedMember | Boolean true if the orphaned device is associated. |
Referenced by handle_incoming_msg().
bool wpan_mlme_poll_req | ( | wpan_addr_spec_t * | CoordAddrSpec | ) |
Initiate MLME-POLL.request service and have it placed in the MLME-SAP queue.
CoordAddrSpec | Pointer to wpan_addr_spec_t structure for the coordinator. |
References wpan_addr_spec_tag::Addr, wpan_addr_spec_tag::AddrMode, CMD_POS, EOT, LEN_POS, MLME_POLL_REQUEST, wpan_addr_spec_tag::PANId, and sio2ncp_tx().
Referenced by handle_incoming_msg().
Initiate MLME-RESET.request service and have it placed in the MLME-SAP queue.
SetDefaultPib | Boolean to set all PIB values to their respective defaults. |
References CMD_POS, EOT, LEN_POS, MLME_RESET_REQUEST, and sio2ncp_tx().
Referenced by handle_incoming_msg().
Initiate MLME-RX-ENABLE.request service and have it placed in the MLME-SAP queue.
DeferPermit | Set to true if receiver enable can be deferred until next superframe if requested time has already passed. |
RxOnTime | Number of symbols from start of superframe before receiver is enabled. |
RxOnDuration | Number of symbols for which the receiver is enabled, |
References CMD_POS, EOT, LEN_POS, MLME_RX_ENABLE_REQUEST, and sio2ncp_tx().
Referenced by handle_incoming_msg().
bool wpan_mlme_scan_req | ( | uint8_t | ScanType, |
uint32_t | ScanChannels, | ||
uint8_t | ScanDuration, | ||
uint8_t | ChannelPage | ||
) |
Initiate MLME-SCAN.request service and have it placed in the MLME-SAP queue.
ScanType | Type of scan to perform. Valid values: |
ScanChannels | Channels to be scanned. |
ScanDuration | Duration of each scan. |
ChannelPage | The channel page on which to perform the scan. |
References CMD_POS, EOT, LEN_POS, MLME_SCAN_REQUEST, and sio2ncp_tx().
Referenced by handle_incoming_msg().
bool wpan_mlme_set_req | ( | uint8_t | PIBAttribute, |
void * | PIBAttributeValue | ||
) |
Initiate MLME-SET.request service and have it placed in MLME_SAP queue.
PIBAttribute | PIB attribute to be set. |
PIBAttributeIndex | Index of the PIB attribute to be set. |
PIBAttributeValue | Pointer to new PIB attribute value. |
References CMD_POS, EOT, LEN_POS, mac_get_pib_attribute_size(), macBeaconPayload, MLME_SET_REQUEST, and sio2ncp_tx().
Referenced by handle_incoming_msg().
bool wpan_mlme_start_req | ( | uint16_t | PANId, |
uint8_t | LogicalChannel, | ||
uint8_t | ChannelPage, | ||
uint8_t | BeaconOrder, | ||
uint8_t | SuperframeOrder, | ||
bool | PANCoordinator, | ||
bool | BatteryLifeExtension, | ||
bool | CoordRealignment | ||
) |
Initiate MLME-START service and have it placed in the MLME-SAP queue.
PANId | PAN identifier to be used by device. |
LogicalChannel | The logical channel on which to start using the new superframe configuration. |
ChannelPage | The channel page on which to begin using the new superframe configuration. |
BeaconOrder | Beacon transmission interval. |
SuperframeOrder | Duration of active portion of superframe. |
PANCoordinator | Indicates whether node is PAN coordinator of PAN. |
BatteryLifeExtension | Boolean true disables receiver of beaconing device for a period after interframe spacing of beacon frame. |
CoordRealignment | Boolean to transmit Coordinator Realignment command prior to changing to new superframe configuration. |
Referenced by handle_incoming_msg().
Initiate MLME-SYNC.request service and have it placed in the MLME-SAP queue.
LogicalChannel | The logical channel on which to attempt coordinator synchronization. |
ChannelPage | The channel page on which to attempt coordinator synchronization. |
TrackBeacon | Boolean to synchronize with next beacon and to track all future beacons. |
References CMD_POS, EOT, LEN_POS, MLME_SYNC_REQUEST, and sio2ncp_tx().
Referenced by handle_incoming_msg().
bool wpan_task | ( | void | ) |
The stack task function called by the application.
This function should be called as frequently as possible by the application in order to provide a permanent execution of the protocol stack.
References api_process_incoming_sio_data(), data, data_length, rx_index, sio2ncp_rx(), SIO_RX_BUF_SIZE, and sw_timer_service().
Referenced by main().
enum msg_code SHORTENUM |
uint8_t T_Beacon_Tracking_Period |
uint8_t T_CAP |
uint8_t T_Missed_Beacon |
uint8_t T_Poll_Wait_Time |
uint8_t T_Rx_Enable |
uint8_t T_Scan_Duration |
uint8_t T_Superframe |