87 void startup(
const std::string& port_name,
const int baud_rate,
const NodeId& my_node_id,
88 const uint16_t network_id,
const std::string& xbee_info_location,
89 const bool& use_encryption,
const std::string& encryption_password,
90 const std::string& mesh_unicast_retries,
const std::string& unicast_mac_retries,
91 const std::string& network_delay_slots,
92 const std::string& broadcast_multi_transmits,
int fleet,
unsigned subnet_mask);
115 std::shared_ptr<boost::asio::io_context> io;
116 boost::asio::serial_port* port;
120 std::string glog_group;
122 unsigned subnet_mask_{0xFFFF};
125 std::map<NodeId, SerialNumber> node_id_to_serial_number_map;
127 std::vector<std::string> received_packets;
130 void get_my_serial_number();
131 void get_maximum_payload_size();
132 void broadcast_node_id();
138 void write(
const std::string& raw);
139 std::string read_until(
const std::string& delimiter);
140 size_t bytes_available();
141 void read(
void* ptr,
const size_t n_bytes);
142 void async_read_with_timeout(std::string& buffer,
const std::string& delimiter,
144 std::function<
void(
const std::string&)> handler);
147 std::string convertToHex(
const std::string& str);
150 void enter_command_mode();
152 void exit_command_mode();
155 std::string read_frame();
160 std::string api_transmit_request(
const SerialNumber& dest,
const byte frame_id,
const byte* ptr,
161 const size_t length);
162 std::string api_explicit_transmit_request(
const SerialNumber& dest,
165 void process_frame();
166 void process_frame_if_available();
167 void process_frame_extended_transmit_status(
const std::string& response_string);
168 void process_frame_at_command_response(
const std::string& response_string);
169 void process_frame_receive_packet(
const std::string& response_string);
170 void process_frame_node_identification_indicator(
const std::string& response_string);
171 void process_frame_explicit_rx_indicator(
const std::string& response_string);
185 bool received_rssi_{
false};
186 bool received_er_{
false};
187 bool received_gd_{
false};
188 bool received_bc_{
false};
189 bool received_tr_{
false};
192 uint16_t current_rssi_{0};
193 uint16_t history_rssi_{0};
194 int rssi_query_count_{1};
195 uint16_t max_rssi_{0};
196 uint16_t min_rssi_{150};
197 uint16_t average_rssi_{0};
200 uint32_t bytes_transmitted_{0};
203 uint16_t received_error_count_{0};
206 uint16_t received_good_count_{0};
209 uint16_t transmission_failure_count_{0};
211 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, const std::string &mesh_unicast_retries, const std::string &unicast_mac_retries, const std::string &network_delay_slots, const std::string &broadcast_multi_transmits, int fleet, unsigned subnet_mask)