Wombat Environmental Node 1.0
An environmental node for SDI-12 and digital sensors.
Loading...
Searching...
No Matches
CLISdi12 Class Reference

SDI-12 sensor CLI. More...

#include <sdi12.h>

Collaboration diagram for CLISdi12:

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...
 

Detailed Description

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(...).

Member Function Documentation

◆ enter_cli()

BaseType_t CLISdi12::enter_cli ( char *  pcWriteBuffer,
size_t  xWriteBufferLen,
const char *  pcCommandString 
)
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_.

Todo:
cmd in this function shadows the declaration in the header file
Parameters
pcWriteBufferA buffer where the function can write a response string to display to the user.
xWriteBufferLenThe length of the pcWriteBuffer buffer.
pcCommandStringA string containing the command entered by the user.
Returns
Returns pdFALSE if there are no more responses to be displayed, pdTRUE if there are more responses to be displayed in subsequent calls to this function.

Member Data Documentation

◆ cmd

const std::string CLISdi12::cmd = "sdi12"
inlinestatic

CLI SDI-12 reference, to send commands use "sdi12" followed by the cmd.

◆ MAX_SDI12_RES_LEN

const uint8_t CLISdi12::MAX_SDI12_RES_LEN = 255
static

Maximum SDI-12 response length.


The documentation for this class was generated from the following files: