diff --git a/src/CdpPacket.h b/src/CdpPacket.h index 3ed9e1cf..2f0a6479 100644 --- a/src/CdpPacket.h +++ b/src/CdpPacket.h @@ -97,6 +97,20 @@ enum topics { sig = 0x17, //battery level bat = 0x18, + // external battery status + externalbattery = 0x19, + // bird detection event + birddetection = 0x1A, + // sleep status + sleepstatus = 0x1B, + // teensy status + teensystatus = 0x1C, + // teensy health status + teensyhealth = 0x1D, + // boot status + boot = 0x1E, + // tbeam status + tbeamstatus = 0x1F, // Send duck commands dcmd = 0x16, //gps @@ -280,6 +294,20 @@ class CdpPacket { return "sensor"; case topics::bat: return "battery"; + case topics::externalbattery: + return "externalbattery"; + case topics::birddetection: + return "birddetection"; + case topics::sleepstatus: + return "sleepstatus"; + case topics::teensystatus: + return "teensystatus"; + case topics::teensyhealth: + return "teensyhealth"; + case topics::tbeamstatus: + return "tbeamstatus"; + case topics::boot: + return "boot"; case topics::sig: return "signal health"; case topics::alert: diff --git a/src/Ducks/Duck.h b/src/Ducks/Duck.h index 05f6883b..f9d5cb9b 100644 --- a/src/Ducks/Duck.h +++ b/src/Ducks/Duck.h @@ -385,6 +385,10 @@ class Duck { */ static bool sendSignalData(void* p){ Duck* duckInstance = static_cast(p); + if (duckInstance->getType() == DuckType::PAPA) { + logdbg_ln("[DUCK] Skipping signal info send for PapaDuck."); + return true; + } int err; duckInstance->router.cullRoutingTable(); std::optional message = duckInstance->router.getEntriesFor(PAPADUCK_DUID, duckInstance->duid); @@ -486,7 +490,7 @@ class Duck { //Telemetry const int HEALTH_INTERVAL = 1000 * 60 * 15; //15 minutes - const int SIGNAL_INTERVAL = 1000 * 60;//0 * 7; //1 hour 2 min + const int SIGNAL_INTERVAL = 1000 * 60 * 10; //10 minutes int counter = 1; Timer<10> duckTimer; diff --git a/src/Ducks/DuckLink.h b/src/Ducks/DuckLink.h index 33119626..7a8ca8b6 100644 --- a/src/Ducks/DuckLink.h +++ b/src/Ducks/DuckLink.h @@ -108,7 +108,8 @@ class DuckLink : public Duck { case reservedTopic::rrep: { //we still need to recieve rreps in case of ttl expiry RouteJSON rrepDoc = RouteJSON(rxPacket.data); - loginfo_ln("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Received Route Response from DUID: %s", rxPacket.sduid.data()); + std::string sourceDuid(rxPacket.sduid.begin(), rxPacket.sduid.end()); + loginfo_ln("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Received Route Response from DUID: %s", sourceDuid.c_str()); //destination = sender of the rrep -> the last hop to current duck std::optional last = rrepDoc.getlastInPath(); Duid lastInPath = last.value(); diff --git a/src/Ducks/MamaDuck.h b/src/Ducks/MamaDuck.h index 2ffbf4a9..c8f08853 100644 --- a/src/Ducks/MamaDuck.h +++ b/src/Ducks/MamaDuck.h @@ -130,7 +130,8 @@ private : RouteJSON rrepDoc = RouteJSON(rxPacket.data); std::optional last = rrepDoc.getlastInPath(); Duid lastInPath = last.has_value() ? last.value() : rxPacket.sduid; - loginfo_ln("Received Route Response from DUID: %s", rxPacket.sduid.data(), rxPacket.sduid.size()); + std::string sourceDuid(rxPacket.sduid.begin(), rxPacket.sduid.end()); + loginfo_ln("Received Route Response from DUID: %s", sourceDuid.c_str()); std::optional nextHop; if(rxPacket.duckType == DuckType::PAPA){ @@ -189,4 +190,4 @@ private : }; -#endif \ No newline at end of file +#endif diff --git a/src/Ducks/PapaDuck.h b/src/Ducks/PapaDuck.h index 65f6237d..63df5850 100644 --- a/src/Ducks/PapaDuck.h +++ b/src/Ducks/PapaDuck.h @@ -132,7 +132,8 @@ void ifNotBroadcast(CdpPacket rxPacket, bool relay = false) { RouteJSON rrepDoc = RouteJSON(rxPacket.data); std::optional last = rrepDoc.getlastInPath(); Duid lastInPath = last.has_value() ? last.value() : rxPacket.sduid; - loginfo_ln("Received Route Response from DUID: %s", rxPacket.sduid.data(), rxPacket.sduid.size()); + std::string sourceDuid(rxPacket.sduid.begin(), rxPacket.sduid.end()); + loginfo_ln("Received Route Response from DUID: %s", sourceDuid.c_str()); std::optional nextHop = this->router.getBestNextHop(rrepDoc.getDestination()); if((rrepDoc.getDestination() != this->duid) && (nextHop.has_value()) && (nextHop.value() != rxPacket.sduid)){ //and not papaduck_duid?