NW_Report
The two Block 0 bytes that describe a reading’s health, with their decoding. More…
#include <NW_Report.h>
Public Functions
| Name | |
|---|---|
| bool | ready() const |
| bool | chipFaulted(uint8_t chip) const chip 0..5 faulted on the last reading |
| bool | any() const pan-fault |
| uint8_t | chip() const 0..6, or 7 for the unit |
| uint8_t | kind() const |
| bool | isUnit() const |
| bool | isFault() const The report is a fault: its chip’s status bit is set (the unit: pan-fault), so the data are not to be trusted. |
| bool | isNotice() const The report is a notice: a code with no status bit behind it (reset, calibration stored, batch abandoned). |
| size_t | printKind(Print & out) const Print the kind in words (“timed out”; “kind 17” for device-specific kinds): the spec’s table of note words, spoken. |
| String | kindWord() const The kind as one word for a data-table note (“Timeout”; “Kind17” for device-specific kinds). |
| size_t | print(Print & out, const char *const * chipNames, uint8_t nChips, const char *const * kindWords =nullptr, uint8_t nKindWords =0) const Print the report in words: the chip, then the kind, e.g. “MS5803: not answering”, “unit: restarted since configured”; “none” when there is no report. A library passes its chip-name table from the spec’s chip table; a chip beyond it prints as “chip N”. |
| String | note(const char *const * chipNames, uint8_t nChips, const char *const * kindWords =nullptr, uint8_t nKindWords =0) const The report as one word for a data-table note column: the chip, then the kind, e.g. “MS5803NotAnswering”, “UnitRestarted”, “Chip2Kind17”; “UnitNone” when there is no report. A device-specific kind (16-31) prints its appendix word alone when the library passes its table (“LoggingStarted”). |
| bool | chipAbsent() const True for the kinds that mean the chip is not coming back this batch (no acknowledge, not initialised). |
Public Attributes
| Name | |
|---|---|
| uint8_t | status Block 0 byte 0x40. |
| uint8_t | code Block 0 byte 0x47. |
Detailed Description
struct NW_Report;
The two Block 0 bytes that describe a reading’s health, with their decoding.
status (0x40) is live: bit 0 ready, bits 1-6 chip n-1 faulted now, bit 7 pan-fault (OR of bits 1-6). code (0x47) is the Report register, the device’s most recent report, good or bad, latched until the controller next writes Control: bits 7-5 chip (7 = the unit), bits 4-0 kind. A report is a fault when the chip’s status bit is set too, a notice otherwise. Kinds (NW-Device-Specification): 0 none, 1 no acknowledge, 2 timeout, 3 checksum, 4 out of range, 5 not initialised, 6 reset since configured (a notice), 7 config rejected, 8 supply fault, 9 calibration stored (a notice), 10 batch abandoned (a notice), 11-15 reserved, 16-31 device-specific. The chip names are the device’s own: a library passes its table (the spec’s chip table, in order) to print() and note(); printKind() and kindWord() give the universal part alone.
Public Functions Documentation
function ready
inline bool ready() const
function chipFaulted
inline bool chipFaulted(
uint8_t chip
) const
chip 0..5 faulted on the last reading
function any
inline bool any() const
pan-fault
function chip
inline uint8_t chip() const
0..6, or 7 for the unit
function kind
inline uint8_t kind() const
function isUnit
inline bool isUnit() const
function isFault
inline bool isFault() const
The report is a fault: its chip’s status bit is set (the unit: pan-fault), so the data are not to be trusted.
function isNotice
inline bool isNotice() const
The report is a notice: a code with no status bit behind it (reset, calibration stored, batch abandoned).
function printKind
inline size_t printKind(
Print & out
) const
Print the kind in words (“timed out”; “kind 17” for device-specific kinds): the spec’s table of note words, spoken.
function kindWord
inline String kindWord() const
The kind as one word for a data-table note (“Timeout”; “Kind17” for device-specific kinds).
function print
inline size_t print(
Print & out,
const char *const * chipNames,
uint8_t nChips,
const char *const * kindWords =nullptr,
uint8_t nKindWords =0
) const
Print the report in words: the chip, then the kind, e.g. “MS5803: not answering”, “unit: restarted since configured”; “none” when there is no report. A library passes its chip-name table from the spec’s chip table; a chip beyond it prints as “chip N”.
Return: Bytes written.
function note
inline String note(
const char *const * chipNames,
uint8_t nChips,
const char *const * kindWords =nullptr,
uint8_t nKindWords =0
) const
The report as one word for a data-table note column: the chip, then the kind, e.g. “MS5803NotAnswering”, “UnitRestarted”, “Chip2Kind17”; “UnitNone” when there is no report. A device-specific kind (16-31) prints its appendix word alone when the library passes its table (“LoggingStarted”).
function chipAbsent
inline bool chipAbsent() const
True for the kinds that mean the chip is not coming back this batch (no acknowledge, not initialised).
Public Attributes Documentation
variable status
uint8_t status = 0;
Block 0 byte 0x40.
variable code
uint8_t code = 0;
Block 0 byte 0x47.
Updated on 2026-09-23 at 22:42:22 +0000