From 207da16fdc87d8d877b706fd69417df8b8d3b5c5 Mon Sep 17 00:00:00 2001 From: Rene 'Renne' Bartsch Date: Tue, 17 Jul 2018 17:04:33 +0200 Subject: [PATCH] struct XDRVMAILBOX added in FUNC_COMMAND id section. --- Sensor-API.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Sensor-API.md b/Sensor-API.md index b3236989..99029dee 100644 --- a/Sensor-API.md +++ b/Sensor-API.md @@ -134,7 +134,21 @@ It should be wrapped in `#ifdef USE_WEBSERVER ... #endif // USE_WEBSERVER` This callback ID is called to allow a sensor to prepare for saving configuration changes. To be used to save volatile data just before a restart. ### FUNC_COMMAND -This callback ID is called when a sensor specific command ``Sensor\`` is executed where xx is the sensor index. +This callback ID is called when a sensor specific command ``Sensor`` is executed where xx is the sensor index. +``` +// Data struct of FUNC_COMMAND ID +struct XDRVMAILBOX { + uint16_t valid; // ??? + uint16_t index; // Sensor index + uint16_t data_len; // Length of command string + uint16_t payload16; // ??? + int16_t payload; // ??? + uint8_t grpflg; // ??? + uint8_t notused; // ??? + char *topic; // Command topic + char *data; // Command string/value +} XdrvMailbox; +``` ## Useful functions