RS1xx provide timestamp

Okay…got it now (o;

You need to send it base64 encoded as payload_raw…not as timestamp but with the RTC format the RS1xx expects…sample PHP code to generate it (keep it simple and stupid style ;o):

<?php

	// Laird RS1xx RTC Message Format
	// 0x02 0x00 0xYY 0xMM 0xDD 0xHH 0xMM 0xSS
	date_default_timezone_set("Europe/Zurich");

	$year = intval(date("y"));
	$month = intval(date("n"));
	$day = intval(date("j"));
	$hour = intval(date("G"));
	$minute = intval(date("i"));
	$second = intval(date("s"));

	$message = $second + ($minute << 8) + ($hour << 16) + ($day << 24) + ($month << 32) + ($year << 40) + (2 << 56);

	$hex = dechex($message);
	echo $hex . "\n";
	echo base64_encode(hex2bin("0" . $hex)) . "\n";
?>
1 Like