Wombat Environmental Node 1.0
An environmental node for SDI-12 and digital sensors.
|
#include <sdi12.h>
Static Public Member Functions | |
static BaseType_t | enter_cli (char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString) |
Command line interface handler for an SDI-12 sensor. More... | |
Static Public Attributes | |
static const std::string | cmd = "sdi12" |
CLI SDI-12 reference, to send commands use "sdi12" followed by the cmd. More... | |
static const uint8_t | MAX_SDI12_RES_LEN = 255 |
Maximum SDI-12 response length. More... | |
SDI-12 sensor CLI.
Commands can be used to control SDI-12 sensors on the bus. The user must provide the prefix sdi12
before sending a command which will be handled in enter_cli(...).
|
static |
Command line interface handler for an SDI-12 sensor.
This function is a command line interface (CLI) handler for an SDI-12 sensor. It processes commands entered by the user and takes the appropriate action.
The function first checks if there is a response stored in the response_buffer_
object. If so, it copies the response to the pcWriteBuffer
buffer and returns pdFALSE
if there are no more responses to be displayed or pdTRUE
if there are more responses to be displayed in subsequent calls to this function.
If there are no responses stored in the response_buffer_
, the function checks the command entered by the user and preforms the following commands:
scan: Scans the SDI-12 bus for sensors and stores the list of sensors in the response_buffer_
object. m: reads the value of a sensor at a specified address and stores the result in the response_buffer_
. ">>": It sends a command to the SDI-12 sensor and stores the response in the response_buffer_
.
cmd
in this function shadows the declaration in the header filepcWriteBuffer | A buffer where the function can write a response string to display to the user. |
xWriteBufferLen | The length of the pcWriteBuffer buffer. |
pcCommandString | A string containing the command entered by the user. |
|
inlinestatic |
CLI SDI-12 reference, to send commands use "sdi12" followed by the cmd.
|
static |
Maximum SDI-12 response length.