mirror of
https://github.com/thelsing/knx.git
synced 2024-12-18 19:08:18 +01:00
correction for DPT 10.001 TimeOfDay implemented; #define DPT_TimeOfDay Dpt(10, 1, 1) (#237)
extension of dptconvert.cpp to get "tmp.tm_wday = weekDay;" decoded in Struct tm
This commit is contained in:
parent
8807780b55
commit
5007462c70
@ -87,7 +87,7 @@
|
|||||||
#define DPT_Rain_Amount Dpt(9, 26)
|
#define DPT_Rain_Amount Dpt(9, 26)
|
||||||
#define DPT_Value_Temp_F Dpt(9, 27)
|
#define DPT_Value_Temp_F Dpt(9, 27)
|
||||||
#define DPT_Value_Wsp_kmh Dpt(9, 28)
|
#define DPT_Value_Wsp_kmh Dpt(9, 28)
|
||||||
#define DPT_TimeOfDay Dpt(10, 1)
|
#define DPT_TimeOfDay Dpt(10, 1, 1)
|
||||||
#define DPT_Date Dpt(11, 1)
|
#define DPT_Date Dpt(11, 1)
|
||||||
#define DPT_Value_4_Ucount Dpt(12, 1)
|
#define DPT_Value_4_Ucount Dpt(12, 1)
|
||||||
#define DPT_Value_4_Count Dpt(13, 1)
|
#define DPT_Value_4_Count Dpt(13, 1)
|
||||||
|
@ -416,6 +416,7 @@ int busValueToTime(const uint8_t* payload, size_t payload_length, const Dpt& dat
|
|||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
unsigned char hours = unsigned8FromPayload(payload, 0) & 0x1F;
|
unsigned char hours = unsigned8FromPayload(payload, 0) & 0x1F;
|
||||||
|
unsigned char weekDay = (unsigned8FromPayload(payload, 0) & 0xE0) >> 5;
|
||||||
unsigned char minutes = unsigned8FromPayload(payload, 1) & 0x3F;
|
unsigned char minutes = unsigned8FromPayload(payload, 1) & 0x3F;
|
||||||
unsigned char seconds = unsigned8FromPayload(payload, 2) & 0x3F;
|
unsigned char seconds = unsigned8FromPayload(payload, 2) & 0x3F;
|
||||||
|
|
||||||
@ -423,6 +424,7 @@ int busValueToTime(const uint8_t* payload, size_t payload_length, const Dpt& dat
|
|||||||
return false;
|
return false;
|
||||||
struct tm tmp = {0};
|
struct tm tmp = {0};
|
||||||
tmp.tm_hour = hours;
|
tmp.tm_hour = hours;
|
||||||
|
tmp.tm_wday = weekDay;
|
||||||
tmp.tm_min = minutes;
|
tmp.tm_min = minutes;
|
||||||
tmp.tm_sec = seconds;
|
tmp.tm_sec = seconds;
|
||||||
value = tmp;
|
value = tmp;
|
||||||
|
Loading…
Reference in New Issue
Block a user