naneos.partector_ble.decoders
Decoders for the BLE characteristics and advertisement payloads of a Partector.
Every payload is a fixed 20 byte layout of little-endian unsigned integers. Each decoder is a table of fields (name, byte slice, scaling); the generic decode() loop reads them onto a NaneosDeviceDataPoint. Only the size distribution packs its channels as 20 bit values and needs its own loop.
PartectorBleDecoderAux
Bases: PartectorBleDecoderBlueprint
The aux characteristic, also the scan response half of the advertisement.
Source code in src/naneos/partector_ble/decoders.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | |
PartectorBleDecoderAuxError
Bases: PartectorBleDecoderBlueprint
The aux characteristic in error mode, marked by 0xFFFF in the first two bytes.
Source code in src/naneos/partector_ble/decoders.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | |
PartectorBleDecoderBlueprint
Shared decode loop. Subclasses define FIELDS or override _decode_fields().
Source code in src/naneos/partector_ble/decoders.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | |
decode(data, data_structure=None)
classmethod
Decode the payload. If data_structure is given it is filled in place and returned.
Source code in src/naneos/partector_ble/decoders.py
39 40 41 42 43 44 45 46 47 | |
PartectorBleDecoderSize
Bases: PartectorBleDecoderBlueprint
The size distribution: 8 channels packed as consecutive 20 bit values.
Source code in src/naneos/partector_ble/decoders.py
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |
PartectorBleDecoderStd
Bases: PartectorBleDecoderBlueprint
The std characteristic, also the first half of the advertisement.
Source code in src/naneos/partector_ble/decoders.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | |