Skip to contentSkip to conversation

Fix bad epoch time stamp generation

PATCH Applied Santiago Carot-Nemesio 2 participants 2 messages Nov 25, 2011 – Dec 8, 2011 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix bad epoch time stamp generation

The number of months is in the range 0 to 11, we have to decrease month number by 1 before getting the epoch.

---
 thermometer/thermometer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
thermometer/thermometer.c +1 -1
index db33cdb..e3872c9 100644
@@ -954,7 +954,7 @@ static void proc_measurement(struct thermometer *t, const uint8_t *pdu,
 		}
 
 		ts.tm_year = att_get_u16(&pdu[8]) - 1900;
-		ts.tm_mon = pdu[10];
+		ts.tm_mon = pdu[10] - 1;
 		ts.tm_mday = pdu[11];
 		ts.tm_hour = pdu[12];
 		ts.tm_min = pdu[13];
Signature · 1 line
1.7.7.4
#1 lore raw

Hi Santiago,

Quoted 5 lines · Santiago Carot-Nemesio

The number of months is in the range 0 to 11, we have to decrease month number by 1 before getting the epoch.

---
 thermometer/thermometer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied. Thanks.

Johan