mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-12 13:08:13 +08:00
add:增加sntp服务器,降低失败概率
This commit is contained in:
@@ -23,8 +23,22 @@ OSStatus user_sntp_get_time( )
|
||||
|
||||
hostent_content = gethostbyname( "pool.ntp.org" );
|
||||
pptr = hostent_content->h_addr_list;
|
||||
ipp.s_addr = 0xd248912c;
|
||||
err = sntp_get_time( &ipp, ¤t_time );
|
||||
if ( err != kNoErr )
|
||||
{
|
||||
os_log("sntp_get_time err = %d.", err);
|
||||
ipp.s_addr = *(uint32_t *) (*pptr);
|
||||
err = sntp_get_time( &ipp, ¤t_time );
|
||||
}
|
||||
if ( err != kNoErr )
|
||||
{
|
||||
os_log("sntp_get_time0 err = %d.", err);
|
||||
hostent_content = gethostbyname( "cn.ntp.org.cn" );
|
||||
pptr = hostent_content->h_addr_list;
|
||||
ipp.s_addr = *(uint32_t *) (*pptr);
|
||||
err = sntp_get_time( &ipp, ¤t_time );
|
||||
}
|
||||
if ( err != kNoErr )
|
||||
{
|
||||
os_log("sntp_get_time1 err = %d.", err);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user