-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathat_command.cc
More file actions
37 lines (31 loc) · 1.32 KB
/
Copy pathat_command.cc
File metadata and controls
37 lines (31 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "at_command.h"
const char *const at_command::RESPONSE_SUCCESS = "OK";
const char *const at_command::RESPONSE_ERROR = "ERROR";
const char *const at_command::AT_PREFIX = "AT";
const char *const at_command::API_ENABLE = "AP";
const char *const at_command::EXIT_COMMAND_MODE = "CN";
const char *const at_command::SOURCE_ADDRESS_16_BIT = "MY";
const char *const at_command::SERIAL_NUMBER_HIGH = "SH";
const char *const at_command::SERIAL_NUMBER_LOW = "SL";
const char *const at_command::SOFTWARE_RESET = "FR";
const char *const at_command::MAC_MODE = "MM";
const char *const at_command::INTERFACE_DATA_RATE = "BD";
const char *const at_command::PERSONAL_AREA_NETWORK_ID = "ID";
const char *const at_command::CHANNEL = "CH";
const char *const at_command::XBEE_RETRIES = "RR";
const char *const at_command::POWER_LEVEL = "PL";
const char *const at_command::CCA_THRESHOLD = "CA";
const char *const at_command::RESTORE_DEFAULTS = "RE";
const char *const at_command::WRITE = "WR";
const char *const at_command::REGISTER_QUERY = "";
const char at_command::CR = '\r';
at_command::at_command(const std::string &command, const std::string ¶meter)
: command(command), parameter(parameter)
{
}
at_command::operator std::string() const
{
std::ostringstream oss;
oss << AT_PREFIX << command << parameter << CR;
return oss.str();
}