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 .
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).
|
| MAC API Encoder |
| The API Encoder Module Encodes the MAC Api's into appropriate command byte stream.
|
|
| MAC API Decoder |
| The API Encoder Module Decodes the incoming command byte stream to corresponding MAC Api's.
|
|
The end of transmission delimiter.
#define MAX_BUFFER_LENGTH 160 |
#define PROTOCOL_ID_POS 0x02 |
The start of transmission delimiter.
#define UART_RX_STATE_DATA (3) |
A UART state that expects the next data character to be received.
#define UART_RX_STATE_EOT (4) |
A UART state that expects a EOT to be received as the next character.
#define UART_RX_STATE_LENGTH (2) |
A UART state that expects the length to be received as the next character.
#define UART_RX_STATE_SOT (1) |
A UART state that expects a SOT to be received as the next character.
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_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.