Websocket example

Dependencies:   WebSocketClient

Fork of Websocket_Ethernet_HelloWorld by mbed_example

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ATcommand.h Source File

ATcommand.h

00001 #ifndef AT_COMMAND
00002 #define AT_COMMAND
00003 
00004 #define STATUS_OK                0
00005 #define STATUS_ERROR             1
00006 #define STATUS_INVALID_COMMAND   2
00007 #define STATUS_INVALID_PARAMETER 3
00008 #define STATUS_TX_FAILURE        4
00009 
00010 #define IO_SAMPLE_RX_INDICATOR   0x92
00011 
00012 #define AT_COMMAND_RESPONSE      0x88
00013 #define PacketAcknowledged       1
00014 #define PacketBroadcast          2
00015 
00016 #include "mbed.h"
00017 
00018 // Application
00019 void print(Serial *pc, char buff[]);
00020 void toggleError(Serial *xbee, Serial *pc,int timeout, char * msg);
00021 //void waitForConnection(Serial *xbee, Serial *pc, char * macAddr);
00022 void sendAccData(Serial *xbee, Serial *pc, char * macAddr ,char D[4]);
00023 int decodePacket(Serial *xbee, Serial *pc, char *packet, int len);
00024 int receiveAcknowledge(Serial *xbee, Serial *pc);
00025 
00026 // Network
00027 char getStatusResponse(Serial *xbee, Serial *pc);
00028 int ND(Serial *xbee, Serial *pc, char * macAddr);
00029 
00030 //  MAC
00031 int  isStartDelimiter(Serial *xbee, Serial *pc);
00032 int  getLenght(Serial *xbee, Serial *pc);
00033 char * readFrame(Serial *xbee, Serial *pc);
00034 char * readParam(Serial *xbee, Serial *pc);
00035 
00036 // PHY
00037 char read (Serial *xbee, Serial *pc, char *msg);
00038 char * read(Serial *xbee, Serial *pc, int nbyte,  char* msg);
00039 void send (Serial *xbee, Serial *pc, char *b, int size);
00040 void sendAT(Serial *xbee, Serial *pc, char* command, char* params, int lenparams);
00041 void sendTR(Serial *xbee, Serial *pc, char* macAddr, char *RFdata,int len);
00042 char checksum(char* array, int size);
00043 void ATWR (Serial *xbee, Serial *pc);
00044 void apply(Serial *xbee, Serial *pc);
00045 void flush(Serial *xbee, Serial *pc);
00046 
00047 #endif