Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
API Parser Module

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).

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 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().

uint8_t rcv_buffer[]
uint8_t* rcv_frame_ptr