Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
xbee.h
- Committer:
- dupm2216
- Date:
- 2017-02-12
- Revision:
- 3:37ea92feece2
- Parent:
- 0:8f5379c94a69
- Child:
- 4:e97cfe6cc18c
File content as of revision 3:37ea92feece2:
#ifndef XBEE_HPP
#define XBEE_HPP
#include <vector>
#include <cassert>
#include "mbed.h"
#include "rtos.h"
//See xbee document page 99
const char FRAME_TYPE_RECEIVE_PACKET = 0x90;
const char FRAME_TYPE_TRANSMIT_STATUS = 0x8B;
const char FRAME_TYPE_AT_COMMAND_RESPONSE = 0x88;
const char TRANSMIT_STATUS_SUCCESS = 0x00;
const char AT_COMMAND_RESPONSE_STATUS_OK = 0x00;
void send_message_via_xbee(const char* message, const int length);
vector<char> generate_transmit_request(const char* message, const int length);
void read_frame();
vector<char> parse_receive_packet(const vector<char>& frame);
vector<char> parse_transmit_status(const vector<char>& frame);
vector<char> parse_at_command_response(const vector<char>& frame);
void handle_message();
//Simplify the frame to only contain the frame type and the relevant data for our application
vector<char> parse_frame(const vector<char>& frame);
#endif