This module is responsible for encoding and decoding the serial bytes to/from NCP into NWK or ZRC APIs to provide seamless working for application similar to stack running in same processor or on NCP.
Macros | |
#define | RF4CONTROL_PID (2) |
#define | RF4CONTROL_PID_LEN (1) |
Functions | |
void | serial_api_init (void) |
This function does the initialization of the SIO or UART. More... | |
static void | process_incoming_data (void) |
static uint8_t * | get_next_tx_buffer (void) |
static void | handle_incoming_msg (void) |
static | FLASH_DECLARE (uint8_t nib_attr_size[]) |
Size constants for NIB attributes. More... | |
nwk_enum_t | nwk_init (void) |
Initialization of RF4CE network layer. More... | |
bool | nwk_task (void) |
Function to handle the state machine serial data exchange. More... | |
bool | nlme_reset_request (bool SetDefaultNIB, FUNC_PTR confirm_cb) |
NLME-RESET.request primitive API. 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_auto_discovery_request (uint8_t RecAppCapabilities, dev_type_t RecDevTypeList[DEVICE_TYPE_LIST_SIZE], profile_id_t RecProfileIdList[PROFILE_ID_LIST_SIZE], uint32_t AutoDiscDuration, FUNC_PTR confirm_cb) |
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-DISCOVERY.request primitive API. More... | |
bool | nlme_discovery_response (nwk_enum_t Status, uint64_t DstIEEEAddr, uint8_t RecAppCapabilities, dev_type_t RecDevTypeList[3], profile_id_t RecProfileIdList[7], uint8_t DiscReqLQI) |
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[DEVICE_TYPE_LIST_SIZE], profile_id_t OrgProfileIdList[PROFILE_ID_LIST_SIZE], uint8_t KeyExTransferCount, FUNC_PTR confirm_cb) |
bool | nlme_pair_response (nwk_enum_t Status, uint16_t DstPANId, uint64_t DstIEEEAddr, uint8_t RecAppCapabilities, dev_type_t RecDevTypeList[3], profile_id_t RecProfileIdList[7], uint8_t ProvPairingRef) |
NLME-PAIR.response primitive API. More... | |
bool | nlme_get_request (nib_attribute_t NIBAttribute, uint8_t NIBAttributeIndex, FUNC_PTR confirm_cb) |
NLME-GET.request 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... | |
bool | nwk_ch_agility_request (nwk_agility_mode_t AgilityMode, FUNC_PTR confirm_cb) |
Sets channel agility mode. More... | |
bool | pbp_org_pair_request (uint8_t OrgAppCapabilities, dev_type_t OrgDevTypeList[DEVICE_TYPE_LIST_SIZE], profile_id_t OrgProfileIdList[PROFILE_ID_LIST_SIZE], dev_type_t SearchDevType, uint8_t DiscProfileIdListSize, profile_id_t DiscProfileIdList[PROFILE_ID_LIST_SIZE], FUNC_PTR confirm_cb) |
bool | pbp_rec_pair_request (uint8_t RecAppCapabilities, dev_type_t RecDevTypeList[3], profile_id_t RecProfileIdList[7], FUNC_PTR confirm_cb) |
Recipient pair request; target use. More... | |
bool | zrc_cmd_request (uint8_t PairingRef, uint16_t VendorId, zrc_cmd_code_t CmdCode, uint8_t CmdLength, uint8_t *Cmd, uint8_t TxOptions, FUNC_PTR confirm_cb) |
Handles the key press from the application. More... | |
bool | zrc_cmd_disc_request (uint8_t PairingRef, FUNC_PTR confirm_cb) |
Handles the cmd discovery request. More... | |
bool | zrc_cmd_disc_response (uint8_t PairingRef, uint8_t *SupportedCmd) |
Send out the cmd discovery response. More... | |
void | register_nwk_indication_callback (nwk_indication_callback_t *nwk_ind_cb) |
Registering network indication callback. More... | |
void | register_zrc_indication_callback (zrc_indication_callback_t *zrc_ind_callback) |
Registering zrc indication callback. More... | |
uint8_t | nwk_get_nib_attribute_size (uint8_t nib_attribute_id) |
Gets the NIB attribute value size. More... | |
#define | SOT (1) |
The start of transmission delimiter. More... | |
#define | EOT (4) |
The end of transmission delimiter. More... | |
#define | UART_RX_STATE_SOT (1) |
A UART state that expects a SOT to be received as the next character. More... | |
#define | UART_RX_STATE_LENGTH (2) |
A UART state that expects the length to be received as the next character. More... | |
#define | UART_RX_PROTOCOL_ID (3) |
A UART state that expects the length to be received as the next character. More... | |
#define | UART_RX_STATE_DATA (4) |
A UART state that expects the next data character to be received. More... | |
#define | UART_RX_STATE_EOT (5) |
A UART state that expects a EOT to be received as the next character. More... | |
#define | SIO_BUF_COUNT (2) |
#define | SIO_RX2NCP_BUF_SIZE (200) |
#define | SIO_TX_BUF_SIZE SIO_RX2NCP_BUF_SIZE |
#define | GET_NIB_ATTR_SIZE(x) |
Gets attribute size by reading from a table stored in flash. More... | |
static uint8_t | sio_rx_buf [SIO_RX2NCP_BUF_SIZE] |
This is the receive buffer of the UART. More... | |
static uint8_t | sio_tx_buf [SIO_BUF_COUNT][SIO_TX_BUF_SIZE] |
This is the transmit buffer of the UART. More... | |
static uint8_t * | sio_rx_ptr |
This pointer points to the next free element inside the receive buffer of the UART. More... | |
static volatile uint8_t | sio_rx_state |
This is the receiver state of the UART. More... | |
static uint8_t | sio_rx_length |
This is the length of the message should be received. More... | |
static uint8_t | data [20] |
This is the length of the message should be transmitted. More... | |
static uint8_t | data_length |
static uint8_t | rx_index |
static uint8_t | head |
static uint8_t | buf_count |
static uint8_t | protocol_id |
static zrc_indication_callback_t | zrc_ind_cb |
static nwk_indication_callback_t | nwk_ind_callback |
nlme_start_confirm_cb_t | nlme_start_confirm_cb |
nlme_reset_confirm_cb_t | nlme_reset_confirm_cb |
nlme_rx_enable_confirm_cb_t | nlme_rx_enable_confirm_cb |
nlde_data_confirm_cb_t | nlde_data_confirm_cb |
nlme_auto_discovery_confirm_cb_t | nlme_auto_discovery_confirm_cb |
nlme_discovery_confirm_cb_t | nlme_discovery_confirm_cb |
nlme_get_confirm_cb_t | nlme_get_confirm_cb |
nlme_pair_confirm_cb_t | nlme_pair_confirm_cb |
nlme_set_confirm_cb_t | nlme_set_confirm_cb |
nlme_unpair_confirm_cb_t | nlme_unpair_confirm_cb |
nlme_update_key_confirm_cb_t | nlme_update_key_confirm_cb |
nwk_ch_agility_confirm_cb_t | nwk_ch_agility_confirm_cb |
pbp_org_pair_confirm_cb_t | pbp_org_pair_confirm_cb |
pbp_rec_pair_confirm_cb_t | pbp_rec_pair_confirm_cb |
zrc_cmd_confirm_cb_t | zrc_cmd_confirm_cb |
zrc_cmd_disc_confirm_cb_t | zrc_cmd_disc_confirm_cb |
#define EOT (4) |
The end of transmission delimiter.
Referenced by nlde_data_request(), nlme_auto_discovery_request(), nlme_discovery_request(), nlme_discovery_response(), nlme_get_request(), nlme_pair_request(), nlme_pair_response(), nlme_reset_request(), nlme_rx_enable_request(), nlme_set_request(), nlme_start_request(), nlme_unpair_request(), nlme_unpair_response(), nlme_update_key_request(), nwk_ch_agility_request(), pbp_org_pair_request(), pbp_rec_pair_request(), process_incoming_data(), zrc_cmd_disc_request(), zrc_cmd_disc_response(), and zrc_cmd_request().
#define GET_NIB_ATTR_SIZE | ( | x | ) |
Gets attribute size by reading from a table stored in flash.
Referenced by nwk_get_nib_attribute_size().
#define RF4CONTROL_PID (2) |
#define RF4CONTROL_PID_LEN (1) |
#define SIO_BUF_COUNT (2) |
Referenced by get_next_tx_buffer(), and nwk_task().
#define SIO_RX2NCP_BUF_SIZE (200) |
Referenced by nwk_task().
#define SIO_TX_BUF_SIZE SIO_RX2NCP_BUF_SIZE |
#define SOT (1) |
The start of transmission delimiter.
Referenced by get_next_tx_buffer(), and process_incoming_data().
#define UART_RX_PROTOCOL_ID (3) |
A UART state that expects the length to be received as the next character.
Referenced by process_incoming_data().
#define UART_RX_STATE_DATA (4) |
A UART state that expects the next data character to be received.
Referenced by process_incoming_data().
#define UART_RX_STATE_EOT (5) |
A UART state that expects a EOT to be received as the next character.
Referenced by process_incoming_data().
#define UART_RX_STATE_LENGTH (2) |
A UART state that expects the length to be received as the next character.
Referenced by process_incoming_data().
#define UART_RX_STATE_SOT (1) |
A UART state that expects a SOT to be received as the next character.
Referenced by process_incoming_data(), and serial_api_init().
|
static |
Size constants for NIB attributes.
|
static |
References buf_count, head, SIO_BUF_COUNT, sio_tx_buf, and SOT.
Referenced by nlde_data_request(), nlme_auto_discovery_request(), nlme_discovery_request(), nlme_discovery_response(), nlme_get_request(), nlme_pair_request(), nlme_pair_response(), nlme_reset_request(), nlme_rx_enable_request(), nlme_set_request(), nlme_start_request(), nlme_unpair_request(), nlme_unpair_response(), nlme_update_key_request(), nwk_ch_agility_request(), pbp_org_pair_request(), pbp_rec_pair_request(), zrc_cmd_disc_request(), zrc_cmd_disc_response(), and zrc_cmd_request().
|
inlinestatic |
References NodeDesc_tag::AppCapabilities, DEVICE_TYPE_LIST_SIZE, NodeDesc_tag::DevTypeList, NodeDesc_tag::DiscReqLQI, NodeDesc_tag::LogicalChannel, MEMCPY_ENDIAN, NLDE_DATA_CONFIRM, nlde_data_confirm_cb, NLDE_DATA_INDICATION, nwk_indication_callback_tag::nlde_data_indication_cb, NLME_AUTO_DISCOVERY_CONFIRM, nlme_auto_discovery_confirm_cb, NLME_COMM_STATUS_INDICATION, nwk_indication_callback_tag::nlme_comm_status_indication_cb, NLME_DISCOVERY_CONFIRM, nlme_discovery_confirm_cb, NLME_DISCOVERY_INDICATION, nwk_indication_callback_tag::nlme_discovery_indication_cb, NLME_GET_CONFIRM, nlme_get_confirm_cb, NLME_PAIR_CONFIRM, nlme_pair_confirm_cb, NLME_PAIR_INDICATION, nwk_indication_callback_tag::nlme_pair_indication_cb, NLME_RESET_CONFIRM, nlme_reset_confirm_cb, NLME_RX_ENABLE_CONFIRM, nlme_rx_enable_confirm_cb, NLME_SET_CONFIRM, nlme_set_confirm_cb, NLME_START_CONFIRM, nlme_start_confirm_cb, NLME_UNPAIR_CONFIRM, nlme_unpair_confirm_cb, NLME_UNPAIR_INDICATION, nwk_indication_callback_tag::nlme_unpair_indication_cb, NLME_UPDATE_KEY_CONFIRM, nlme_update_key_confirm_cb, NodeDesc_tag::NodeCapabilities, NWK_CH_AGILITY_CONFIRM, nwk_ch_agility_confirm_cb, NWK_CH_AGILITY_INDICATION, nwk_indication_callback_tag::nwk_ch_agility_indication_cb, NodeDesc_tag::PANId, PBP_ORG_PAIR_CONFIRM, pbp_org_pair_confirm_cb, PBP_REC_PAIR_CONFIRM, pbp_rec_pair_confirm_cb, PROFILE_ID_LIST_SIZE, NodeDesc_tag::ProfileIdList, sio_rx_buf, NodeDesc_tag::Status, NodeDesc_tag::UserString, zrc_indication_callback::vendor_data_ind_cb, VENDOR_DATA_INDICATION, NodeDesc_tag::VendorId, NodeDesc_tag::VendorString, ZRC_CMD_CONFIRM, zrc_cmd_confirm_cb, zrc_cmd_disc_confirm_cb, zrc_indication_callback::zrc_cmd_disc_indication_cb, ZRC_CMD_DISCOVERY_CONFIRM, ZRC_CMD_DISCOVERY_INDICATION, ZRC_CMD_INDICATION, and zrc_indication_callback::zrc_cmd_indication_cb.
Referenced by process_incoming_data().
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.
The NLDE-DATA.request primitive requests the transfer of a data APDU (i.e. NSDU) from a local application entity to a peer application entity.
PairingRef | Pairing reference used for the data transmission |
ProfileId | Profile Id used for the data transmission |
VendorId | Vendor Id used for the data transmission |
nsduLength | Length of the network payload |
nsdu | Pointer to the payload |
TxOptions | Transmission options |
Handle | Data retry handle |
confirm_cb | Call back pointer for the confirmation |
References EOT, get_next_tx_buffer(), nlde_data_confirm_cb, NLDE_DATA_REQ_LEN, NLDE_DATA_REQUEST, RF4CONTROL_PID, and RF4CONTROL_PID_LEN.
Referenced by handle_incoming_msg().
bool nlme_auto_discovery_request | ( | uint8_t | RecAppCapabilities, |
dev_type_t | RecDevTypeList[DEVICE_TYPE_LIST_SIZE], | ||
profile_id_t | RecProfileIdList[PROFILE_ID_LIST_SIZE], | ||
uint32_t | AutoDiscDuration, | ||
FUNC_PTR | confirm_cb | ||
) |
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-DISCOVERY.request primitive API.
The NLME-DISCOVERY.request primitive allows the application to request the NLME discover other devices of interest operating in the POS of the device.
DstPANId | The PAN identifier of the destination device for the discovery. This value can be set to 0xffff to indicate a wildcard. |
DstNwkAddr | The address of the destination device for the discovery. This value can be set to 0xffff to indicate a wildcard. |
OrgAppCapabilities | The application capabilities of the node. |
OrgDevTypeList | The list of device types supported by the node. |
OrgProfileIdList | The list of profile identifiers disclosed as supported by the node. |
SearchDevType | The device type to discover. This value can be set to 0xff to indicate a wildcard. |
DiscProfileIdListSize | The number of profile identifiers contained in the DiscProfileIdList parameter. |
DiscProfileIdList | The list of profile identifiers against which profile identifiers contained in received discovery response command frames will be matched for acceptance. |
DiscDuration | The maximum number of MAC symbols to wait for discovery responses. |
confirm_cb | Call back pointer for the confirmation |
References DEVICE_TYPE_LIST_SIZE, EOT, get_next_tx_buffer(), nlme_discovery_confirm_cb, NLME_DISCOVERY_REQ_LEN, NLME_DISCOVERY_REQUEST, PROFILE_ID_LIST_SIZE, RF4CONTROL_PID, and RF4CONTROL_PID_LEN.
Referenced by handle_incoming_msg().
bool nlme_discovery_response | ( | nwk_enum_t | Status, |
uint64_t | DstIEEEAddr, | ||
uint8_t | RecAppCapabilities, | ||
dev_type_t | RecDevTypeList[3], | ||
profile_id_t | RecProfileIdList[7], | ||
uint8_t | DiscReqLQI | ||
) |
NLME-DISCOVERY.response primitive API.
The NLME-DISCOVERY.response primitive allows the application to request that the NLME respond to the discovery request command.
Status | The status of the discovery request. |
DstIEEEAddr | The IEEE address of the device requesting discovery. |
RecAppCapabilities | The application capabilities of the node issuing this primitive. |
RecDevTypeList | The list of device types supported by the node issuing this primitive. |
RecProfileIdList | The list of profile identifiers supported by the node issuing this primitive. |
DiscReqLQI | The LQI value from the associated NLME-DISCOVERY.indication primitive. |
References DEVICE_TYPE_LIST_SIZE, EOT, get_next_tx_buffer(), MEMCPY_ENDIAN, NLME_DISCOVERY_RESP_LEN, NLME_DISCOVERY_RESPONSE, PROFILE_ID_LIST_SIZE, RF4CONTROL_PID, and RF4CONTROL_PID_LEN.
Referenced by handle_incoming_msg().
bool nlme_get_request | ( | nib_attribute_t | NIBAttribute, |
uint8_t | NIBAttributeIndex, | ||
FUNC_PTR | confirm_cb | ||
) |
NLME-GET.request primitive API.
The NLME-GET.request primitive allows the application to request the value of a NIB attribute from the NLME.
NIBAttribute | The identifier of the NIB attribute to read. |
NIBAttributeIndex | The index within the table or array of the specified NIB attribute to read. |
confirm_cb | Call back pointer for the confirmation |
References EOT, get_next_tx_buffer(), nlme_get_confirm_cb, NLME_GET_REQ_LEN, NLME_GET_REQUEST, RF4CONTROL_PID, and RF4CONTROL_PID_LEN.
Referenced by handle_incoming_msg().
bool nlme_pair_request | ( | uint8_t | LogicalChannel, |
uint16_t | DstPANId, | ||
uint64_t | DstIEEEAddr, | ||
uint8_t | OrgAppCapabilities, | ||
dev_type_t | OrgDevTypeList[DEVICE_TYPE_LIST_SIZE], | ||
profile_id_t | OrgProfileIdList[PROFILE_ID_LIST_SIZE], | ||
uint8_t | KeyExTransferCount, | ||
FUNC_PTR | confirm_cb | ||
) |
References DEVICE_TYPE_LIST_SIZE, EOT, get_next_tx_buffer(), nlme_pair_confirm_cb, NLME_PAIR_REQ_LEN, NLME_PAIR_REQUEST, PROFILE_ID_LIST_SIZE, RF4CONTROL_PID, and RF4CONTROL_PID_LEN.
Referenced by handle_incoming_msg().
bool nlme_pair_response | ( | nwk_enum_t | Status, |
uint16_t | DstPANId, | ||
uint64_t | DstIEEEAddr, | ||
uint8_t | RecAppCapabilities, | ||
dev_type_t | RecDevTypeList[3], | ||
profile_id_t | RecProfileIdList[7], | ||
uint8_t | ProvPairingRef | ||
) |
NLME-PAIR.response primitive API.
The NLME-PAIR.response primitive allows the application to request that the NLME respond to a pairing request command.
Status | The status of the pairing request. |
DstPANId | The PAN identifier of the device requesting the pair. |
DstIEEEAddr | The IEEE address of the device requesting the pair. |
RecAppCapabilities | The application capabilities of the node issuing this primitive. |
RecDevTypeList | The list of device types supported by the node issuing this primitive. |
RecProfileIdList | The list of profile identifiers supported by the node issuing this primitive. |
ProvPairingRef | The reference to the provisional pairing entry if the pair was accepted. |
References DEVICE_TYPE_LIST_SIZE, EOT, get_next_tx_buffer(), MEMCPY_ENDIAN, NLME_PAIR_RESP_LEN, NLME_PAIR_RESPONSE, PROFILE_ID_LIST_SIZE, RF4CONTROL_PID, and RF4CONTROL_PID_LEN.
Referenced by handle_incoming_msg().
NLME-RESET.request primitive API.
The NLME-RESET.request primitive allows the application entity to request a reset of the NWK layer.
SetDefaultNIB | If TRUE, the NWK layer is reset and all NIB attributes are set to their default values. If FALSE, the NWK layer is reset but all NIB attributes retain their values prior to the generation of the NLME-RESET.request primitive. |
confirm_cb | Call back pointer for the confirmation |
References EOT, get_next_tx_buffer(), nlme_reset_confirm_cb, NLME_RESET_REQ_LEN, NLME_RESET_REQUEST, RF4CONTROL_PID, and RF4CONTROL_PID_LEN.
Referenced by handle_incoming_msg().
NLME-RX-ENABLE.request primitive API.
The NLME-RX-ENABLE.request primitive allows the application to request that the receiver is either enabled (for a finite period or until further notice) or disabled.
RxOnDuration | The number of MAC symbols for which the receiver is to be enabled. To activate power saving mode, this value should correspond to the value of nwkActivePeriod and nwkActivePeriod should not be equal to 0x000000. If this parameter is equal to 0x000000, the receiver is disabled, allowing the node to enter dormant power save mode. If this parameter is equal to 0xffffff, the receiver is enabled, allowing the node to come out of power save mode. |
confirm_cb | Call back pointer for the confirmation |
References EOT, get_next_tx_buffer(), MEMCPY_ENDIAN, nlme_rx_enable_confirm_cb, NLME_RX_ENABLE_REQ_LEN, NLME_RX_ENABLE_REQUEST, RF4CONTROL_PID, and RF4CONTROL_PID_LEN.
Referenced by handle_incoming_msg().
bool nlme_set_request | ( | nib_attribute_t | NIBAttribute, |
uint8_t | NIBAttributeIndex, | ||
uint8_t * | NIBAttributeValue, | ||
FUNC_PTR | confirm_cb | ||
) |
NLME-SET.request primitive API.
The NLME-SET.request primitive allows the application to request the NLME change the value of a NIB attribute.
NIBAttribute | The identifier of the NIB attribute to write. |
NIBAttributeIndex | The index within the table or array of the specified NIB attribute to write. |
NIBAttributeValue | The value of the indicated attribute to write. |
confirm_cb | Call back pointer for the confirmation |
References EOT, get_next_tx_buffer(), nlme_set_confirm_cb, NLME_SET_REQ_LEN, NLME_SET_REQUEST, nwk_get_nib_attribute_size(), RF4CONTROL_PID, and RF4CONTROL_PID_LEN.
Referenced by handle_incoming_msg().
NLME-START.request primitive API.
The NLME-START.request primitive allows the application to request the NLME start a network.
confirm_cb | Call back pointer for the confirmation |
References EOT, get_next_tx_buffer(), nlme_start_confirm_cb, NLME_START_REQ_LEN, NLME_START_REQUEST, RF4CONTROL_PID, and RF4CONTROL_PID_LEN.
Referenced by handle_incoming_msg().
NLME-UNPAIR.request primitive API.
The NLME-UNPAIR.request primitive allows the application to request the NLME removes a pairing link with another device both in the local and remote pairing tables.
PairingRef | The reference into the local pairing table of the entry that is to be removed. |
confirm_cb | Call back pointer for the confirmation |
References EOT, get_next_tx_buffer(), nlme_unpair_confirm_cb, NLME_UNPAIR_REQ_LEN, NLME_UNPAIR_REQUEST, RF4CONTROL_PID, and RF4CONTROL_PID_LEN.
Referenced by handle_incoming_msg().
bool nlme_unpair_response | ( | uint8_t | PairingRef | ) |
NLME-UNPAIR.response primitive API.
The NLME-UNPAIR.response primitive allows the application to notify the NLME that the pairing link indicated via the NLME-UNPAIR.indication primitive can be removed from the pairing table.
PairingRef | The reference into the local pairing table of the entry that is to be removed. |
References EOT, get_next_tx_buffer(), NLME_UNPAIR_RESP_LEN, NLME_UNPAIR_RESPONSE, RF4CONTROL_PID, and RF4CONTROL_PID_LEN.
Referenced by handle_incoming_msg().
NLME-UPDATE-KEY.request primitive API.
The NLME-UPDATE-KEY.request primitive allows the application to request the NLME change the security link key of an entry in the pairing table.
PairingRef | The reference into the local pairing table of the entry whose key is to be updated. |
NewLinkKey | The security link key to replace the key in the pairing table. |
confirm_cb | Call back pointer for the confirmation |
References EOT, get_next_tx_buffer(), nlme_update_key_confirm_cb, NLME_UPDATE_KEY_REQ_LEN, NLME_UPDATE_KEY_REQUEST, RF4CONTROL_PID, and RF4CONTROL_PID_LEN.
Referenced by handle_incoming_msg().
bool nwk_ch_agility_request | ( | nwk_agility_mode_t | AgilityMode, |
FUNC_PTR | confirm_cb | ||
) |
Sets channel agility mode.
The function configures the channel agility mode. Parameters of the channel agility feature, like ScanInterval, EdThreshold, IndicationCountThreshold and AutoChannelMode, can be set via NLME-SET.request. If power save mode is enabled, the channel agility mode is suspended until power save mode is left again.
AgilityMode | Channel agility mode: AG_ONE_SHOT - scans once AG_PERIODIC - starts periodic scanning AG_STOP - stops periodic scanning |
confirm_cb | Call back pointer for the confirmation |
References EOT, get_next_tx_buffer(), nwk_ch_agility_confirm_cb, nwk_ch_agility_confirm_cb_t, NWK_CH_AGILITY_REQ_LEN, NWK_CH_AGILITY_REQUEST, RF4CONTROL_PID, and RF4CONTROL_PID_LEN.
Referenced by handle_incoming_msg().
uint8_t nwk_get_nib_attribute_size | ( | uint8_t | nib_attribute_id | ) |
Gets the NIB attribute value size.
nib_attribute_id | NIB attribute ID |
References GET_NIB_ATTR_SIZE.
Referenced by nlme_get_confirm(), and nlme_set_request().
nwk_enum_t nwk_init | ( | void | ) |
Initialization of RF4CE network layer.
The RF4CE network layer needs to initialize after power-up of the MCU. The function nwk_init() initializes the network layer including the underlying layers, like MAC and queue and buffer management.
References NWK_SUCCESS, and serial_api_init().
Referenced by main().
bool nwk_task | ( | void | ) |
Function to handle the state machine serial data exchange.
Task handling of RF4CE network layer.
References buf_count, data, data_length, head, process_incoming_data(), rx_index, sio2ncp_rx(), sio2ncp_tx(), SIO_BUF_COUNT, SIO_RX2NCP_BUF_SIZE, and sio_tx_buf.
Referenced by main().
bool pbp_org_pair_request | ( | uint8_t | OrgAppCapabilities, |
dev_type_t | OrgDevTypeList[DEVICE_TYPE_LIST_SIZE], | ||
profile_id_t | OrgProfileIdList[PROFILE_ID_LIST_SIZE], | ||
dev_type_t | SearchDevType, | ||
uint8_t | DiscProfileIdListSize, | ||
profile_id_t | DiscProfileIdList[PROFILE_ID_LIST_SIZE], | ||
FUNC_PTR | confirm_cb | ||
) |
References DEVICE_TYPE_LIST_SIZE, EOT, get_next_tx_buffer(), pbp_org_pair_confirm_cb, PBP_ORG_PAIR_REQ_LEN, PBP_ORG_PAIR_REQUEST, PROFILE_ID_LIST_SIZE, RF4CONTROL_PID, and RF4CONTROL_PID_LEN.
Referenced by handle_incoming_msg().
bool pbp_rec_pair_request | ( | uint8_t | RecAppCapabilities, |
dev_type_t | RecDevTypeList[3], | ||
profile_id_t | RecProfileIdList[7], | ||
FUNC_PTR | confirm_cb | ||
) |
Recipient pair request; target use.
The push button pairing recipient pair request allows a target to start the push button pairing procedure; auto-discovery and incoming pairing handling.
RecAppCapabilities | Application capabilities of the device issuing the request |
RecDevTypeList | Supported device type list |
RecProfileIdList | Supported profile id list |
confirm_cb | Call back pointer for the confirmation |
References DEVICE_TYPE_LIST_SIZE, EOT, get_next_tx_buffer(), pbp_rec_pair_confirm_cb, PBP_REC_PAIR_REQ_LEN, PBP_REC_PAIR_REQUEST, PROFILE_ID_LIST_SIZE, RF4CONTROL_PID, and RF4CONTROL_PID_LEN.
Referenced by handle_incoming_msg().
|
inlinestatic |
References data, EOT, handle_incoming_msg(), protocol_id, RF4CONTROL_PID, rx_index, sio_rx_buf, sio_rx_length, sio_rx_ptr, sio_rx_state, SOT, UART_RX_PROTOCOL_ID, UART_RX_STATE_DATA, UART_RX_STATE_EOT, UART_RX_STATE_LENGTH, and UART_RX_STATE_SOT.
Referenced by nwk_task().
void register_nwk_indication_callback | ( | nwk_indication_callback_t * | nwk_indication_cb | ) |
Registering network indication callback.
The application/profile needs to register the network indication callback functions so that the corresponding function will get called by the network layer on receiving the indication
nwk_indication_callback_t | nwk_indication_cb |
References nwk_indication_callback_tag::nlde_data_indication_cb, nwk_indication_callback_tag::nlme_comm_status_indication_cb, nwk_indication_callback_tag::nlme_discovery_indication_cb, nwk_indication_callback_tag::nlme_pair_indication_cb, nwk_indication_callback_tag::nlme_unpair_indication_cb, nwk_indication_callback_tag::nwk_ch_agility_indication_cb, and nwk_indication_callback_tag::zrc_data_indication_cb.
Referenced by stack_indication_callback_init().
void register_zrc_indication_callback | ( | zrc_indication_callback_t * | zrc_ind_callback | ) |
Registering zrc indication callback.
The application needs to register the zrc indication call back functions so that the corresponding indication function will get called by the profile on receiving the indication from the network layer.
zrc_indication_callback_t | indication callback struct |
References zrc_indication_callback::vendor_data_ind_cb, zrc_indication_callback::zrc_cmd_disc_indication_cb, and zrc_indication_callback::zrc_cmd_indication_cb.
Referenced by stack_indication_callback_init().
void serial_api_init | ( | void | ) |
This function does the initialization of the SIO or UART.
References sio2ncp_init(), sio_rx_state, and UART_RX_STATE_SOT.
Referenced by nwk_init().
Handles the cmd discovery request.
Sends the ZRC command discovery request.
PairingRef | pairing ref of the originator device. |
References EOT, get_next_tx_buffer(), RF4CONTROL_PID, RF4CONTROL_PID_LEN, zrc_cmd_disc_confirm_cb, ZRC_CMD_DISCOVERY_REQ_LEN, and ZRC_CMD_DISCOVERY_REQUEST.
Referenced by handle_incoming_msg().
bool zrc_cmd_disc_response | ( | uint8_t | PairingRef, |
uint8_t * | SupportedCmd | ||
) |
Send out the cmd discovery response.
ZRC command discovery response.
PairingRef | pairing ref of the originator device. |
SupportedCmd | Address of provided 32 byte array containing supported command codes |
References EOT, get_next_tx_buffer(), RF4CONTROL_PID, ZRC_CMD_DISCOVERY_RESP_LEN, and ZRC_CMD_DISCOVERY_RESPONSE.
Referenced by handle_incoming_msg().
bool zrc_cmd_request | ( | uint8_t | PairingRef, |
uint16_t | VendorId, | ||
zrc_cmd_code_t | CmdCode, | ||
uint8_t | CmdLength, | ||
uint8_t * | Cmd, | ||
uint8_t | TxOptions, | ||
FUNC_PTR | confirm_cb | ||
) |
Handles the key press from the application.
Initialites the command transmission from the application.
PairingRef | Pairing reference |
VendorId | Vendor Id information |
CmdCode | ZRC cmd code (Press/Release) |
CmdLength | Length of the rc cmd (rc cmd code + Payload). |
Cmd | Actual rc command code (rc cmd code + Payload) |
TxOptions | Transmission options (ex- ack, security etc) |
References EOT, get_next_tx_buffer(), RF4CONTROL_PID, RF4CONTROL_PID_LEN, zrc_cmd_confirm_cb, ZRC_CMD_REQ_LEN, and ZRC_CMD_REQUEST.
Referenced by handle_incoming_msg().
|
static |
Referenced by get_next_tx_buffer(), and nwk_task().
|
static |
This is the length of the message should be transmitted.
Referenced by nwk_task(), and process_incoming_data().
|
static |
Referenced by nwk_task().
|
static |
Referenced by get_next_tx_buffer(), and nwk_task().
nlde_data_confirm_cb_t nlde_data_confirm_cb |
Referenced by handle_incoming_msg(), and nlde_data_request().
nlme_auto_discovery_confirm_cb_t nlme_auto_discovery_confirm_cb |
Referenced by handle_incoming_msg(), and nlme_auto_discovery_request().
nlme_discovery_confirm_cb_t nlme_discovery_confirm_cb |
Referenced by handle_incoming_msg(), and nlme_discovery_request().
nlme_get_confirm_cb_t nlme_get_confirm_cb |
Referenced by handle_incoming_msg(), and nlme_get_request().
nlme_pair_confirm_cb_t nlme_pair_confirm_cb |
Referenced by handle_incoming_msg(), and nlme_pair_request().
nlme_reset_confirm_cb_t nlme_reset_confirm_cb |
Referenced by handle_incoming_msg(), and nlme_reset_request().
nlme_rx_enable_confirm_cb_t nlme_rx_enable_confirm_cb |
Referenced by handle_incoming_msg(), and nlme_rx_enable_request().
nlme_set_confirm_cb_t nlme_set_confirm_cb |
Referenced by handle_incoming_msg(), and nlme_set_request().
nlme_start_confirm_cb_t nlme_start_confirm_cb |
Referenced by handle_incoming_msg(), and nlme_start_request().
nlme_unpair_confirm_cb_t nlme_unpair_confirm_cb |
Referenced by handle_incoming_msg(), and nlme_unpair_request().
nlme_update_key_confirm_cb_t nlme_update_key_confirm_cb |
Referenced by handle_incoming_msg(), and nlme_update_key_request().
nwk_ch_agility_confirm_cb_t nwk_ch_agility_confirm_cb |
Referenced by handle_incoming_msg(), and nwk_ch_agility_request().
|
static |
pbp_org_pair_confirm_cb_t pbp_org_pair_confirm_cb |
Referenced by handle_incoming_msg(), and pbp_org_pair_request().
pbp_rec_pair_confirm_cb_t pbp_rec_pair_confirm_cb |
Referenced by handle_incoming_msg(), and pbp_rec_pair_request().
|
static |
Referenced by process_incoming_data().
|
static |
Referenced by nwk_task(), and process_incoming_data().
|
static |
This is the receive buffer of the UART.
Referenced by handle_incoming_msg(), and process_incoming_data().
|
static |
This is the length of the message should be received.
Referenced by process_incoming_data().
|
static |
This pointer points to the next free element inside the receive buffer of the UART.
Referenced by process_incoming_data().
|
static |
This is the receiver state of the UART.
(UART_RX_STATE_SOT, UART_RX_STATE_LENGTH, UART_RX_STATE_DATA, or UART_RX_STATE_EOT)
Referenced by process_incoming_data(), and serial_api_init().
|
static |
This is the transmit buffer of the UART.
Referenced by get_next_tx_buffer(), and nwk_task().
zrc_cmd_confirm_cb_t zrc_cmd_confirm_cb |
Referenced by handle_incoming_msg(), and zrc_cmd_request().
zrc_cmd_disc_confirm_cb_t zrc_cmd_disc_confirm_cb |
Referenced by handle_incoming_msg(), and zrc_cmd_disc_request().
|
static |