26 static constexpr uint16_t LINE_BUFFER_SIZE = 48;
29 void setup()
override;
35 SUB_SENSOR(permittivity)
41 enum class State : uint8_t {
44 STATE_AWAITING_ANSWER,
Collects bytes into NUL terminated lines of up to N - 1 characters; IGNORE_CHAR bytes are skipped and...
This class simplifies creating components that periodically check a state.
uint32_t request_sent_ms_
LineReader< LINE_BUFFER_SIZE > line_reader_
SUB_SENSOR(counts) SUB_SENSOR(permittivity) SUB_SENSOR(temperature) SUB_SENSOR(moisture) SUB_SENSOR(voltage) protected void send_request_(uint32_t now)
void dump_config() override
void finish_request_(const char *answer)
End the request; answer is the line the sensor sent, or nullptr when it sent none in time.
Field
Order of the values in the answer to GetAllMeasurements.
bool parse_measurements(const char *line, float *values)
Read "counts,permittivity,moisture,temperature,voltage" into values[FIELD_COUNT].