Bruno Allaire-Lemay / NerfUSXbee
Committer:
dupm2216
Date:
Sun Feb 12 22:42:45 2017 +0000
Revision:
5:cd3c79853dc8
Parent:
4:e97cfe6cc18c
Child:
6:b70f32a80d51
AT command for powering the LED

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dupm2216 0:8f5379c94a69 1 #ifndef XBEE_HPP
dupm2216 0:8f5379c94a69 2 #define XBEE_HPP
dupm2216 0:8f5379c94a69 3
dupm2216 0:8f5379c94a69 4 #include <vector>
dupm2216 0:8f5379c94a69 5 #include <cassert>
dupm2216 0:8f5379c94a69 6 #include "mbed.h"
dupm2216 0:8f5379c94a69 7 #include "rtos.h"
dupm2216 0:8f5379c94a69 8
dupm2216 3:37ea92feece2 9 //See xbee document page 99
dupm2216 3:37ea92feece2 10 const char FRAME_TYPE_RECEIVE_PACKET = 0x90;
dupm2216 3:37ea92feece2 11 const char FRAME_TYPE_TRANSMIT_STATUS = 0x8B;
dupm2216 3:37ea92feece2 12 const char FRAME_TYPE_AT_COMMAND_RESPONSE = 0x88;
dupm2216 3:37ea92feece2 13
dupm2216 3:37ea92feece2 14 const char TRANSMIT_STATUS_SUCCESS = 0x00;
dupm2216 3:37ea92feece2 15 const char AT_COMMAND_RESPONSE_STATUS_OK = 0x00;
dupm2216 3:37ea92feece2 16
dupm2216 4:e97cfe6cc18c 17 extern Mail<vector<char>, 30> parsed_frames;
dupm2216 5:cd3c79853dc8 18 extern RawSerial xbee;
dupm2216 4:e97cfe6cc18c 19
dupm2216 0:8f5379c94a69 20 void send_message_via_xbee(const char* message, const int length);
dupm2216 0:8f5379c94a69 21 vector<char> generate_transmit_request(const char* message, const int length);
dupm2216 5:cd3c79853dc8 22 vector<char> generate_led_command(const bool power_on);
dupm2216 0:8f5379c94a69 23 void read_frame();
dupm2216 3:37ea92feece2 24 vector<char> parse_receive_packet(const vector<char>& frame);
dupm2216 3:37ea92feece2 25 vector<char> parse_transmit_status(const vector<char>& frame);
dupm2216 3:37ea92feece2 26 vector<char> parse_at_command_response(const vector<char>& frame);
dupm2216 4:e97cfe6cc18c 27 void handle_parsed_frames_from_mailbox();
dupm2216 4:e97cfe6cc18c 28 void handle_frame(const vector<char>& frame);
dupm2216 0:8f5379c94a69 29
dupm2216 3:37ea92feece2 30 //Simplify the frame to only contain the frame type and the relevant data for our application
dupm2216 3:37ea92feece2 31 vector<char> parse_frame(const vector<char>& frame);
dupm2216 3:37ea92feece2 32
dupm2216 0:8f5379c94a69 33 #endif