Simple Network Time Protocol (SNTP) implementation.  
More...
Simple Network Time Protocol (SNTP) implementation. 
- Note
 - The current implementation of SNTP uses ztimer 64bit version with microsecond accuracy, which can have a strong impact on the power consumption of your device. 
 
◆ sntp_get_offset()
      
        
          | int64_t sntp_get_offset  | 
          ( | 
          void  | 
           | ) | 
           | 
        
      
 
Get real time offset from system time as returned by ztimer64_now() 
- Returns
 - Real time offset in microseconds relative to 1900-01-01 00:00 UTC 
 
 
 
◆ sntp_get_unix_usec()
  
  
      
        
          | static uint64_t sntp_get_unix_usec  | 
          ( | 
          void  | 
           | ) | 
           | 
         
       
   | 
  
inlinestatic   | 
  
 
Get time in microseconds from 1970-01-01 00:00:00 UTC. 
- Returns
 - Time in microseconds from 1970-01-01 00:00:00 UTC 
 
Definition at line 63 of file sntp.h.
 
 
◆ sntp_sync()
Synchronize with time server. 
- Parameters
 - 
  
    | [in] | server | The time server  | 
    | [in] | timeout | Timeout for the server response in microseconds | 
  
   
- Returns
 - 0 on success 
 
- 
Negative number on error