From 381bbb7ceb5192c5154c1b69b6c1c5af3161b27f Mon Sep 17 00:00:00 2001 From: rbaron Date: Sun, 4 Dec 2022 10:13:01 +0100 Subject: [PATCH] Fix illuminance encoding in ble, BTHome v2 --- code/nrf-connect/samples/ble/src/encoding.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/nrf-connect/samples/ble/src/encoding.c b/code/nrf-connect/samples/ble/src/encoding.c index 10a6451..ee89d16 100644 --- a/code/nrf-connect/samples/ble/src/encoding.c +++ b/code/nrf-connect/samples/ble/src/encoding.c @@ -108,9 +108,9 @@ int prst_ble_encode_service_data(const prst_sensors_t* sensors, out[8] = humi_val >> 8; // Illuminance. out[9] = 0x05; - out[10] = sensors->photo.brightness >> 16; - out[11] = (sensors->photo.brightness >> 8) & 0xff; - out[12] = sensors->photo.brightness & 0xff; + out[10] = sensors->photo.brightness & 0xff; + out[11] = sensors->photo.brightness >> 8; + out[12] = 0; // Battery voltage. out[13] = 0x0c; // Value. Factor of 0.001.