This header file declares the interface for the RF4Control stack.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include "compiler.h"
#include "return_val.h"
#include "nwk_build_config.h"
Data Structures | |
struct | NodeDesc_tag |
Elements of the NodeDesc type as defined by 094945r00ZB_RF4CE-Specification.pdf. More... | |
struct | nwk_indication_callback_tag |
struct for network indication callback. More... | |
struct | pairing_table_tag |
Structure implementing the pairing table entry as defined by 094945r00ZB_RF4CE-Specification.pdf. More... | |
Macros | |
#define | ALIGN8BIT |
#define | BAND_2400_BASE_CHANNEL 15 |
#define | BAND_2400_CHANNEL_OFFSET 5 |
#define | BAND_900_BASE_CHANNEL 1 |
#define | BAND_900_CHANNEL_OFFSET 3 |
#define | ChannelNormalizationCapableFalse 0x00 |
Node capability - constant channel normalization capable false. More... | |
#define | ChannelNormalizationCapableTrue 0x08 |
Node capability - constant channel normalization capable true. More... | |
#define | MAX_SAFE_DATA_FRAME_PAYLOAD (aMaxMACSafePayloadSize - 12) |
Calculate the maximum data frame payload that is allowed: 12 = FCF + frame counter + profile id + vendor id + MIC. More... | |
#define | NodeTypeController 0x00 |
Node capability - constant node type controller. More... | |
#define | NodeTypeTarget 0x01 |
Node capability - constant for node type target. More... | |
#define | nwkcMaxDutyCycle 62500 /* symbols = 1 s */ |
NWK layer constant - max duty cycle. More... | |
#define | nwkcMinActivePeriod 1050 /* symbols = 16.8 ms */ |
NWK layer constant - min active period. More... | |
#define | PowerSourceMainsFalse 0x00 |
Node capability - constant power source main not available. More... | |
#define | PowerSourceMainsTrue 0x02 |
Node capability - constant power source main available. More... | |
#define | RX_DURATION_INFINITY 0xFFFFFF |
Define used as parameters for NLME-RX-ENABLE.request: receiver on. More... | |
#define | RX_DURATION_OFF 0 |
Define used as parameters for NLME-RX-ENABLE.request: receiver off. More... | |
#define | RX_FLAG_BROADCAST 0x01 |
Rx flag - broadcast. More... | |
#define | RX_FLAG_NO_SEC 0x00 |
Rx flag - without security. More... | |
#define | RX_FLAG_NOT_VENDOR 0x00 |
Rx flag - no vendor-specific data. More... | |
#define | RX_FLAG_UNICAST 0x00 |
Rx flag - unicast. More... | |
#define | RX_FLAG_VENDOR_SPEC 0x04 |
Rx flag - vendor-specific data. More... | |
#define | RX_FLAG_WITH_SEC 0x02 |
Rx flag - with security. More... | |
#define | SecurityCapableFalse 0x00 |
Node capability - constant security capable false. More... | |
#define | SecurityCapableTrue 0x04 |
Node capability - constant security capable true. More... | |
#define | TXO_ACK_NOT_REQ 0x00 |
Tx option - ACK not requested. More... | |
#define | TXO_ACK_REQ 0x04 |
Tx option - ACK requested. More... | |
#define | TXO_BROADCAST 0x01 |
Tx option - broadcast. More... | |
#define | TXO_CH_NOT_SPEC 0x00 |
Tx option - channel not specified. More... | |
#define | TXO_CH_SPEC 0x20 |
Tx option - channel specified. More... | |
#define | TXO_DST_ADDR_IEEE 0x02 |
Tx option - destination address: long. More... | |
#define | TXO_DST_ADDR_NET 0x00 |
Tx option - destination address: short. More... | |
#define | TXO_MULTI_CH 0x00 |
Tx option - multi-channel transmission. More... | |
#define | TXO_SEC_NOT_REQ 0x00 |
Tx option - security not requested. More... | |
#define | TXO_SEC_REQ 0x08 |
Tx option - security requested. More... | |
#define | TXO_SINGLE_CH 0x10 |
Tx option - single-channel transmission. More... | |
#define | TXO_UNICAST 0x00 |
Tx option - unicast. More... | |
#define | TXO_VEND_NOT_SPEC 0x00 |
Tx option - no vendor-specific data. More... | |
#define | TXO_VEND_SPEC 0x40 |
Tx option - vendor-specific data. More... | |
Typedefs | |
typedef enum dev_type_tag | dev_type_t |
Device types as defined by 094950r00ZB_RF4CE-Device-Type-List.pdf. More... | |
typedef enum nib_attribute_tag | nib_attribute_t |
Network Information Base attributes as defined by 094945r00ZB_RF4CE-Specification.pdf. More... | |
typedef void(* | nlde_data_confirm_cb_t )(nwk_enum_t Status, uint8_t PairingRef, profile_id_t ProfileId, uint8_t Handle) |
NLME-AUTO-DISCOVERY.confirm primitive API. More... | |
typedef void(* | nlde_data_indication_cb_t )(uint8_t PairingRef, profile_id_t ProfileId, uint16_t VendorId, uint8_t nsduLength, uint8_t *nsdu, uint8_t RxLinkQuality, uint8_t RxFlags) |
NLME-DISCOVERY.indication primitive API. More... | |
typedef void(* | nlme_discovery_confirm_cb_t )(nwk_enum_t Status, uint8_t NumNodes, node_desc_t *NodeDescList) |
typedef void(* | nlme_get_confirm_cb_t )(nwk_enum_t Status, nib_attribute_t NIBAttribute, uint8_t NIBAttributeIndex, void *NIBAttributeValue) |
NLME-GET.confirm primitive API. More... | |
typedef void(* | nlme_pair_confirm_cb_t )(nwk_enum_t Status, uint8_t PairingRef, uint16_t RecVendorId, uint8_t RecVendorString[7], uint8_t RecAppCapabilities, uint8_t RecUserString[15], dev_type_t RecDevTypeList[3], profile_id_t RecProfileIdList[7]) |
NLME-PAIR.confirm primitive API. More... | |
typedef void(* | nlme_reset_confirm_cb_t )(nwk_enum_t Status) |
NLME-RESET.confirm primitive API. More... | |
typedef void(* | nlme_rx_enable_confirm_cb_t )(nwk_enum_t Status) |
Confirmation callback pointer for NLME-RX-ENABLE request. More... | |
typedef void(* | nlme_set_confirm_cb_t )(nwk_enum_t Status, nib_attribute_t NIBAttribute, uint8_t NIBAttributeIndex) |
NLME-SET.confirm primitive API. More... | |
typedef void(* | nlme_start_confirm_cb_t )(nwk_enum_t Status) |
NLME-START.confirm primitive API. More... | |
typedef void(* | nlme_unpair_confirm_cb_t )(uint8_t Status, uint8_t PairingRef) |
NLME-UNPAIR.confirm primitive API. More... | |
typedef void(* | nlme_unpair_indication_cb_t )(uint8_t PairingRef) |
NLME-PAIR.indication primitive API. More... | |
typedef struct NodeDesc_tag | node_desc_t |
Elements of the NodeDesc type as defined by 094945r00ZB_RF4CE-Specification.pdf. More... | |
typedef enum nwk_addr_mode_tag | nwk_addr_mode_t |
Enumeration identifiying the address mode as defined by 094945r00ZB_RF4CE-Specification.pdf. More... | |
typedef enum nwk_agility_mode_tag | nwk_agility_mode_t |
Enumeration used for implementation-specific channel agility. More... | |
typedef __PACK__DATA__ enum nwk_enum_tag | nwk_enum_t |
NWK enumerations as defined by 094945r00ZB_RF4CE-Specification.pdf, Table 45 - NWK enumerations description. More... | |
typedef struct nwk_indication_callback_tag | nwk_indication_callback_t |
struct for network indication callback. More... | |
typedef struct pairing_table_tag | pairing_table_t |
Structure implementing the pairing table entry as defined by 094945r00ZB_RF4CE-Specification.pdf. More... | |
typedef enum profile_id_tag | profile_id_t |
Profile IDs as defined by 094951r00ZB_RF4CE-Profile-ID-List.pdf. More... | |
typedef void(* | zrc_data_indication_cb_t )(uint8_t PairingRef, uint16_t VendorId, uint8_t nsduLength, uint8_t *nsdu, uint8_t RxLinkQuality, uint8_t RxFlags) |
Functions | |
void | clear_pairing_ref (uint8_t first_ref, uint8_t length) |
Clears pairing references within EEPROM. More... | |
bool | nlde_data_request (uint8_t PairingRef, profile_id_t ProfileId, uint16_t VendorId, uint8_t nsduLength, uint8_t *nsdu, uint8_t TxOptions, uint8_t Handle, FUNC_PTR confirm_cb) |
NLDE-DATA.request primitive API. More... | |
bool | nlme_discovery_request (uint16_t DstPANId, uint16_t DstNwkAddr, uint8_t OrgAppCapabilities, dev_type_t OrgDevTypeList[3], profile_id_t OrgProfileIdList[7], dev_type_t SearchDevType, uint8_t DiscProfileIdListSize, profile_id_t DiscProfileIdList[7], uint32_t DiscDuration, FUNC_PTR confirm_cb) |
NLME-AUTO-DISCOVERY.request primitive API. More... | |
bool | nlme_get_request (nib_attribute_t NIBAttribute, uint8_t NIBAttributeIndex, FUNC_PTR confirm_cb) |
NLME-DISCOVERY.response primitive API. More... | |
bool | nlme_pair_request (uint8_t LogicalChannel, uint16_t DstPANId, uint64_t DstIEEEAddr, uint8_t OrgAppCapabilities, dev_type_t OrgDevTypeList[3], profile_id_t OrgProfileIdList[7], uint8_t KeyExTransferCount, FUNC_PTR confirm_cb) |
NLME-PAIR.request primitive API. More... | |
bool | nlme_reset_request (bool SetDefaultNIB, FUNC_PTR confirm_cb) |
NLME-PAIR.response primitive API. More... | |
bool | nlme_rx_enable_request (uint32_t RxOnDuration, FUNC_PTR confirm_cb) |
NLME-RX-ENABLE.request primitive API. More... | |
bool | nlme_set_request (nib_attribute_t NIBAttribute, uint8_t NIBAttributeIndex, uint8_t *NIBAttributeValue, FUNC_PTR confirm_cb) |
NLME-SET.request primitive API. More... | |
bool | nlme_start_request (FUNC_PTR confirm_cb) |
NLME-START.request primitive API. More... | |
bool | nlme_unpair_request (uint8_t PairingRef, FUNC_PTR confirm_cb) |
NLME-UNPAIR.request primitive API. More... | |
bool | nlme_unpair_response (uint8_t PairingRef) |
NLME-UNPAIR.response primitive API. More... | |
bool | nlme_update_key_request (uint8_t PairingRef, uint8_t NewLinkKey[16], FUNC_PTR confirm_cb) |
NLME-UPDATE-KEY.request primitive API. More... | |
uint8_t | nwk_get_nib_attribute_size (uint8_t nib_attribute_id) |
Gets the NIB attribute value size. More... | |
nwk_enum_t | nwk_init (void) |
Sets channel agility mode. More... | |
bool | nwk_ready_to_sleep (void) |
Checks if the entire stack is idle. More... | |
bool | nwk_stack_idle (void) |
Checks if the network stack is idle. More... | |
bool | nwk_task (void) |
Task handling of RF4CE network layer. More... | |
void | read_pairing_ref (uint8_t *pairing_ref, uint8_t length) |
Reads pairing reference from EEPROM. More... | |
void | register_nwk_indication_callback (nwk_indication_callback_t *nwk_indication_cb) |
Registering network indication callback. More... | |
void | store_pairing_ref (uint8_t *pairing_ref, uint8_t length) |
Stores pairing references to EEPROM. More... | |
Variables | |
__PACK__RST_DATA__ typedef void(* | nlme_update_key_confirm_cb_t )(nwk_enum_t Status, uint8_t PairingRef) |
Confirms the previous channel agility request, i.e. More... | |
#define ALIGN8BIT |
#define BAND_2400_BASE_CHANNEL 15 |
#define BAND_2400_CHANNEL_OFFSET 5 |
#define BAND_900_BASE_CHANNEL 1 |
#define BAND_900_CHANNEL_OFFSET 3 |
#define ChannelNormalizationCapableFalse 0x00 |
Node capability - constant channel normalization capable false.
#define ChannelNormalizationCapableTrue 0x08 |
Node capability - constant channel normalization capable true.
#define MAX_SAFE_DATA_FRAME_PAYLOAD (aMaxMACSafePayloadSize - 12) |
Calculate the maximum data frame payload that is allowed: 12 = FCF + frame counter + profile id + vendor id + MIC.
#define NodeTypeController 0x00 |
Node capability - constant node type controller.
#define NodeTypeTarget 0x01 |
Node capability - constant for node type target.
#define nwkcMaxDutyCycle 62500 /* symbols = 1 s */ |
NWK layer constant - max duty cycle.
#define nwkcMinActivePeriod 1050 /* symbols = 16.8 ms */ |
NWK layer constant - min active period.
#define PowerSourceMainsFalse 0x00 |
Node capability - constant power source main not available.
#define PowerSourceMainsTrue 0x02 |
Node capability - constant power source main available.
#define RX_DURATION_INFINITY 0xFFFFFF |
Define used as parameters for NLME-RX-ENABLE.request: receiver on.
#define RX_DURATION_OFF 0 |
Define used as parameters for NLME-RX-ENABLE.request: receiver off.
Referenced by nlme_reset_confirm(), pbp_org_pair_confirm(), and zrc_cmd_disc_confirm().
#define RX_FLAG_BROADCAST 0x01 |
Rx flag - broadcast.
#define RX_FLAG_NO_SEC 0x00 |
Rx flag - without security.
#define RX_FLAG_NOT_VENDOR 0x00 |
Rx flag - no vendor-specific data.
#define RX_FLAG_UNICAST 0x00 |
Rx flag - unicast.
#define RX_FLAG_VENDOR_SPEC 0x04 |
Rx flag - vendor-specific data.
#define RX_FLAG_WITH_SEC 0x02 |
Rx flag - with security.
Referenced by vendor_data_ind().
#define SecurityCapableFalse 0x00 |
Node capability - constant security capable false.
#define SecurityCapableTrue 0x04 |
Node capability - constant security capable true.
#define TXO_ACK_NOT_REQ 0x00 |
Tx option - ACK not requested.
#define TXO_ACK_REQ 0x04 |
Tx option - ACK requested.
Referenced by vendor_data_ind().
#define TXO_BROADCAST 0x01 |
Tx option - broadcast.
#define TXO_CH_NOT_SPEC 0x00 |
Tx option - channel not specified.
Referenced by vendor_data_ind().
#define TXO_CH_SPEC 0x20 |
Tx option - channel specified.
#define TXO_DST_ADDR_IEEE 0x02 |
Tx option - destination address: long.
#define TXO_DST_ADDR_NET 0x00 |
Tx option - destination address: short.
Referenced by vendor_data_ind().
#define TXO_MULTI_CH 0x00 |
Tx option - multi-channel transmission.
Referenced by vendor_data_ind().
#define TXO_SEC_NOT_REQ 0x00 |
Tx option - security not requested.
#define TXO_SEC_REQ 0x08 |
Tx option - security requested.
Referenced by vendor_data_ind().
#define TXO_SINGLE_CH 0x10 |
Tx option - single-channel transmission.
#define TXO_UNICAST 0x00 |
Tx option - unicast.
Referenced by vendor_data_ind().
#define TXO_VEND_NOT_SPEC 0x00 |
Tx option - no vendor-specific data.
#define TXO_VEND_SPEC 0x40 |
Tx option - vendor-specific data.
Referenced by vendor_data_ind().
typedef void(* nlme_discovery_confirm_cb_t)(nwk_enum_t Status, uint8_t NumNodes, node_desc_t *NodeDescList) |
typedef void(* zrc_data_indication_cb_t)(uint8_t PairingRef, uint16_t VendorId, uint8_t nsduLength, uint8_t *nsdu, uint8_t RxLinkQuality, uint8_t RxFlags) |