67 void startup(
const std::string& port_name,
const int baud_rate,
const NodeId& my_node_id,
68 const uint16_t network_id,
const std::string& xbee_info_location,
69 const bool& use_encryption,
const std::string& encryption_password);
94 boost::asio::io_service* io;
95 boost::asio::serial_port* port;
99 std::string glog_group;
102 std::map<NodeId, SerialNumber> node_id_to_serial_number_map;
103 std::map<SerialNumber, NodeId> serial_number_to_node_id_map;
105 std::vector<std::string> received_packets;
108 void get_my_serial_number();
109 void get_maximum_payload_size();
110 void broadcast_node_id();
116 void write(
const std::string& raw);
117 std::string read_until(
const std::string& delimiter);
118 size_t bytes_available();
119 void read(
void* ptr,
const size_t n_bytes);
122 void enter_command_mode();
124 void exit_command_mode();
127 std::string read_frame();
132 std::string api_transmit_request(
const SerialNumber& dest,
const byte frame_id,
const byte* ptr,
133 const size_t length);
134 std::string api_explicit_transmit_request(
const SerialNumber& dest,
137 void process_frame();
138 void process_frame_if_available();
139 void process_frame_extended_transmit_status(
const std::string& response_string);
140 void process_frame_at_command_response(
const std::string& response_string);
141 void process_frame_receive_packet(
const std::string& response_string);
142 void process_frame_node_identification_indicator(
const std::string& response_string);
143 void process_frame_explicit_rx_indicator(
const std::string& response_string);
157 bool received_rssi_{
false};
158 bool received_er_{
false};
159 bool received_gd_{
false};
160 bool received_bc_{
false};
161 bool received_tr_{
false};
164 uint16_t current_rssi_{0};
165 uint16_t history_rssi_{0};
166 int rssi_query_count_{1};
167 uint16_t max_rssi_{0};
168 uint16_t min_rssi_{150};
169 uint16_t average_rssi_{0};
172 uint32_t bytes_transmitted_{0};
175 uint16_t received_error_count_{0};
178 uint16_t received_good_count_{0};
181 uint16_t transmission_failure_count_{0};
183 std::string my_xbee_info_location_{
""};
void startup(const std::string &port_name, const int baud_rate, const NodeId &my_node_id, const uint16_t network_id, const std::string &xbee_info_location, const bool &use_encryption, const std::string &encryption_password)