From b6ad4579041300498ad450f4291b2fcb08758cd6 Mon Sep 17 00:00:00 2001 From: Alois Mbutura Date: Fri, 12 Apr 2019 13:13:21 +0300 Subject: [PATCH] Update esp_eddystone_api.h Change incorrect bitshifts in big_endian_read_32() function. This was giving wrong values of of the 4 byte fieldswithin the eddystone TLM message, namely 'ADV_CNT' and 'SEC_CNT' --- examples/bluetooth/ble_eddystone/main/esp_eddystone_api.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bluetooth/ble_eddystone/main/esp_eddystone_api.h b/examples/bluetooth/ble_eddystone/main/esp_eddystone_api.h index 946abab54..41ad278e8 100644 --- a/examples/bluetooth/ble_eddystone/main/esp_eddystone_api.h +++ b/examples/bluetooth/ble_eddystone/main/esp_eddystone_api.h @@ -53,7 +53,7 @@ static inline uint16_t big_endian_read_16(const uint8_t *buffer, uint8_t pos) static inline uint32_t big_endian_read_32(const uint8_t *buffer, uint8_t pos) { - return (((uint32_t)buffer[pos]) << 24) | (((uint32_t)buffer[(pos)+1]) >> 16) | (((uint32_t)buffer[(pos)+2]) >> 8) | ((uint32_t)buffer[(pos)+3]); + return (((uint32_t)buffer[pos]) << 24) | (((uint32_t)buffer[(pos)+1]) << 16) | (((uint32_t)buffer[(pos)+2]) << 8) | ((uint32_t)buffer[(pos)+3]); } /*