Pārlūkot izejas kodu

Add another sensor to the base station for testing

Bernd Gottschlag 5 gadus atpakaļ
vecāks
revīzija
045873b1ca
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  1. 4
    0
      base-station/software/src/radio.rs

+ 4
- 0
base-station/software/src/radio.rs Parādīt failu

@@ -25,6 +25,8 @@ const DISPLAY_ID: u8 = 0x20;
25 25
 const DISPLAY_KEY: [u8; 16] = include!("../../../common/display_key.txt");
26 26
 const WEATHER_STATION_0_ID: u8 = 0x30;
27 27
 const WEATHER_STATION_0_KEY: [u8; 16] = include!("../../../common/weather_station_0_key.txt");
28
+const WEATHER_STATION_1_ID: u8 = 0x31;
29
+const WEATHER_STATION_1_KEY: [u8; 16] = include!("../../../common/weather_station_1_key.txt");
28 30
 
29 31
 /// Hardware configuration.
30 32
 pub struct RadioConfig {
@@ -331,6 +333,7 @@ pub fn get_device_location(device_id: u8) -> Location {
331 333
     match device_id {
332 334
         DISPLAY_ID => Location::Bedroom,
333 335
         WEATHER_STATION_0_ID => Location::Livingroom,
336
+        WEATHER_STATION_1_ID => Location::Bathroom,
334 337
         _ => Location::Livingroom,
335 338
     }
336 339
 }
@@ -339,6 +342,7 @@ fn get_key(device_id: u8) -> Option<&'static [u8]> {
339 342
     match device_id {
340 343
         DISPLAY_ID => Some(&DISPLAY_KEY),
341 344
         WEATHER_STATION_0_ID => Some(&WEATHER_STATION_0_KEY),
345
+        WEATHER_STATION_1_ID => Some(&WEATHER_STATION_1_KEY),
342 346
         _ => None,
343 347
     }
344 348
 }

Notiek ielāde…
Atcelt
Saglabāt