Skip to content

Commit 1f3a941

Browse files
committed
Changed data type in EddystoneTLM class and example
1 parent ddd6496 commit 1f3a941

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

libraries/BLE/examples/BLE_EddystoneTLM_Beacon/BLE_EddystoneTLM_Beacon.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void setBeacon()
5050
uint16_t volt = random(2800, 3700); // 3300mV = 3.3V
5151
float tempFloat = random(2000, 3100) / 100.0f;
5252
Serial.printf("Random temperature is %.2fC\n", tempFloat);
53-
int temp = (int)(tempFloat * 256); //(uint16_t)((float)23.00);
53+
int16_t temp = (int16_t)(tempFloat * 256);
5454
Serial.printf("Converted to 8.8 format %0X%0X\n", (temp >> 8), (temp & 0xFF));
5555

5656
BLEAdvertisementData oAdvertisementData = BLEAdvertisementData();

libraries/BLE/src/BLEEddystoneTLM.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ void BLEEddystoneTLM::setVolt(uint16_t volt) {
132132
} // setVolt
133133

134134
void BLEEddystoneTLM::setTemp(float temp) {
135-
m_eddystoneData.temp = (uint16_t)temp;
135+
m_eddystoneData.temp = (int16_t)temp;
136136
} // setTemp
137137

138138
void BLEEddystoneTLM::setCount(uint32_t advCount) {

libraries/BLE/src/BLEEddystoneTLM.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class BLEEddystoneTLM {
4141
uint8_t frameType;
4242
uint8_t version;
4343
uint16_t volt;
44-
uint16_t temp;
44+
int16_t temp;
4545
uint32_t advCount;
4646
uint32_t tmil;
4747
} __attribute__((packed)) m_eddystoneData;

0 commit comments

Comments
 (0)