64 std::set<packet_id_e> packetIdList;
68 int currentPacketPeriod = 0;
70 for (
int i = 0; i < _packetsRequested.size(); i++)
72 std::pair<packet_id_e, int> packet = _packetsRequested[i];
80 if (packetIdList.count(packet.first) > 0)
88 period.
packet_id = _packetsRequested[i].first;
89 period.
period = 1000 / _packetsRequested[i].second;
93 packetIdList.insert(packet.first);
94 currentPacketPeriod++;
97 return unsupported + duplicated;
119 uint8_t _vehicle_type,
120 bool _internal_gnss_enabled,
121 bool _atmospheric_altitude_enabled,
122 bool _velocity_heading_enabled,
123 bool _reversing_detection_enabled,
124 bool _motion_analysis_enabled)
126 if (_vehicle_type > 13)
157 float _odom_pulse_to_meters,
199 strncpy(portArr, _port.c_str(), 4096);
212 requestPacket =
nullptr;
230 std::vector<int> baudRates = {
231 1200, 1800, 2400, 4800, 9600,
232 19200, 57600, 115200, 230400,
233 460800, 500000, 576000, 921600, 1000000};
236 strncpy(portArr, _port.c_str(), 4096);
238 for (
int baudRate : baudRates)
241 if (baudRate < _startingBaud)
246 printf(
"Opening with port: %s, baudrate: %d...\n", portArr, baudRate);
257 for (
int i = 0; i < 20; i++)
269 printf(
"Found a packet\n");
272 printf(
"Found connection at %d baud\n", baudRate);
301 std::set<packet_id_e> packetIdList;
302 int dataThroughput = 0;
304 for (
int i = 0; i < _packetsRequested.size(); i++)
306 std::pair<packet_id_e, uint16_t> packet = _packetsRequested[i];
313 else if (packetIdList.count(packet.first) > 0)
319 if (packet.second > 1000)
325 dataThroughput += (
packetSize_[packet.first] + 5) * packet.second;
326 packetIdList.insert(packet.first);
329 return dataThroughput * 11;