## 5 Use Case Description with the OGC SensorThings Standard
### Tested Sensors
#### 5.2.1 SensorData Digital Matter  
The payload for SensorData sensors produced by Digital Matter is composed of a binary hexadecimal string where data are passed through a key-value model: a byte is assigned a key, which is used to identify the type of measurement it represents, while the subsequent n bytes (n varies depending on the type of data) represent the value of the measurement [98]. Data are always transmitted in a single message to avoid complexity and limitations. Related values are grouped together, while unrelated ones can appear in the same message. The payload starts at byte 0 with no header, and the first measurement's key is determined by the port number. SigFox has a fixed payload size of 12 bytes, while LoRaWAN's payload size varies by region and spreading factor, with a minimum of 11 bytes in the EU868 region at SF 12 [100].  
**Payload Syntax**: each data measured or transmitted by the sensor is called a \"data field\", identified by an ID (or \"key\") and containing a value. The software decoding the data needs to know the IDs and their lengths. The manufacturer provides a table with the IDs, their corresponding data fields, value sizes, and data types (e.g., UINT8, BYTE). Key data fields for the system include those related to the device's satellite position and the measurements it performs.  
* **10 GPS Position**: The position is associated with the identifying ID value 10, and the associated data is 6 bytes long. The values associated with the measurement are expressed as two numbers in INT24 format, so the first three bytes of the value field represent the sensor's latitude, while the last three bytes represent the longitude.
* **SDI-12 Measurement n**: Sensor measurements are labelled as \"SDI-12 measurement\" followed by a number (1 to 5). Each sensor can send up to five types of readings, and if the data exceeds the byte limit of the communication frame (e.g., 11 bytes for LoRaWAN), the reading may be split into two parts. The first 4 bits of the first byte communicate the number of values for that measurement (maximum of 10 values for each measurement), while the last 4 bits indicate the data type of the values according to the encoding in the table. The values contained from the second byte onward correspond to the actual measurement values. The five types of data for the values are (i) Soil moisture UINT8, (ii) SDI-12 Temperature UINT8, (iii) SDI-12 Generic INT16 \(\times\) 100, (iv) SDI-12 Generic INT32 \(\times\) 1000, and (v) SDI-12 Generic INT12.  
It is important to note that every other measurement produced by the sensor (internal temperature, battery charge level, etc.) behaves similarly to the external measurements of the sensor and is treated by the system in the same way, that is, with observations that are linked to a DATASTREAM.  
**Additional Requirements**: In addition to those listed in the general model, the SensorData connector requires additional requirements:  
* The payload received by the connector must contain the identification ID of the device from which the message was sent.
* The payload sent from a LoRaWAN gateway must incorporate the port number through which the gateway received the message, as it identifies the ID of the first measurement.
* The DATASTREAM entities related to external measurements must be preloaded into the OGC SensorThings system, since the connector does not have enough data to create them.