Skip to content

Commit

Permalink
Add raw sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
Ernst79 committed Oct 3, 2023
1 parent c56e7f2 commit ddf2b3a
Showing 1 changed file with 31 additions and 15 deletions.
46 changes: 31 additions & 15 deletions src/format.html
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,21 @@ <h4 id="sensor-data">Sensor data</h4>
<code>hPa</code>
</td>
</tr>
<tr>
<td>
<code>0x54</code>
</td>
<td>raw</td>
<td>see below</td>
<td>-</td>
<td>
<code>540C48656c6c6f20576f726c6421</code>
</td>
<td>"48656c6c6f20576f726c6421"</td>
<td>
<code></code>
</td>
</tr>
<tr>
<td>
<code>0x3F</code>
Expand Down Expand Up @@ -717,30 +732,30 @@ <h4 id="sensor-data">Sensor data</h4>
</tr>
<tr>
<td>
<code>0x50</code>
<code>0x53</code>
</td>
<td>timestamp</td>
<td>uint48 (4&nbsp;bytes)</td>
<td>text</td>
<td>see below</td>
<td>-</td>
<td>
<code>505d396164</code>
<code>530C48656C6C6F20576F726C6421</code>
</td>
<td>see below</td>
<td>"Hello World!"</td>
<td>
<code></code>
</td>
</tr>
<tr>
<td>
<code>0x53</code>
<code>0x50</code>
</td>
<td>text</td>
<td>see below</td>
<td>timestamp</td>
<td>uint48 (4&nbsp;bytes)</td>
<td>-</td>
<td>
<code>530C48656C6C6F20576F726C6421</code>
<code>505d396164</code>
</td>
<td>"Hello World!</td>
<td>see below</td>
<td>
<code></code>
</td>
Expand Down Expand Up @@ -895,15 +910,16 @@ <h5 id="timestamp">Timestamp</h5>
<code>datetime(2023, 5, 14, 19, 41, 17, tzinfo=timezone.utc)</code>
</p>

<h5 id="text">Text</h5>
<h5 id="text">Text and Ras sensors</h5>
<p>
The text sensor has a variable length. You therefore have to specify
the length in the first byte after the `object id`. In the example
The Text and Raw sensors have a variable length. You therefore have to specify
the length in the first byte after the `object id`. In the text sensor example
<code>0x530C48656C6C6F20576F726C6421</code>, the 2nd byte (<code>0x0C</code>)
gives the length of the text string (12 bytes). The text has to be encoded in
UTF-8. The byte string <code>0x48656C6C6F20576F726C6421</code> in text is
<code>Hello World!</code>. Make sure the length is specified correct in the
second byte.
<code>Hello World!</code>. In Raw format <code>0x54</code>, the bytes are
reported in hex format, as <code>48656C6C6F20576F726C6421</code>.
Make sure the length is specified correct in the second byte.
</p>

<h5 id="multiple_measurements">Multiple measurements of the same type</h5>
Expand Down

0 comments on commit ddf2b3a

Please sign in to comment.