We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 098a989 commit da13114Copy full SHA for da13114
src/NimBLEEddystoneTLM.cpp
@@ -81,7 +81,7 @@ uint16_t NimBLEEddystoneTLM::getVolt() {
81
* @return The temperature value.
82
*/
83
float NimBLEEddystoneTLM::getTemp() {
84
- return ENDIAN_CHANGE_U16(m_eddystoneData.temp) / 256.0f;
+ return (int16_t)ENDIAN_CHANGE_U16(m_eddystoneData.temp) / 256.0f;
85
} // getTemp
86
87
/**
@@ -203,7 +203,7 @@ void NimBLEEddystoneTLM::setVolt(uint16_t volt) {
203
* @param [in] temp The temperature value.
204
205
void NimBLEEddystoneTLM::setTemp(float temp) {
206
- m_eddystoneData.temp = (uint16_t)temp;
+ m_eddystoneData.temp = ENDIAN_CHANGE_U16((int16_t)(temp * 256.0f));
207
} // setTemp
208
209
0 commit comments