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

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
#define EOT   (4)

The end of transmission delimiter.

#define LEN_POS   0x01
#define MAX_BUFFER_LENGTH   160
#define PROTOCOL_ID   0X01
#define PROTOCOL_ID_POS   0x02

Referenced by wpan_init().

#define RX_BUFFER_LENGTH   MAX_BUFFER_LENGTH
#define SOT   (1)

The start of transmission delimiter.

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

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

uint8_t rcv_buffer[]
uint8_t* rcv_frame_ptr