Part Number: MSP432E401Y
Hi,
using SDK: simplelink_msp432e4_sdk_3_20_00_10, using IPV4
I need to have the option to get the UTC time using SNTP service. If I use SNTP_getTime by using the built in server name list (sntp.c) it works. Always. However if I try to use the function SNTP_getTimeByAddr it never works and returns with the error code -107.
I tried to find the root cause. The only thing I can find is within sntp.c both functions do finally call the very same function internally:
static int32_t getTime(SlNetSock_Addr_t *server, uint16_t ifID, SlNetSock_Timeval_t *timeout, uint64_t *ntpTimeStamp);
The difference is that in working version (SNTP_getTime) the value for ifID is not '0'. In the version SNTP_getTimeByAddr ifID is nulled or set to '0' before calling getTime
The application is based on an example from TI. I check which version has to be called and I need both of them to work properly.
// Chk if a dedicated time server has to be called. If not use one
// of the internal compiled list of servers.
if (bTRUE == sysCfg.iCfgNetUseSNTP && (0 != sntpIP)) { <<-- Check which call is needed ...
retval = SNTP_getTimeByAddr((SlNetSock_Addr_t *)&sntpServer, &timeval, &ntpTimeStamp); <<-- never works reval = - 107
} else {
/* Get the time use the built in NTP server list: */
retval = SNTP_getTime(NULL, 0, &timeval, &ntpTimeStamp); <<-- is working!
}
Any idea, where to look further?
Markus