Skip to content

Commit 6a3eeaa

Browse files
authored
no decoding yet
1 parent 04fc105 commit 6a3eeaa

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/Datapoint/ConversionHelpers.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ std::size_t encodeSchedule(const char* schedule, uint8_t* output) {
8080
return encodeSchedule(schedule, strlen(schedule), output);
8181
}
8282

83+
/*
8384
std::size_t decodeSchedule(const uint8_t* data, std::size_t len, char* output, std::size_t maxLen) {
8485
assert(len == 8);
8586
assert(maxLen >= 48); // 8 times 07:30, 7 spaces and 0-terminator --> 8 * 5 + 7 * 1 + 1
@@ -88,10 +89,12 @@ std::size_t decodeSchedule(const uint8_t* data, std::size_t len, char* output, s
8889
for (std::size_t i = 0; i < 8; ++i) {
8990
unsigned int hour = std::min(23, data[i] >> 3);
9091
unsigned int minutes = std::min(59, (data[i] & 0x07) * 10);
91-
int res = snprintf("%u.02:%u.02");
92-
if (i < 7)
93-
}
92+
int res = snprintf("%u.02:%u.02", hour, minutes);
93+
if (i < 7) {
9494
95+
}
96+
}
9597
}
98+
*/
9699

97100
} // end namespace VitoWiFi

src/Datapoint/ConversionHelpers.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ Hours can be with leading zero or not.
4040
std::size_t encodeSchedule(const char* schedule, std::size_t len, uint8_t* output);
4141
std::size_t encodeSchedule(const char* schedule, uint8_t* output);
4242

43+
/*
4344
std::size_t decodeSchedule(const uint8_t* data, std::size_t len, char* output, std::size_t maxLen);
45+
*/
4446

4547
}; // end namespace VitoWiFi

0 commit comments

Comments
 (0)