NW_Sensor
What a data logger needs from a sensor library to keep a status file. More…
#include <NW_Sensor.h>
Public Functions
| Name | |
|---|---|
| virtual | ~NW_Sensor() |
| virtual const char * | name() const =0 The device name as the spec spells it (“Apis”). |
| virtual uint8_t | reportKind() =0 Kind of the report captured with the last reading (0 = none). |
| virtual bool | reportIsFault() =0 The last report is a fault: its chip’s status bit is set, the data are not to be trusted. |
| virtual uint8_t | bootReportKind() =0 Kind of the report begin() captured at the device’s boot; 0 once cleared or if none. |
| virtual void | clearBootReport() =0 The logger has recorded (or dismissed) the boot report. |
| virtual size_t | printStatus(Print & out, bool boot =false) =0 Print one status line for the logger’s status file (no newline): name, serial, HW, FW, report code, note word, Pages 0-2 in hex. |
Detailed Description
class NW_Sensor;
What a data logger needs from a sensor library to keep a status file.
Every library on NW_Core (Apis, Walrus, Haar, Libelle) inherits this and the logger keeps a list of them (Margay::watch()). The logger writes a row for a device when its report says something happened: after a reading, reportKind() is the reading’s report; bootReportKind() is what begin() captured before the first trigger cleared it, kept until the logger has looked (clearBootReport()). A reset (kind 6) seen at boot is expected on a logger that powers its sensors per reading and makes no row; any other boot report, and any report after a reading, does.
Public Functions Documentation
function ~NW_Sensor
inline virtual ~NW_Sensor()
function name
virtual const char * name() const =0
The device name as the spec spells it (“Apis”).
function reportKind
virtual uint8_t reportKind() =0
Kind of the report captured with the last reading (0 = none).
function reportIsFault
virtual bool reportIsFault() =0
The last report is a fault: its chip’s status bit is set, the data are not to be trusted.
function bootReportKind
virtual uint8_t bootReportKind() =0
Kind of the report begin() captured at the device’s boot; 0 once cleared or if none.
function clearBootReport
virtual void clearBootReport() =0
The logger has recorded (or dismissed) the boot report.
function printStatus
virtual size_t printStatus(
Print & out,
bool boot =false
) =0
Print one status line for the logger’s status file (no newline): name, serial, HW, FW, report code, note word, Pages 0-2 in hex.
Parameters:
- boot print the boot report (the code begin() captured) instead of the last reading’s
Updated on 2026-09-23 at 22:42:22 +0000