Class Sntp
- Namespace
- nanoFramework.Networking
- Assembly
- nanoFramework.Networking.Sntp.dll
Provides a set of methods that help manage the Simple Network Time Protocol (SNTP) client on the target device.
public class Sntp
- Inheritance
-
Sntp
- Inherited Members
- Extension Methods
Remarks
This class is specific to .NET nanoFramework.
Constructors
Sntp()
public Sntp()
Properties
IsStarted
Get status of SNTP client.
public static bool IsStarted { get; }
Property Value
Server1
Gets or sets the host address of the main SNTP server. By default it uses the server '0.pool.ntp.org'.
public static string Server1 { get; set; }
Property Value
Remarks
For a list of some public NTP servers, see this link: http://support.ntp.org/bin/view/Servers/NTPPoolServers
Server2
Gets or sets the host address of the backup SNTP server. By default it uses the server '1.pool.ntp.org'.
public static string Server2 { get; set; }
Property Value
Remarks
For a list of some public NTP servers, see this link: http://support.ntp.org/bin/view/Servers/NTPPoolServers
Methods
Start()
Starts the SNTP client. After this method returns, a periodic call to the set SNTP servers is performed providing time synchronization.
public static void Start()
Remarks
The system time is updated immediately after each successful execution.
By default the time synchronization occurs on a hourly rate.
Stop()
Stops the SNTP client. The time synchronization will stop.
public static void Stop()
UpdateNow()
Performs an immediate request to synchronize time.
public static void UpdateNow()
Remarks
This performs a restart of the internal service.