Ist es, denn das Flag wird beim AskSinAnalyzer ausgewertet um den Typ "TIMESTAMP" anzuzeigen.
SetInterfaceClock sendet auch immer ein BURST vorweg.
Moderator: Co-Administratoren
Ist es, denn das Flag wird beim AskSinAnalyzer ausgewertet um den Typ "TIMESTAMP" anzuzeigen.
Ja, da (noch) nicht.papa hat geschrieben: ↑10.08.2020, 22:23Es wird aber bei der Nachrichtenverarbeitung nicht ausgewertet.
https://github.com/pa-pa/AskSinPP/blob/ ... ice.h#L215
Code: Alles auswählen
253693;10.08.2020 22:28:52;-77;4AB0F8;BidCoS-RF;000000;0000000000;15;61;TIMESTAMP;BCAST BURST RPTEN;0F 3D 94 3F 4A B0 F8 00 00 00 02 04 26 C4 6A 84;
Code: Alles auswählen
ab 01.02.1970 00:00:02 innerhalb 2 Minuten hin und wieder gesendet:
0F D6 94 3F 2B E1 4D 00 00 00 02 02 C7 BB 8D 01;
0F 09 94 3F 2B E1 4D 00 00 00 02 02 C7 BB 8D 12;
0F 93 94 3F 2B E1 4D 00 00 00 02 02 C7 BB 8D 28;
0F 41 94 3F 2B E1 4D 00 00 00 02 02 C7 BB 8D 32;
0F 79 94 3F 2B E1 4D 00 00 00 02 02 C7 BB 8D 37;
05.01.1970 00:00:05
0F 6B 94 3F 2B E1 4D 00 00 00 02 02 C7 99 45 F8;
10.08.2020 23:05:26
0F E1 94 3F 2B E1 4D 00 00 00 02 04 26 C4 73 16;
Code: Alles auswählen
my $s2000 = sprintf("%02X", CUL_HM_secSince2000());
CUL_HM_PushCmdStack($hash,"++803F$id${dst}0202$s2000");
Code: Alles auswählen
10.08.2020 23:05:26
0F E1 94 3F 2B E1 4D 00 00 00 02 04 26 C4 73 16;
Code: Alles auswählen
10.08.2020 23:05:26
0F E1 94 3F 2B E1 4D 00 00 00 02 04 26 C4 73 16;
Code: Alles auswählen
- 3600; # HM Special
Code: Alles auswählen
virtual bool process(Message& msg) {
if (getMasterID() == msg.from()) {
if(msg.type() == AS_MESSAGE_TIMESTAMP) {
if (msg.command() == AS_ACTION_SET) {
DPRINTLN("Got TIMESTAMP Message");
static const uint32_t sec2000 = 946684800;
int8_t timezone = msg.buffer()[10] / 2;
uint32_t tPayload =
(((uint32_t)msg.buffer()[11]) << 24) +
(((uint32_t)msg.buffer()[12]) << 16) +
(((uint32_t)msg.buffer()[13]) << 8) +
(((uint32_t)msg.buffer()[14])) ;
uint32_t unixtime = sec2000 + tPayload;
setTime(unixtime);
time_t t = now();
DPRINT("UTC Time is ");DDEC(day(t));DPRINT(".");DDEC(month(t));DPRINT(".");DDEC(year(t));DPRINT(" ");DDEC(hour(t));DPRINT(":");DDEC(minute(t));DPRINT(":");DDECLN(second(t));
adjustTime(timezone * 3600);
t = now();
DPRINT("local Time is ");DDEC(day(t));DPRINT(".");DDEC(month(t));DPRINT(".");DDEC(year(t));DPRINT(" ");DDEC(hour(t));DPRINT(":");DDEC(minute(t));DPRINT(":");DDECLN(second(t));
}
}
}
return ChannelDevice::process(msg);
}
Code: Alles auswählen
Got TIMESTAMP Message
UTC Time is 11.8.2020 5:38:30
local Time is 11.8.2020 7:38:30
Code: Alles auswählen
0x3A = 0b0011.1010
Code: Alles auswählen
0x3A --> 0xFA = 0b1111.1010
Code: Alles auswählen
(int8_t)0xFA = -6
Code: Alles auswählen
-6 / 2 = -3
Code: Alles auswählen
/* treat timezone as 6 bit signed integer */
int8_t timezone = msg.buffer()[10];
if ((uint8_t)timezone > 0x1F) {
timezone = timezone | 0xC0; /* fill up with sign bit */
}
timezone = timezone / 2; /* timezone might be encoded in half hours */