Simple Weather Service

Store temperatures as int16_t (instead of uint8_t previously). The temperature is expressed in °C * 100.
This commit is contained in:
Jean-François Milants
2023-12-23 17:18:41 +01:00
committed by JF
parent ad090ab188
commit e5b73212f6
4 changed files with 53 additions and 38 deletions

View File

@@ -28,11 +28,11 @@ The byte array must contain the following data:
- [0] : Message type = `0`
- [1] : Message version = `0`
- [2][3][4][5][6][7][8][9] : Timestamp (64 bits UNIX timestamp, number of nanoseconds elapsed since 1 JAN 1970)
- [10] : Current temperature (°C)
- [11] : Minimum temperature (°C)
- [12] : Maximum temperature (°C)
- [13]..[44] : location (string, unused characters should be set to `0`)
- [45] : icon ID
- [10, 11] : Current temperature (°C * 100)
- [12, 13] : Minimum temperature (°C * 100)
- [14, 15] : Maximum temperature (°C * 100)
- [16]..[47] : location (string, unused characters should be set to `0`)
- [48] : icon ID
- 0 = Sun, clear sky
- 1 = Few clouds
- 2 = Clouds
@@ -48,21 +48,21 @@ The byte array must contain the following data:
The byte array must contain the following data:
- [0] : Message type = `0`
- [0] : Message version = `0`
- [1] : Message version = `0`
- [2][3][4][5][6][7][8][9] : Timestamp (64 bits UNIX timestamp, number of nanoseconds elapsed since 1 JAN 1970)
- [10] Number of days (Max 5, fields for unused days should be set to `0`)
- [11] Day 0 Minimum temperature
- [12] Day 0 Maximum temperature
- [13] Day 0 Icon ID
- [14] Day 1 Minimum temperature
- [15] Day 1 Maximum temperature
- [16] Day 1 Icon ID
- [17] Day 2 Minimum temperature
- [18] Day 2 Maximum temperature
- [19] Day 2 Icon ID
- [20] Day 3 Minimum temperature
- [21] Day 3 Maximum temperature
- [22] Day 3 Icon ID
- [23] Day 4 Minimum temperature
- [24] Day 4 Maximum temperature
- [25] Day 4 Icon ID
- [11,12] Day 0 Minimum temperature (°C * 100)
- [13,14] Day 0 Maximum temperature (°C * 100)
- [15] Day 0 Icon ID
- [16,17] Day 1 Minimum temperature (°C * 100)
- [18,19] Day 1 Maximum temperature (°C * 100)
- [20] Day 1 Icon ID
- [21,22] Day 2 Minimum temperature (°C * 100)
- [23,24] Day 2 Maximum temperature (°C * 100)
- [25] Day 2 Icon ID
- [26,27] Day 3 Minimum temperature (°C * 100)
- [28,29] Day 3 Maximum temperature (°C * 100)
- [30] Day 3 Icon ID
- [31,32] Day 4 Minimum temperature (°C * 100)
- [33,34] Day 4 Maximum temperature (°C * 100)
- [35] Day 4 Icon ID