Skip to content

Commit

Permalink
fix 20240824
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard3366 committed Aug 24, 2024
1 parent e728ac1 commit 20c13cd
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions doc/main/general/data_format_document.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ The following is a detailed description of the data format
1.1 Overall Data Packet Format
------------------------------

+-------------+---------------------+------------------------+------------------------+-----+------------------------+-----+-------------+----------------------+-----------------------+----+
| Sensor-1 ID | Total Length(bytes) | Sensor Data Packet 1-1 | Sensor Data Packet 1-2 | ... | Sensor Data Packet 1-n | ... | Sensor-2 ID | Total Length (bytes) | Sensor Data Packet 1-1| ...| |
+=============+=====================+========================+========================+=====+========================+=====+=============+======================+=======================+====+
| 2bytes | 1byte | | | | | | 2bytes | 1byte | | |
+-------------+---------------------+------------------------+------------------------+-----+------------------------+-----+-------------+----------------------+-----------------------+----+
+-------------+---------------------+------------------------+------------------------+-----+------------------------+-----+-------------+----------------------+-----------------------+-----+
| Sensor-1 ID | Total Length(bytes) | Sensor Data Packet 1-1 | Sensor Data Packet 1-2 | ... | Sensor Data Packet 1-n | ... | Sensor-2 ID | Total Length (bytes) | SensorDataPacket 1-1 | ... |
+=============+=====================+========================+========================+=====+========================+=====+=============+======================+=======================+=====+
| 2bytes | 1byte | | | | | | 2bytes | 1byte | | |
+-------------+---------------------+------------------------+------------------------+-----+------------------------+-----+-------------+----------------------+-----------------------+-----+

.. note:: Each LoRaWAN packet can contain data from multiple sensors, each sensor can contain multiple types of sub-data.

Expand All @@ -31,12 +31,10 @@ The following is a detailed description of the data format
+--------------------+--------------------------------------------+---------------------------------+---------------------------------+

.. note:: **Total Valid Data Length (bytes)** This field is only present for arrays, omitted for other data types.
------------------------------------------------------------------------------------------------------------

+-----------+--------+----------------+
| Data Type | Value | Bytes Occupied |
+===========+========+================+
| --------- | ------ | -------------- |
+-----------+--------+----------------+
| array | 0b0000 | max 64 |
+-----------+--------+----------------+
| double | 0b0001 | 8 |
Expand Down Expand Up @@ -90,19 +88,19 @@ This is an example of a complete LoRaWAN data packet upload. (The data below is
+---------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
| 0X0A | Represents the GXHTC data length is 10 |
+---------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
| 0X02/0b0000 0010 | High 4 bits represent sub ID, looking up the table, it represents the temperature of GXHTC. The low 4 bits represent the data type is float |
| 0X02/0b0000 0010 | High 4 bits represent Sub ID, looking up the table, it represents the temperature of GXHTC. The low 4 bits represent the data type is float |
+---------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
| 0X2B 0X34 0XBB 0X41 | This temperature data converts to 23.40047264099121 |
+---------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
| 0X12/0b0001 0010 | High 4 bits represent sub ID, looking up the table, it represents the humidity of GXHTC. The low 4 bits represent the data type is float |
| 0X12/0b0001 0010 | High 4 bits represent Sub ID, looking up the table, it represents the humidity of GXHTC. The low 4 bits represent the data type is float |
+---------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
| 0X88 0XC5 0XB3 0X41 | This humidity data converts to 22.471450805664062 |
+---------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
| 0X00 0X00 | This section is the parent ID, looking up the sensor table, this is battery power |
+---------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
| 0X02 | Represents battery data length is 2 |
+---------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
| 0X05/0b0000 0101 | High 4 bits represent sub ID, looking up the table, it represents battery percentage. The low 4 bits represent the data type is uint8_t |
| 0X05/0b0000 0101 | High 4 bits represent Sub ID, looking up the table, it represents battery percentage. The low 4 bits represent the data type is uint8_t |
+---------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
| 0x07 | Represents the battery has 7% remaining |
+---------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
Expand Down

0 comments on commit 20c13cd

Please sign in to comment.