WIP on GPIO example

This commit is contained in:
Kevin Hester
2020-12-07 10:18:11 +08:00
parent 8f5a1f19d3
commit 90060e84c0
12 changed files with 140 additions and 60 deletions

View File

@@ -28,22 +28,17 @@ bool NodeInfoPlugin::handleReceivedProtobuf(const MeshPacket &mp, const User &p)
void NodeInfoPlugin::sendOurNodeInfo(NodeNum dest, bool wantReplies)
{
User &u = owner;
DEBUG_MSG("sending owner %s/%s/%s\n", u.id, u.long_name, u.short_name);
MeshPacket *p = allocForSending(u);
MeshPacket *p = allocReply();
p->to = dest;
p->decoded.want_response = wantReplies;
service.sendToMesh(p);
}
MeshPacket *NodeInfoPlugin::allocReply()
{
User &u = owner;
/** Messages can be received that have the want_response bit set. If set, this callback will be invoked
* so that subclasses can (optionally) send a response back to the original sender. Implementing this method
* is optional
*/
void NodeInfoPlugin::sendResponse(NodeNum to) {
DEBUG_MSG("Sending user reply\n");
sendOurNodeInfo(to, false);
}
DEBUG_MSG("sending owner %s/%s/%s\n", u.id, u.long_name, u.short_name);
return allocDataProtobuf(u);
}