From 71be71d63d2b304257121c4befc49b05177a01ce Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Fri, 8 Jan 2021 13:31:28 +0800 Subject: [PATCH] add note about how to send messages thanks @rw-w for the question --- docs/software/plugin-api.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/software/plugin-api.md b/docs/software/plugin-api.md index 4fd477aec..34f1224d1 100644 --- a/docs/software/plugin-api.md +++ b/docs/software/plugin-api.md @@ -55,6 +55,10 @@ The easiest way to get started is: It is very common that you would like your plugin to be invoked periodically. We use a crude/basic cooperative threading system to allow this on any of our supported platforms. Simply inherit from OSThread and implement runOnce(). See the OSThread [documentation](/src/concurrency/OSThread.h) for more details. For an example consumer of this API see RemoteHardwarePlugin::runOnce. +## Sending messages + +If you would like to proactively send messages (rather than just responding to them), just call service.sendToMesh(). For an example of this see [NodeInfoPlugin::sendOurNodeInfo(...)](/src/plugins/NodeInfoPlugin.cpp). + ## Picking a port number For any new 'apps' that run on the device or via sister apps on phones/PCs they should pick and use a unique 'portnum' for their application.