Skip to content

Commit

Permalink
serialplugin - ability to configure ACK
Browse files Browse the repository at this point in the history
  • Loading branch information
mc-hamster committed Jan 14, 2021
1 parent b1181de commit f68a31a
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/plugins/SerialPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,28 @@
7) (Optional) Set SERIALPLUGIN_ECHO to 1 and any message you send out will be echoed back
to your device.
TODO:
TODO (in this order):
* Once protobufs regenerated with the new port, update SerialPlugin.h
* Implement an interface to enable / disable ack
* Ensure this works on a tbeam
* Define a verbose RX mode to report on mesh and packet infomration.
- This won't happen any time soon.
KNOWN PROBLEMS
* Until the plugin is initilized by the startup sequence, the TX pin is in a floating
state. Device connected to that pin may see this as "noise".
*/

#define RXD2 16
#define TXD2 17
#define SERIALPLUGIN_RX_BUFFER 128
#define SERIALPLUGIN_STRING_MAX Constants_DATA_PAYLOAD_LEN
#define SERIALPLUGIN_TIMEOUT 100
#define SERIALPLUGIN_TIMEOUT 250
#define SERIALPLUGIN_BAUD 38400
#define SERIALPLUGIN_ENABLED 0
#define SERIALPLUGIN_ENABLED 1
#define SERIALPLUGIN_ECHO 0
#define SERIALPLUGIN_ACK 0

SerialPlugin *serialPlugin;
SerialPluginRadio *serialPluginRadio;
Expand Down Expand Up @@ -108,6 +115,8 @@ void SerialPluginRadio::sendPayload(NodeNum dest, bool wantReplies)
p->to = dest;
p->decoded.want_response = wantReplies;

p->want_ack = SERIALPLUGIN_ACK;

p->decoded.data.payload.size = strlen(serialStringChar); // You must specify how many bytes are in the reply
memcpy(p->decoded.data.payload.bytes, serialStringChar, p->decoded.data.payload.size);

Expand Down

0 comments on commit f68a31a

Please sign in to comment.