#Region Project Attributes
#AutoFlushLogs: True
#CheckArrayBounds: True
#StackBufferSize: 900
#End Region
Sub Process_Globals
Public timestamp As ULong
Public utc As Int=1
Public timeserver As String = "fritz.box"
end sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
wifi.Connect2("***","***")
RunNative("update",Null)
delay (60000)
RunNative("update",Null)
end sub
#If c
#include <EasyNTPClient.h>
void update(B4R::Object* o) {
WiFiUDP udp;
EasyNTPClient ntpClient(udp, b4r_main::_timeserver->data, ((b4r_main::_utc*60*60)));
Serial.println(ntpClient.getUnixTime());
}
#end if