J1939SpnValueKind Enum¶
What a decoded SPN field actually carries: a measurement, or one of the SAE J1939-71 §5.1.1 indicator ranges that occupy the top of every SPN's raw range.
Fields¶
NotAvailable 0
The transmitting ECU does not have the parameter, or was not asked for it. Unsigned: all
raw bits set — 0xFF for one byte, 0xFF00..0xFFFF for two, and so on.
<b>Signed SLOTs differ:</b> the code sits at the top of the <em>signed</em> range with the
sign bit clear (0x7F, 0x7F00..0x7FFF, …), and an all-bits-set field is
then an ordinary -1 measurement, not an indicator.
Valid 1
A real measurement. Value is meaningful.
ParameterSpecific 2
The "parameter specific indicator" code (0xFB leading byte, or 0x7B for a
signed SLOT): its meaning is defined by the individual SPN, not by J1939-71, so it cannot
be scaled into a physical value here.
Reserved 3
Reserved for future indicator bits (0xFC..0xFD leading byte, or
0x7C..0x7D for a signed SLOT). Not a measurement.
Error 4
The transmitting ECU has the parameter but detected an error in it (0xFE leading
byte, or 0x7E for a signed SLOT).
Remarks¶
The numbering is deliberate: NotAvailable is 0 so that a default-initialised J1939SpnValue reports "not available" rather than a valid measurement of zero.