Donavan Martin
/
Web_suck_et
Websocket example
Fork of Websocket_Ethernet_HelloWorld by
ATcommand.h@8:1b4bf6e5e029, 2017-12-03 (annotated)
- Committer:
- Dontydonty
- Date:
- Sun Dec 03 18:19:22 2017 +0000
- Revision:
- 8:1b4bf6e5e029
Web sock et
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Dontydonty | 8:1b4bf6e5e029 | 1 | #ifndef AT_COMMAND |
Dontydonty | 8:1b4bf6e5e029 | 2 | #define AT_COMMAND |
Dontydonty | 8:1b4bf6e5e029 | 3 | |
Dontydonty | 8:1b4bf6e5e029 | 4 | #define STATUS_OK 0 |
Dontydonty | 8:1b4bf6e5e029 | 5 | #define STATUS_ERROR 1 |
Dontydonty | 8:1b4bf6e5e029 | 6 | #define STATUS_INVALID_COMMAND 2 |
Dontydonty | 8:1b4bf6e5e029 | 7 | #define STATUS_INVALID_PARAMETER 3 |
Dontydonty | 8:1b4bf6e5e029 | 8 | #define STATUS_TX_FAILURE 4 |
Dontydonty | 8:1b4bf6e5e029 | 9 | |
Dontydonty | 8:1b4bf6e5e029 | 10 | #define IO_SAMPLE_RX_INDICATOR 0x92 |
Dontydonty | 8:1b4bf6e5e029 | 11 | |
Dontydonty | 8:1b4bf6e5e029 | 12 | #define AT_COMMAND_RESPONSE 0x88 |
Dontydonty | 8:1b4bf6e5e029 | 13 | #define PacketAcknowledged 1 |
Dontydonty | 8:1b4bf6e5e029 | 14 | #define PacketBroadcast 2 |
Dontydonty | 8:1b4bf6e5e029 | 15 | |
Dontydonty | 8:1b4bf6e5e029 | 16 | #include "mbed.h" |
Dontydonty | 8:1b4bf6e5e029 | 17 | |
Dontydonty | 8:1b4bf6e5e029 | 18 | // Application |
Dontydonty | 8:1b4bf6e5e029 | 19 | void print(Serial *pc, char buff[]); |
Dontydonty | 8:1b4bf6e5e029 | 20 | void toggleError(Serial *xbee, Serial *pc,int timeout, char * msg); |
Dontydonty | 8:1b4bf6e5e029 | 21 | //void waitForConnection(Serial *xbee, Serial *pc, char * macAddr); |
Dontydonty | 8:1b4bf6e5e029 | 22 | void sendAccData(Serial *xbee, Serial *pc, char * macAddr ,char D[4]); |
Dontydonty | 8:1b4bf6e5e029 | 23 | int decodePacket(Serial *xbee, Serial *pc, char *packet, int len); |
Dontydonty | 8:1b4bf6e5e029 | 24 | int receiveAcknowledge(Serial *xbee, Serial *pc); |
Dontydonty | 8:1b4bf6e5e029 | 25 | |
Dontydonty | 8:1b4bf6e5e029 | 26 | // Network |
Dontydonty | 8:1b4bf6e5e029 | 27 | char getStatusResponse(Serial *xbee, Serial *pc); |
Dontydonty | 8:1b4bf6e5e029 | 28 | int ND(Serial *xbee, Serial *pc, char * macAddr); |
Dontydonty | 8:1b4bf6e5e029 | 29 | |
Dontydonty | 8:1b4bf6e5e029 | 30 | // MAC |
Dontydonty | 8:1b4bf6e5e029 | 31 | int isStartDelimiter(Serial *xbee, Serial *pc); |
Dontydonty | 8:1b4bf6e5e029 | 32 | int getLenght(Serial *xbee, Serial *pc); |
Dontydonty | 8:1b4bf6e5e029 | 33 | char * readFrame(Serial *xbee, Serial *pc); |
Dontydonty | 8:1b4bf6e5e029 | 34 | char * readParam(Serial *xbee, Serial *pc); |
Dontydonty | 8:1b4bf6e5e029 | 35 | |
Dontydonty | 8:1b4bf6e5e029 | 36 | // PHY |
Dontydonty | 8:1b4bf6e5e029 | 37 | char read (Serial *xbee, Serial *pc, char *msg); |
Dontydonty | 8:1b4bf6e5e029 | 38 | char * read(Serial *xbee, Serial *pc, int nbyte, char* msg); |
Dontydonty | 8:1b4bf6e5e029 | 39 | void send (Serial *xbee, Serial *pc, char *b, int size); |
Dontydonty | 8:1b4bf6e5e029 | 40 | void sendAT(Serial *xbee, Serial *pc, char* command, char* params, int lenparams); |
Dontydonty | 8:1b4bf6e5e029 | 41 | void sendTR(Serial *xbee, Serial *pc, char* macAddr, char *RFdata,int len); |
Dontydonty | 8:1b4bf6e5e029 | 42 | char checksum(char* array, int size); |
Dontydonty | 8:1b4bf6e5e029 | 43 | void ATWR (Serial *xbee, Serial *pc); |
Dontydonty | 8:1b4bf6e5e029 | 44 | void apply(Serial *xbee, Serial *pc); |
Dontydonty | 8:1b4bf6e5e029 | 45 | void flush(Serial *xbee, Serial *pc); |
Dontydonty | 8:1b4bf6e5e029 | 46 | |
Dontydonty | 8:1b4bf6e5e029 | 47 | #endif |