Etienne Beauregard
/
APP3_Capteur_V2
lalallaa
xbee_command.h@0:4a3d5d86258c, 2017-10-03 (annotated)
- Committer:
- EtienneB
- Date:
- Tue Oct 03 01:13:51 2017 +0000
- Revision:
- 0:4a3d5d86258c
- Child:
- 1:6738a65b699f
Version de validation du code
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
EtienneB | 0:4a3d5d86258c | 1 | #ifndef MBED_XBEE_COMMAND_H |
EtienneB | 0:4a3d5d86258c | 2 | #define MBED_XBEE_COMMAND_H |
EtienneB | 0:4a3d5d86258c | 3 | |
EtienneB | 0:4a3d5d86258c | 4 | // API Frame Names API ID |
EtienneB | 0:4a3d5d86258c | 5 | #define AT_CMD 0x08 |
EtienneB | 0:4a3d5d86258c | 6 | #define AT_CMD_QUEUE 0x09 |
EtienneB | 0:4a3d5d86258c | 7 | #define TX_REQUEST 0x10 |
EtienneB | 0:4a3d5d86258c | 8 | #define RMT_AT_RQST 0x17 |
EtienneB | 0:4a3d5d86258c | 9 | #define CREATE_SRC_R 0x21 |
EtienneB | 0:4a3d5d86258c | 10 | #define AT_CMD_RSPNS 0x88 |
EtienneB | 0:4a3d5d86258c | 11 | #define MODEM_STATUS 0x8A |
EtienneB | 0:4a3d5d86258c | 12 | #define ZBEE_TX_STATUS 0x8B |
EtienneB | 0:4a3d5d86258c | 13 | #define RMT_CMD_RSPNS 0x97 |
EtienneB | 0:4a3d5d86258c | 14 | |
EtienneB | 0:4a3d5d86258c | 15 | // API Frame length |
EtienneB | 0:4a3d5d86258c | 16 | #define AT_MSB 0x00 |
EtienneB | 0:4a3d5d86258c | 17 | #define AT_LSB 0x04 |
EtienneB | 0:4a3d5d86258c | 18 | |
EtienneB | 0:4a3d5d86258c | 19 | #define TX_RQST_MSB 0x00 |
EtienneB | 0:4a3d5d86258c | 20 | #define TX_RQST_LSB 0x17 |
EtienneB | 0:4a3d5d86258c | 21 | |
EtienneB | 0:4a3d5d86258c | 22 | #define RMT_AT_MSB 0x00 |
EtienneB | 0:4a3d5d86258c | 23 | #define RMT_AT_LSB 0x10 |
EtienneB | 0:4a3d5d86258c | 24 | |
EtienneB | 0:4a3d5d86258c | 25 | // |
EtienneB | 0:4a3d5d86258c | 26 | #define BROADCAST_RAD 0x00 |
EtienneB | 0:4a3d5d86258c | 27 | |
EtienneB | 0:4a3d5d86258c | 28 | //AT command |
EtienneB | 0:4a3d5d86258c | 29 | #define AT_CMD_ID 0x4944 |
EtienneB | 0:4a3d5d86258c | 30 | #define AT_CMD_SC 0x5343 |
EtienneB | 0:4a3d5d86258c | 31 | #define AT_CMD_WR 0x5752 |
EtienneB | 0:4a3d5d86258c | 32 | #define AT_CMD_AC 0x4143 |
EtienneB | 0:4a3d5d86258c | 33 | |
EtienneB | 0:4a3d5d86258c | 34 | // |
EtienneB | 0:4a3d5d86258c | 35 | #define START 0x7E |
EtienneB | 0:4a3d5d86258c | 36 | #define CMD_AT 0x08 |
EtienneB | 0:4a3d5d86258c | 37 | #define CMD_TX_RQST 0X10 |
EtienneB | 0:4a3d5d86258c | 38 | #define RMT_CMD_RQST 0X17 |
EtienneB | 0:4a3d5d86258c | 39 | #define PLUS 0x2B |
EtienneB | 0:4a3d5d86258c | 40 | #define FRAME_ID01 0x01 |
EtienneB | 0:4a3d5d86258c | 41 | |
EtienneB | 0:4a3d5d86258c | 42 | uint16_t PAN_ID = 0; |
EtienneB | 0:4a3d5d86258c | 43 | uint16_t FREQ_LECTURE_CAPTEURS = 0; |
EtienneB | 0:4a3d5d86258c | 44 | |
EtienneB | 0:4a3d5d86258c | 45 | // Fonctions communication entre LPC1768 et XBee |
EtienneB | 0:4a3d5d86258c | 46 | uint8_t build_AT_cmd_frame(uint8_t frame_id, uint16_t p_AT_cmd, uint8_t* p_value, uint8_t p_value_length, uint8_t* p_at_cmd_frame); |
EtienneB | 0:4a3d5d86258c | 47 | uint8_t build_tx_request_frame(uint8_t* p_mac_address, uint16_t p_pan_id, uint8_t* p_tx_request_frame, uint8_t *data, uint8_t data_length); |
EtienneB | 0:4a3d5d86258c | 48 | bool send_frame_2xbee(uint8_t* frame, uint8_t frame_length); |
EtienneB | 0:4a3d5d86258c | 49 | bool send_char_2Xbee(uint8_t caratere); |
EtienneB | 0:4a3d5d86258c | 50 | uint8_t receive_Xbee(uint8_t* message_recu); |
EtienneB | 0:4a3d5d86258c | 51 | bool xbee_init(uint16_t pan_id); |
EtienneB | 0:4a3d5d86258c | 52 | uint8_t build_remote_cmd_request_frame(uint8_t p_frame_id, uint16_t p_pan_id, uint16_t p_AT_cmd, uint8_t* p_remote_cmd_request_frame); |
EtienneB | 0:4a3d5d86258c | 53 | bool message_received(uint8_t* message_recu); |
EtienneB | 0:4a3d5d86258c | 54 | #endif |