@@ -11,7 +11,6 @@ The general structure of a packed value is:
11
11
12
12
\[ ** Value Type** * {1 byte}* ] [ **Data Value** *{n bytes - network byte order }* ]
13
13
14
-
15
14
### Value Type
16
15
17
16
Key attributes of a "Value Type" tag/code:
@@ -38,3 +37,94 @@ The following table outlines how a data value is packed, based on it's data type
38
37
| float | 4 | Network Byte Order (4 bytes) |
39
38
| double | 8 | \[ Network Byte Order (4 bytes) ] [ Network Byte Order (4 bytes) ] |
40
39
40
+ ## Packet Encoding
41
+
42
+ When packing a data value in the LoRaWAN packet payload, which has a total of 11 bytes available, data values are formatted as described in the previous section and added to the payload until no further space is available. When the payload is * full* (no free space available for the next data value), it is sent to the LoRaWAN network.
43
+
44
+ So for a 11 byte LoRaWAN Payload buffer, the contents could be (note a Value Type is 1 byte):
45
+
46
+ * \[ ** Value Type** ] [ **Data Value** *{4 bytes}* ] \[ ** Value Type** ] [ **Data Value** *{4 bytes}* ] \[ ** empty** {1 byte}] = ** 10 bytes used**
47
+ * \[ ** Value Type** ] [ **Data Value** *{2 bytes}* ] \[ ** Value Type** ] [ **Data Value** *{4 bytes}* ] \[ ** empty** {3 byte}] = ** 8 bytes used***
48
+ * \[ ** Value Type** ] [ **Data Value** *{2 bytes}* ] \[ ** Value Type** ] [ **Data Value** *{4 bytes}* ] \[ ** Value Type** ] [ **Data Value** *{2 bytes}* ] = ** 11 bytes used**
49
+
50
+ The general payload packing is as follows:
51
+
52
+ ### * Initial Condition*
53
+
54
+ * Set the current position in the payload to position 0
55
+
56
+ ### * Operation*
57
+
58
+ 1 ) Data Packet is formatted
59
+ 1 ) If no room is available in the payload
60
+ * The data payload is sent to the LoRaWAN
61
+ * The payload buffer set to position 0
62
+ 1 ) The data packet is added to the payload buffer
63
+ 1 ) The current position in in the payload is incremented by the size of the data packet
64
+ 1 ) Repeat step 1) until all data is sent
65
+
66
+ ### * End Condition*
67
+
68
+ * Flush the payload buffer - send any pending data to the LoRaWAN
69
+
70
+ ## Sensor and Data Value Encodings
71
+
72
+ The following table outlines the sensors and data encoding used by the IoT Node - LoRaWAN firmware:
73
+
74
+ | Sensor | Parameter | Value Type | Value Type Code | Data Type |
75
+ | -- | -- | -- | -- | -- |
76
+ | BME688 | | | ||
77
+ | | Humidity | Humidity_F | | float|
78
+ | | Temperature C | TempC | | float|
79
+ | | Pressure | Pressure_F | | float|
80
+ | BME280 | ||||
81
+ || Humidity | Humidity_F | | float|
82
+ || Temperature F | TempF || float|
83
+ || Temperature C | TempC || float|
84
+ | BMP384|||||
85
+ || Temperature C | TempC_D || double|
86
+ || Presure (Pa)| Pressure_D || double|
87
+ | BMP581|||||
88
+ || Pressure (Pa) | Pressure_F || float|
89
+ || Temperature C | TempC || float|
90
+ | CCS811|||||
91
+ || CO2 | CO2_F || float|
92
+ || VOC| TVOC || float|
93
+ | ENS160|||||
94
+ || Equivalent CO2 | CO2 || uint16|
95
+ || TVOC| VOC || unit16|
96
+ || Ethanol Concentration | ETOH || uint16 |
97
+ || Air Quality Index | AQI || uint8 |
98
+ | FS3000|||||
99
+ || Flow (MPS) | MPS || float|
100
+ || FLow (MPH) | MPH || float|
101
+ | GNSS|||||
102
+ || Latitude in Degrees | Latitude || double|
103
+ || Longitude in Degrees| Longitude || double|
104
+ || Altitude (meters) | Altitude || double|
105
+ | ISM330|||||
106
+ || Accelerometer X (milli-g)| AccelX || float|
107
+ || Accelerometer Y (milli-g)| AccelY || float|
108
+ || Accelerometer Z (milli-g)| AccelZ || float|
109
+ || Gyro X (milli-dps)| GyroX || float|
110
+ || Gyro Y (milli-dps)| GyroY || float|
111
+ || Gyro Z (milli-dps)| GyroZ || float|
112
+ | LPS25HB|||||
113
+ || Pressure (hPa) | Pressure_F || float|
114
+ || Temperature C | TempC || float|
115
+ | MAX17048|||||
116
+ || Voltage (V)| BatteryVoltage || float|
117
+ || State Of Charge (%) | BatteryCharge || float|
118
+ || Change Rate (%/hr) | BatteryChargeRate || float|
119
+ | Micro Pressure|||||
120
+ || Pressure (Pa)| Pressure_F || float|
121
+ | MS5637|||||
122
+ || Pressure (mBar) | Pressure_mBar || float|
123
+ || Temperature C | TempC || float|
124
+ | NAU7802|||||
125
+ || Weight| WeightUserUnits|| float|
126
+ | OPT4048|||||
127
+ || CIEx| CIE_X || double|
128
+ || CIEy | CIE_Y || double|
129
+ || CIET | CCT || double|
130
+
0 commit comments