update rangetest

This commit is contained in:
Jm 2021-02-07 19:20:29 -08:00
parent cb541d75a9
commit ca8a0ca8d2

View File

@ -7,6 +7,13 @@
#include <Arduino.h> #include <Arduino.h>
#include <assert.h> #include <assert.h>
/*
As a sender, I can send packets every n-seonds. These packets include an incramented PacketID.
As a receiver, I can receive packets from multiple senders. These packets can be saved to the spiffs.
*/
RangeTestPlugin *rangeTestPlugin; RangeTestPlugin *rangeTestPlugin;
RangeTestPluginRadio *rangeTestPluginRadio; RangeTestPluginRadio *rangeTestPluginRadio;
@ -26,7 +33,7 @@ int32_t RangeTestPlugin::runOnce()
*/ */
radioConfig.preferences.range_test_plugin_enabled = 1; radioConfig.preferences.range_test_plugin_enabled = 1;
radioConfig.preferences.range_test_plugin_sender = 60; radioConfig.preferences.range_test_plugin_sender = 0;
radioConfig.preferences.fixed_position = 1; radioConfig.preferences.fixed_position = 1;
uint32_t senderHeartbeat = radioConfig.preferences.range_test_plugin_sender * 1000; uint32_t senderHeartbeat = radioConfig.preferences.range_test_plugin_sender * 1000;
@ -130,26 +137,30 @@ bool RangeTestPluginRadio::handleReceived(const MeshPacket &mp)
NodeInfo *n = nodeDB.getNode(mp.from); NodeInfo *n = nodeDB.getNode(mp.from);
DEBUG_MSG("-----------------------------------------\n");
DEBUG_MSG("p.payload.bytes \"%s\"\n", p.payload.bytes); DEBUG_MSG("p.payload.bytes \"%s\"\n", p.payload.bytes);
DEBUG_MSG("p.payload.size %d\n", p.payload.size); DEBUG_MSG("p.payload.size %d\n", p.payload.size);
DEBUG_MSG("---- Received Packet:\n");
DEBUG_MSG("mp.from %d\n", mp.from); DEBUG_MSG("mp.from %d\n", mp.from);
DEBUG_MSG("mp.rx_snr %f\n", mp.rx_snr); DEBUG_MSG("mp.rx_snr %f\n", mp.rx_snr);
DEBUG_MSG("mp.hop_limit %d\n", mp.hop_limit); DEBUG_MSG("mp.hop_limit %d\n", mp.hop_limit);
// DEBUG_MSG("mp.decoded.position.latitude_i %d\n", mp.decoded.position.latitude_i); DEBUG_MSG("mp.decoded.position.latitude_i %d\n", mp.decoded.position.latitude_i);
// DEBUG_MSG("mp.decoded.position.longitude_i %d\n", mp.decoded.position.longitude_i); DEBUG_MSG("mp.decoded.position.longitude_i %d\n", mp.decoded.position.longitude_i);
DEBUG_MSG("n->has_position %d\n", n->has_position); DEBUG_MSG("---- Node Information of Received Packet (mp.from):\n");
DEBUG_MSG("n->position.latitude_i %d\n", n->position.latitude_i); DEBUG_MSG("n->user.long_name %s\n", n->user.long_name);
DEBUG_MSG("n->position.longitude_i %d\n", n->position.longitude_i); DEBUG_MSG("n->user.short_name %s\n", n->user.short_name);
DEBUG_MSG("n->user.macaddr %X\n", n->user.macaddr);
n->user.long_name; DEBUG_MSG("n->has_position %d\n", n->has_position);
n->user.short_name; DEBUG_MSG("n->position.latitude_i %d\n", n->position.latitude_i);
n->user.macaddr; DEBUG_MSG("n->position.longitude_i %d\n", n->position.longitude_i);
n->position.battery_level; DEBUG_MSG("n->position.battery_level %d\n", n->position.battery_level);
DEBUG_MSG("---- Current device location information:\n");
DEBUG_MSG("gpsStatus->getLatitude() %d\n", gpsStatus->getLatitude()); DEBUG_MSG("gpsStatus->getLatitude() %d\n", gpsStatus->getLatitude());
DEBUG_MSG("gpsStatus->getLongitude() %d\n", gpsStatus->getLongitude()); DEBUG_MSG("gpsStatus->getLongitude() %d\n", gpsStatus->getLongitude());
DEBUG_MSG("gpsStatus->getHasLock() %d\n", gpsStatus->getHasLock()); DEBUG_MSG("gpsStatus->getHasLock() %d\n", gpsStatus->getHasLock());
DEBUG_MSG("gpsStatus->getDOP() %d\n", gpsStatus->getDOP()); DEBUG_MSG("gpsStatus->getDOP() %d\n", gpsStatus->getDOP());
DEBUG_MSG("-----------------------------------------\n");
} }
} else { } else {