SNTP
Questo modulo include funzioni che controllano la comunicazione SNTP.
Sommario
Typedef | |
---|---|
otSntpQuery | typedefstruct otSntpQuery Questa struttura implementa i parametri di query SNTP. |
otSntpResponseHandler )(void *aContext, uint64_t aTime, otError aResult) | typedefvoid(* Questo puntatore a funzione viene chiamato quando viene ricevuta una risposta SNTP. |
Funzioni | |
---|---|
otSntpClientQuery ( otInstance *aInstance, const otSntpQuery *aQuery, otSntpResponseHandler aHandler, void *aContext) | Questa funzione invia una query SNTP. |
otSntpClientSetUnixEra ( otInstance *aInstance, uint32_t aUnixEra) | void Questa funzione imposta il numero dell'era unix. |
Structs | |
---|---|
otSntpQuery | Questa struttura implementa i parametri di query SNTP. |
Typedef
otSntpResponseHandler
void(* otSntpResponseHandler)(void *aContext, uint64_t aTime, otError aResult)
Questo puntatore a funzione viene chiamato quando viene ricevuta una risposta SNTP.
Dettagli | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parametri |
| ||||||||||
Valori restituiti |
|
Funzioni
otSntpClientQuery
otError otSntpClientQuery( otInstance *aInstance, const otSntpQuery *aQuery, otSntpResponseHandler aHandler, void *aContext )
Questa funzione invia una query SNTP.
Questa funzione è disponibile solo se la funzione OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE
è abilitata.
Dettagli | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parametri |
|
otSntpClientSetUnixEra
void otSntpClientSetUnixEra( otInstance *aInstance, uint32_t aUnixEra )
Questa funzione imposta il numero dell'era unix.
Il valore predefinito dell'era unix è impostato su 0. Le ere successive iniziano dopo l'anno 2106.
Dettagli | |||||
---|---|---|---|---|---|
Parametri |
|
Macro
OT_SNTP_DEFAULT_SERVER_IP
OT_SNTP_DEFAULT_SERVER_IP "2001:4860:4806:8::"
Definisce l'indirizzo del server SNTP predefinito: Google NTP Server.
OT_SNTP_DEFAULT_SERVER_PORT
OT_SNTP_DEFAULT_SERVER_PORT 123
Definisce la porta del server SNTP predefinita.