mirror of
https://github.com/meshtastic/firmware.git
synced 2025-05-02 03:56:47 +00:00
Fix comments in serial plugin
This commit is contained in:
parent
c54e87f9a2
commit
89b32dd7ee
@ -22,7 +22,7 @@
|
|||||||
Basic Usage:
|
Basic Usage:
|
||||||
|
|
||||||
1) Enable the plugin by setting SERIALPLUGIN_ENABLED to 1.
|
1) Enable the plugin by setting SERIALPLUGIN_ENABLED to 1.
|
||||||
2) Set the pins (RXD2 / TXD2) for your preferred RX and TX GPIO pins
|
2) Set the pins (RXD2 / TXD2) for your preferred RX and TX GPIO pins.
|
||||||
3) Set SERIALPLUGIN_TIMEOUT to the amount of time to wait before we consider
|
3) Set SERIALPLUGIN_TIMEOUT to the amount of time to wait before we consider
|
||||||
your packet as "done".
|
your packet as "done".
|
||||||
4) (Optional) In SerialPlugin.h set the port to PortNum_TEXT_MESSAGE_APP if you want to
|
4) (Optional) In SerialPlugin.h set the port to PortNum_TEXT_MESSAGE_APP if you want to
|
||||||
@ -112,30 +112,30 @@ void SerialPluginRadio::sendPayload(NodeNum dest, bool wantReplies)
|
|||||||
bool SerialPluginRadio::handleReceived(const MeshPacket &mp)
|
bool SerialPluginRadio::handleReceived(const MeshPacket &mp)
|
||||||
{
|
{
|
||||||
auto &p = mp.decoded.data;
|
auto &p = mp.decoded.data;
|
||||||
//DEBUG_MSG("Received text msg self=0x%0x, from=0x%0x, to=0x%0x, id=%d, msg=%.*s\n", nodeDB.getNodeNum(),
|
// DEBUG_MSG("Received text msg self=0x%0x, from=0x%0x, to=0x%0x, id=%d, msg=%.*s\n", nodeDB.getNodeNum(),
|
||||||
// mp.from, mp.to, mp.id, p.payload.size, p.payload.bytes);
|
// mp.from, mp.to, mp.id, p.payload.size, p.payload.bytes);
|
||||||
|
|
||||||
/*
|
|
||||||
* If SERIALPLUGIN_ECHO is true, then echo the packets that are sent out back to the TX
|
|
||||||
* of the serial interface.
|
|
||||||
*/
|
|
||||||
if (mp.from == nodeDB.getNodeNum()) {
|
if (mp.from == nodeDB.getNodeNum()) {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If SERIALPLUGIN_ECHO is true, then echo the packets that are sent out back to the TX
|
||||||
|
* of the serial interface.
|
||||||
|
*/
|
||||||
if (SERIALPLUGIN_ECHO) {
|
if (SERIALPLUGIN_ECHO) {
|
||||||
|
|
||||||
// For some reason, we get the packet back twice when we send out of the radio.
|
// For some reason, we get the packet back twice when we send out of the radio.
|
||||||
// TODO: need to find out why.
|
// TODO: need to find out why.
|
||||||
if (lastRxID != mp.id) {
|
if (lastRxID != mp.id) {
|
||||||
lastRxID = mp.id;
|
lastRxID = mp.id;
|
||||||
//DEBUG_MSG("* * Message came this device\n");
|
// DEBUG_MSG("* * Message came this device\n");
|
||||||
//Serial2.println("* * Message came this device");
|
// Serial2.println("* * Message came this device");
|
||||||
Serial2.printf("%s", p.payload.bytes);
|
Serial2.printf("%s", p.payload.bytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//DEBUG_MSG("* * Message came from the mesh\n");
|
// DEBUG_MSG("* * Message came from the mesh\n");
|
||||||
//Serial2.println("* * Message came from the mesh");
|
// Serial2.println("* * Message came from the mesh");
|
||||||
Serial2.printf("%s", p.payload.bytes);
|
Serial2.printf("%s", p.payload.bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user