mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-06 11:39:32 +00:00
clean up debug msgs
This commit is contained in:
parent
ee8f4de5ab
commit
e80c79edbe
@ -9,10 +9,9 @@ For app cleanup:
|
|||||||
* DONE check build guide
|
* DONE check build guide
|
||||||
* DONE write devapi user guide
|
* DONE write devapi user guide
|
||||||
* DONE update android code: https://developer.android.com/topic/libraries/view-binding/migration
|
* DONE update android code: https://developer.android.com/topic/libraries/view-binding/migration
|
||||||
* only do wantReplies once per packet type, if we change network settings force it again
|
|
||||||
* test GPIO watch
|
* test GPIO watch
|
||||||
* writeup docs on gpio
|
* writeup docs on gpio
|
||||||
* make python ping command
|
* DONE make python ping command
|
||||||
* DONE make hello world example service
|
* DONE make hello world example service
|
||||||
* DONE have python tool check max packet size before sending to device
|
* DONE have python tool check max packet size before sending to device
|
||||||
* DONE if request was sent reliably, send reply reliably
|
* DONE if request was sent reliably, send reply reliably
|
||||||
@ -32,6 +31,7 @@ For app cleanup:
|
|||||||
* DONE test that position, text messages and user info work properly with new android app and old device code
|
* DONE test that position, text messages and user info work properly with new android app and old device code
|
||||||
* do UDP tunnel
|
* do UDP tunnel
|
||||||
* fix the RTC drift bug
|
* fix the RTC drift bug
|
||||||
|
* only do wantReplies once per packet type, if we change network settings force it again
|
||||||
* move python ping functionality into device, reply with rxsnr info
|
* move python ping functionality into device, reply with rxsnr info
|
||||||
* use channels for gpio security https://github.com/meshtastic/Meshtastic-device/issues/104
|
* use channels for gpio security https://github.com/meshtastic/Meshtastic-device/issues/104
|
||||||
* generate autodocs
|
* generate autodocs
|
||||||
|
@ -170,7 +170,7 @@ bool DSRRouter::weAreInRoute(const RouteDiscovery &route)
|
|||||||
**/
|
**/
|
||||||
void DSRRouter::updateRoutes(const RouteDiscovery &route, bool isRequest)
|
void DSRRouter::updateRoutes(const RouteDiscovery &route, bool isRequest)
|
||||||
{
|
{
|
||||||
DEBUG_MSG("FIXME not implemented");
|
DEBUG_MSG("FIXME not implemented updateRoutes\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -178,7 +178,7 @@ void DSRRouter::updateRoutes(const RouteDiscovery &route, bool isRequest)
|
|||||||
*/
|
*/
|
||||||
void DSRRouter::sendRouteReply(const RouteDiscovery &route, NodeNum toAppend)
|
void DSRRouter::sendRouteReply(const RouteDiscovery &route, NodeNum toAppend)
|
||||||
{
|
{
|
||||||
DEBUG_MSG("FIXME not implemented");
|
DEBUG_MSG("FIXME not implemented sendRoute\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -188,7 +188,7 @@ void DSRRouter::sendRouteReply(const RouteDiscovery &route, NodeNum toAppend)
|
|||||||
*/
|
*/
|
||||||
NodeNum DSRRouter::getNextHop(NodeNum dest)
|
NodeNum DSRRouter::getNextHop(NodeNum dest)
|
||||||
{
|
{
|
||||||
DEBUG_MSG("FIXME not implemented");
|
DEBUG_MSG("FIXME not implemented getNextHop\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,7 +198,7 @@ NodeNum DSRRouter::getNextHop(NodeNum dest)
|
|||||||
*/
|
*/
|
||||||
void DSRRouter::resendRouteRequest(const MeshPacket *p)
|
void DSRRouter::resendRouteRequest(const MeshPacket *p)
|
||||||
{
|
{
|
||||||
DEBUG_MSG("FIXME not implemented");
|
DEBUG_MSG("FIXME not implemented resendRoute\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -208,7 +208,7 @@ void DSRRouter::resendRouteRequest(const MeshPacket *p)
|
|||||||
*/
|
*/
|
||||||
void DSRRouter::addRoute(NodeNum dest, NodeNum forwarder, uint8_t numHops)
|
void DSRRouter::addRoute(NodeNum dest, NodeNum forwarder, uint8_t numHops)
|
||||||
{
|
{
|
||||||
DEBUG_MSG("FIXME not implemented");
|
DEBUG_MSG("FIXME not implemented addRoute\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -216,7 +216,7 @@ void DSRRouter::addRoute(NodeNum dest, NodeNum forwarder, uint8_t numHops)
|
|||||||
*/
|
*/
|
||||||
void DSRRouter::removeRoute(NodeNum dest)
|
void DSRRouter::removeRoute(NodeNum dest)
|
||||||
{
|
{
|
||||||
DEBUG_MSG("FIXME not implemented");
|
DEBUG_MSG("FIXME not implemented removeRoute\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -224,7 +224,7 @@ void DSRRouter::removeRoute(NodeNum dest)
|
|||||||
*/
|
*/
|
||||||
void DSRRouter::sendNextHop(NodeNum n, const MeshPacket *p)
|
void DSRRouter::sendNextHop(NodeNum n, const MeshPacket *p)
|
||||||
{
|
{
|
||||||
DEBUG_MSG("FIXME not implemented");
|
DEBUG_MSG("FIXME not implemented sendNextHop\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -232,7 +232,7 @@ void DSRRouter::sendNextHop(NodeNum n, const MeshPacket *p)
|
|||||||
*/
|
*/
|
||||||
void DSRRouter::sendRouteError(const MeshPacket *p, RouteError err)
|
void DSRRouter::sendRouteError(const MeshPacket *p, RouteError err)
|
||||||
{
|
{
|
||||||
DEBUG_MSG("FIXME not implemented");
|
DEBUG_MSG("FIXME not implemented sendRouteError\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** make a copy of p, start discovery, but only if we don't
|
/** make a copy of p, start discovery, but only if we don't
|
||||||
@ -241,5 +241,5 @@ void DSRRouter::sendRouteError(const MeshPacket *p, RouteError err)
|
|||||||
*/
|
*/
|
||||||
void DSRRouter::startDiscovery(NodeNum dest)
|
void DSRRouter::startDiscovery(NodeNum dest)
|
||||||
{
|
{
|
||||||
DEBUG_MSG("FIXME not implemented");
|
DEBUG_MSG("FIXME not implemented startDiscovery\n");
|
||||||
}
|
}
|
@ -38,8 +38,7 @@ void FloodingRouter::sniffReceived(const MeshPacket *p)
|
|||||||
|
|
||||||
tosend->hop_limit--; // bump down the hop count
|
tosend->hop_limit--; // bump down the hop count
|
||||||
|
|
||||||
DEBUG_MSG("Rebroadcasting received floodmsg to neighbors, fr=0x%x,to=0x%x,id=%d,hop_limit=%d\n", p->from, p->to,
|
printPacket("Rebroadcasting received floodmsg to neighbors", p);
|
||||||
p->id, tosend->hop_limit);
|
|
||||||
// Note: we are careful to resend using the original senders node id
|
// Note: we are careful to resend using the original senders node id
|
||||||
// We are careful not to call our hooked version of send() - because we don't want to check this again
|
// We are careful not to call our hooked version of send() - because we don't want to check this again
|
||||||
Router::send(tosend);
|
Router::send(tosend);
|
||||||
|
@ -27,11 +27,14 @@ MeshPlugin::~MeshPlugin()
|
|||||||
void MeshPlugin::callPlugins(const MeshPacket &mp)
|
void MeshPlugin::callPlugins(const MeshPacket &mp)
|
||||||
{
|
{
|
||||||
// DEBUG_MSG("In call plugins\n");
|
// DEBUG_MSG("In call plugins\n");
|
||||||
|
bool pluginFound = false;
|
||||||
for (auto i = plugins->begin(); i != plugins->end(); ++i) {
|
for (auto i = plugins->begin(); i != plugins->end(); ++i) {
|
||||||
auto &pi = **i;
|
auto &pi = **i;
|
||||||
|
|
||||||
pi.currentRequest = ∓
|
pi.currentRequest = ∓
|
||||||
if (pi.wantPortnum(mp.decoded.data.portnum)) {
|
if (pi.wantPortnum(mp.decoded.data.portnum)) {
|
||||||
|
pluginFound = true;
|
||||||
|
|
||||||
bool handled = pi.handleReceived(mp);
|
bool handled = pi.handleReceived(mp);
|
||||||
|
|
||||||
// Possibly send replies
|
// Possibly send replies
|
||||||
@ -42,11 +45,12 @@ void MeshPlugin::callPlugins(const MeshPacket &mp)
|
|||||||
if (handled)
|
if (handled)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
DEBUG_MSG("Plugin %s not interested\n", pi.name);
|
|
||||||
}
|
|
||||||
pi.currentRequest = NULL;
|
pi.currentRequest = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!pluginFound)
|
||||||
|
DEBUG_MSG("No plugins interested in portnum=%d\n", mp.decoded.data.portnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Messages can be received that have the want_response bit set. If set, this callback will be invoked
|
/** Messages can be received that have the want_response bit set. If set, this callback will be invoked
|
||||||
|
@ -96,9 +96,9 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf)
|
|||||||
if (!available()) {
|
if (!available()) {
|
||||||
// DEBUG_MSG("getFromRadio, !available\n");
|
// DEBUG_MSG("getFromRadio, !available\n");
|
||||||
return false;
|
return false;
|
||||||
} else {
|
}
|
||||||
DEBUG_MSG("getFromRadio, state=%d\n", state);
|
|
||||||
}
|
DEBUG_MSG("getFromRadio, state=%d\n", state);
|
||||||
|
|
||||||
// In case we send a FromRadio packet
|
// In case we send a FromRadio packet
|
||||||
memset(&fromRadioScratch, 0, sizeof(fromRadioScratch));
|
memset(&fromRadioScratch, 0, sizeof(fromRadioScratch));
|
||||||
@ -162,6 +162,9 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf)
|
|||||||
case STATE_SEND_PACKETS:
|
case STATE_SEND_PACKETS:
|
||||||
// Do we have a message from the mesh?
|
// Do we have a message from the mesh?
|
||||||
if (packetForPhone) {
|
if (packetForPhone) {
|
||||||
|
|
||||||
|
printPacket("phone downloaded packet", packetForPhone);
|
||||||
|
|
||||||
// Encapsulate as a FromRadio packet
|
// Encapsulate as a FromRadio packet
|
||||||
fromRadioScratch.which_variant = FromRadio_packet_tag;
|
fromRadioScratch.which_variant = FromRadio_packet_tag;
|
||||||
fromRadioScratch.variant.packet = *packetForPhone;
|
fromRadioScratch.variant.packet = *packetForPhone;
|
||||||
|
@ -55,11 +55,11 @@ template <class T> class ProtobufPlugin : private SinglePortPlugin
|
|||||||
// it would be better to update even if the message was destined to others.
|
// it would be better to update even if the message was destined to others.
|
||||||
|
|
||||||
auto &p = mp.decoded.data;
|
auto &p = mp.decoded.data;
|
||||||
DEBUG_MSG("Received %s from=0x%0x, id=%d, payloadlen=%d\n", name, mp.from, mp.id, p.payload.size);
|
DEBUG_MSG("Received %s from=0x%0x, id=0x%x, payloadlen=%d\n", name, mp.from, mp.id, p.payload.size);
|
||||||
|
|
||||||
T scratch;
|
T scratch;
|
||||||
if (pb_decode_from_bytes(p.payload.bytes, p.payload.size, fields, &scratch))
|
if (pb_decode_from_bytes(p.payload.bytes, p.payload.size, fields, &scratch))
|
||||||
handleReceivedProtobuf(mp, scratch);
|
return handleReceivedProtobuf(mp, scratch);
|
||||||
|
|
||||||
return false; // Let others look at this message also if they want
|
return false; // Let others look at this message also if they want
|
||||||
}
|
}
|
||||||
|
@ -123,7 +123,7 @@ void printPacket(const char *prefix, const MeshPacket *p)
|
|||||||
auto &s = p->decoded;
|
auto &s = p->decoded;
|
||||||
switch (s.which_payload) {
|
switch (s.which_payload) {
|
||||||
case SubPacket_data_tag:
|
case SubPacket_data_tag:
|
||||||
DEBUG_MSG(" Payload:Data");
|
DEBUG_MSG(" Portnum=%d", s.data.portnum);
|
||||||
break;
|
break;
|
||||||
case SubPacket_position_tag:
|
case SubPacket_position_tag:
|
||||||
DEBUG_MSG(" Payload:Position");
|
DEBUG_MSG(" Payload:Position");
|
||||||
|
@ -92,7 +92,7 @@ void ReliableRouter::sendAckNak(bool isAck, NodeNum to, PacketId idFrom)
|
|||||||
auto p = allocForSending();
|
auto p = allocForSending();
|
||||||
p->hop_limit = 0; // Assume just immediate neighbors for now
|
p->hop_limit = 0; // Assume just immediate neighbors for now
|
||||||
p->to = to;
|
p->to = to;
|
||||||
DEBUG_MSG("Sending an ack=0x%x,to=0x%x,idFrom=%d,id=%d\n", isAck, to, idFrom, p->id);
|
DEBUG_MSG("Sending an ack=0x%x,to=0x%x,idFrom=0x%x,id=0x%x\n", isAck, to, idFrom, p->id);
|
||||||
|
|
||||||
if (isAck) {
|
if (isAck) {
|
||||||
p->decoded.ack.success_id = idFrom;
|
p->decoded.ack.success_id = idFrom;
|
||||||
|
@ -51,6 +51,8 @@ RemoteHardwarePlugin::RemoteHardwarePlugin()
|
|||||||
|
|
||||||
bool RemoteHardwarePlugin::handleReceivedProtobuf(const MeshPacket &req, const HardwareMessage &p)
|
bool RemoteHardwarePlugin::handleReceivedProtobuf(const MeshPacket &req, const HardwareMessage &p)
|
||||||
{
|
{
|
||||||
|
DEBUG_MSG("Received RemoteHardware typ=%d\n", p.typ);
|
||||||
|
|
||||||
switch (p.typ) {
|
switch (p.typ) {
|
||||||
case HardwareMessage_Type_WRITE_GPIOS:
|
case HardwareMessage_Type_WRITE_GPIOS:
|
||||||
// Print notification to LCD screen
|
// Print notification to LCD screen
|
||||||
@ -87,6 +89,7 @@ bool RemoteHardwarePlugin::handleReceivedProtobuf(const MeshPacket &req, const H
|
|||||||
lastWatchMsec = 0; // Force a new publish soon
|
lastWatchMsec = 0; // Force a new publish soon
|
||||||
previousWatch = ~watchGpios; // generate a 'previous' value which is guaranteed to not match (to force an initial publish)
|
previousWatch = ~watchGpios; // generate a 'previous' value which is guaranteed to not match (to force an initial publish)
|
||||||
enabled = true; // Let our thread run at least once
|
enabled = true; // Let our thread run at least once
|
||||||
|
DEBUG_MSG("Now watching GPIOs 0x%x\n", watchGpios);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,6 +101,7 @@ bool RemoteHardwarePlugin::handleReceivedProtobuf(const MeshPacket &req, const H
|
|||||||
DEBUG_MSG("Hardware operation %d not yet implemented! FIXME\n", p.typ);
|
DEBUG_MSG("Hardware operation %d not yet implemented! FIXME\n", p.typ);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true; // handled
|
return true; // handled
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,6 +114,7 @@ int32_t RemoteHardwarePlugin::runOnce() {
|
|||||||
|
|
||||||
if(curVal != previousWatch) {
|
if(curVal != previousWatch) {
|
||||||
previousWatch = curVal;
|
previousWatch = curVal;
|
||||||
|
DEBUG_MSG("Broadcasting GPIOS 0x%x changed!\n", curVal);
|
||||||
|
|
||||||
// Something changed! Tell the world with a broadcast message
|
// Something changed! Tell the world with a broadcast message
|
||||||
HardwareMessage reply = HardwareMessage_init_default;
|
HardwareMessage reply = HardwareMessage_init_default;
|
||||||
|
Loading…
Reference in New Issue
Block a user