In my scenario, I am connected to a wifi in STA mode. I am calling the NTP server and reading time.
Setting the device time with sl_DeviceSet(SL_DEVICE_GENERAL, SL_DEVICE_GENERAL_DATE_TIME, sizeof(SlDateTime_t), (unsigned char *)(&objL_datetime)); works like a charm, no issues there. After that, I can connect to mqtt server using mqtt lib and I everything is working as expected ..
But, if I call clock_settime(CLOCK_REALTIME, &objL_timespec) in just after(before the sl_DeviceSet, the MQTT connection is not working. I am getting SL_API_ABORTED (-2005) from MQTTClient_connect().I was even trying to call sl_Stop(200) and sl_Start(0,0,0) to restart simplelink ... but the issue is not disappearing
Any idea. how this could be connected and how to fix it? (commenting out clock_settime will make it work again, but thats not the prefered solution)
Thanks, Igor