This module is responsible for encoding and decoding the serial bytes to/from NCP into MAC APIs to provide seamless working for application similar to stack running in same processor or on NCP.This module is used for Two Processor Approach .
The Two Processor approach basically consists of two devices Host and NCP(Network Co-Processor).The MAC Stack runs on the NCP and the MAC application runs on the Host.The api-parser module is used by the host which will convert the mac api's to necessary command bytes stream (MAC API Encoder) and send it to the NCP. The NCP board will contain the image of serial-if application (MAC Core Stack) and this will receive necessary command bytes encode it to api's and process it and send back command bytes as response which will be decoded in the host by the api-parser module(MAC API Decoder).
Modules | |
MAC API Decoder | |
The API Encoder Module Decodes the incoming command byte stream to corresponding MAC Api's. | |
MAC API Encoder | |
The API Encoder Module Encodes the MAC Api's into appropriate command byte stream. | |
Macros | |
#define | CMD_POS 0x03 |
#define | EOT (4) |
The end of transmission delimiter. More... | |
#define | LEN_POS 0x01 |
#define | MAX_BUFFER_LENGTH 160 |
#define | PROTOCOL_ID 0X01 |
#define | PROTOCOL_ID_POS 0x02 |
#define | RX_BUFFER_LENGTH MAX_BUFFER_LENGTH |
#define | SOT (1) |
The start of transmission delimiter. More... | |
#define | SOT_POS 0x00 |
#define | TX_BUFFER_LENGTH MAX_BUFFER_LENGTH |
#define | UART_RX_STATE_DATA (3) |
A UART state that expects the next data character to be received. More... | |
#define | UART_RX_STATE_EOT (4) |
A UART state that expects a EOT 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_STATE_SOT (1) |
A UART state that expects a SOT to be received as the next character. More... | |
Functions | |
void | handle_rx_frame (void) |
void | process_rf_serial_byte (uint8_t byte) |
Variables | |
uint8_t | rcv_buffer [] |
uint8_t * | rcv_frame_ptr |
#define CMD_POS 0x03 |
Referenced by wpan_mcps_data_req(), wpan_mcps_purge_req(), wpan_mlme_associate_req(), wpan_mlme_associate_resp(), wpan_mlme_disassociate_req(), wpan_mlme_get_req(), wpan_mlme_gts_req(), wpan_mlme_orphan_resp(), wpan_mlme_poll_req(), wpan_mlme_reset_req(), wpan_mlme_rx_enable_req(), wpan_mlme_scan_req(), wpan_mlme_set_req(), wpan_mlme_start_req(), and wpan_mlme_sync_req().
#define EOT (4) |
The end of transmission delimiter.
Referenced by api_process_incoming_sio_data(), process_rf_serial_byte(), wpan_mcps_data_req(), wpan_mcps_purge_req(), wpan_mlme_associate_req(), wpan_mlme_associate_resp(), wpan_mlme_disassociate_req(), wpan_mlme_get_req(), wpan_mlme_gts_req(), wpan_mlme_orphan_resp(), wpan_mlme_poll_req(), wpan_mlme_reset_req(), wpan_mlme_rx_enable_req(), wpan_mlme_scan_req(), wpan_mlme_set_req(), wpan_mlme_start_req(), and wpan_mlme_sync_req().
#define LEN_POS 0x01 |
Referenced by wpan_mcps_data_req(), wpan_mcps_purge_req(), wpan_mlme_associate_req(), wpan_mlme_associate_resp(), wpan_mlme_disassociate_req(), wpan_mlme_get_req(), wpan_mlme_gts_req(), wpan_mlme_orphan_resp(), wpan_mlme_poll_req(), wpan_mlme_reset_req(), wpan_mlme_rx_enable_req(), wpan_mlme_scan_req(), wpan_mlme_set_req(), wpan_mlme_start_req(), and wpan_mlme_sync_req().
#define MAX_BUFFER_LENGTH 160 |
#define PROTOCOL_ID 0X01 |
Referenced by wpan_init().
#define PROTOCOL_ID_POS 0x02 |
Referenced by wpan_init().
#define RX_BUFFER_LENGTH MAX_BUFFER_LENGTH |
#define SOT (1) |
The start of transmission delimiter.
Referenced by api_process_incoming_sio_data(), process_rf_serial_byte(), and wpan_init().
#define SOT_POS 0x00 |
Referenced by wpan_init().
#define TX_BUFFER_LENGTH MAX_BUFFER_LENGTH |
#define UART_RX_STATE_DATA (3) |
A UART state that expects the next data character to be received.
Referenced by api_process_incoming_sio_data(), and process_rf_serial_byte().
#define UART_RX_STATE_EOT (4) |
A UART state that expects a EOT to be received as the next character.
Referenced by api_process_incoming_sio_data(), and process_rf_serial_byte().
#define UART_RX_STATE_LENGTH (2) |
A UART state that expects the length to be received as the next character.
Referenced by api_process_incoming_sio_data(), and process_rf_serial_byte().
#define UART_RX_STATE_SOT (1) |
A UART state that expects a SOT to be received as the next character.
Referenced by api_process_incoming_sio_data(), and process_rf_serial_byte().
void handle_rx_frame | ( | void | ) |
References wpan_addr_spec_tag::Addr, wpan_addr_spec_tag::AddrMode, MCPS_DATA_CONFIRM, MCPS_DATA_INDICATION, MCPS_PURGE_CONFIRM, MLME_ASSOCIATE_CONFIRM, MLME_ASSOCIATE_INDICATION, MLME_BEACON_NOTIFY_INDICATION, MLME_COMM_STATUS_INDICATION, MLME_DISASSOCIATE_CONFIRM, MLME_DISASSOCIATE_INDICATION, MLME_GET_CONFIRM, MLME_GTS_CONFIRM, MLME_GTS_INDICATION, MLME_ORPHAN_INDICATION, MLME_POLL_CONFIRM, MLME_RESET_CONFIRM, MLME_RX_ENABLE_CONFIRM, MLME_SCAN_CONFIRM, MLME_SET_CONFIRM, MLME_START_CONFIRM, MLME_SYNC_LOSS_INDICATION, wpan_addr_spec_tag::PANId, rcv_frame_ptr, usr_mcps_data_conf(), usr_mcps_data_ind(), usr_mcps_purge_conf(), usr_mlme_associate_conf(), usr_mlme_associate_ind(), usr_mlme_beacon_notify_ind(), usr_mlme_comm_status_ind(), usr_mlme_disassociate_conf(), usr_mlme_disassociate_ind(), usr_mlme_get_conf(), usr_mlme_gts_conf(), usr_mlme_gts_ind(), usr_mlme_orphan_ind(), usr_mlme_poll_conf(), usr_mlme_reset_conf(), usr_mlme_rx_enable_conf(), usr_mlme_scan_conf(), usr_mlme_set_conf(), usr_mlme_start_conf(), usr_mlme_sync_loss_ind(), and WPAN_DESCRIPTOR_LEN.
Referenced by api_process_incoming_sio_data(), and process_rf_serial_byte().
void process_rf_serial_byte | ( | uint8_t | byte | ) |
References EOT, handle_rx_frame(), rcv_buff_ptr, rcv_buffer, rcv_length, rcv_state, SOT, UART_RX_STATE_DATA, UART_RX_STATE_EOT, UART_RX_STATE_LENGTH, and UART_RX_STATE_SOT.
uint8_t rcv_buffer[] |
Referenced by api_process_incoming_sio_data(), process_rf_serial_byte(), and wpan_init().
uint8_t* rcv_frame_ptr |
Referenced by handle_rx_frame(), mac_get_pib_attribute_size(), and wpan_init().