TuyaOS
sntp_opts.h
浏览该文件的文档.
1
6/*
7 * Copyright (c) 2007-2009 Frédéric Bernon, Simon Goldschmidt
8 * All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without modification,
11 * are permitted provided that the following conditions are met:
12 *
13 * 1. Redistributions of source code must retain the above copyright notice,
14 * this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 * 3. The name of the author may not be used to endorse or promote products
19 * derived from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
22 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
24 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
26 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
29 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
30 * OF SUCH DAMAGE.
31 *
32 * This file is part of the lwIP TCP/IP stack.
33 *
34 * Author: Frédéric Bernon, Simon Goldschmidt
35 *
36 */
37#ifndef LWIP_HDR_APPS_SNTP_OPTS_H
38#define LWIP_HDR_APPS_SNTP_OPTS_H
39
40#include "lwip/opt.h"
41#include "lwip/prot/iana.h"
42
55#if !defined SNTP_SET_SYSTEM_TIME || defined __DOXYGEN__
56#define SNTP_SET_SYSTEM_TIME(sec) LWIP_UNUSED_ARG(sec)
57#endif
58
60#if !defined SNTP_MAX_SERVERS || defined __DOXYGEN__
61#define SNTP_MAX_SERVERS LWIP_DHCP_MAX_NTP_SERVERS
62#endif
63
66#if !defined SNTP_GET_SERVERS_FROM_DHCP || defined __DOXYGEN__
67#define SNTP_GET_SERVERS_FROM_DHCP LWIP_DHCP_GET_NTP_SRV
68#endif
69
74#if !defined SNTP_SERVER_DNS || defined __DOXYGEN__
75#define SNTP_SERVER_DNS 0
76#endif
77
81#if !defined SNTP_DEBUG || defined __DOXYGEN__
82#define SNTP_DEBUG LWIP_DBG_OFF
83#endif
84
86#if !defined SNTP_PORT || defined __DOXYGEN__
87#define SNTP_PORT LWIP_IANA_PORT_SNTP
88#endif
89
104#if !defined SNTP_CHECK_RESPONSE || defined __DOXYGEN__
105#define SNTP_CHECK_RESPONSE 0
106#endif
107
128#if !defined SNTP_COMP_ROUNDTRIP || defined __DOXYGEN__
129#define SNTP_COMP_ROUNDTRIP 0
130#endif
131
138#if !defined SNTP_STARTUP_DELAY || defined __DOXYGEN__
139#ifdef LWIP_RAND
140#define SNTP_STARTUP_DELAY 1
141#else
142#define SNTP_STARTUP_DELAY 0
143#endif
144#endif
145
149#if !defined SNTP_STARTUP_DELAY_FUNC || defined __DOXYGEN__
150#define SNTP_STARTUP_DELAY_FUNC (LWIP_RAND() % 5000)
151#endif
152
157#if !defined SNTP_RECV_TIMEOUT || defined __DOXYGEN__
158#define SNTP_RECV_TIMEOUT 15000
159#endif
160
164#if !defined SNTP_UPDATE_DELAY || defined __DOXYGEN__
165#define SNTP_UPDATE_DELAY 3600000
166#endif
167
174#if !defined SNTP_GET_SYSTEM_TIME || defined __DOXYGEN__
175#define SNTP_GET_SYSTEM_TIME(sec, us) do { (sec) = 0; (us) = 0; } while(0)
176#endif
177
182#if !defined SNTP_RETRY_TIMEOUT || defined __DOXYGEN__
183#define SNTP_RETRY_TIMEOUT SNTP_RECV_TIMEOUT
184#endif
185
187#if !defined SNTP_RETRY_TIMEOUT_MAX || defined __DOXYGEN__
188#define SNTP_RETRY_TIMEOUT_MAX (SNTP_RETRY_TIMEOUT * 10)
189#endif
190
194#if !defined SNTP_RETRY_TIMEOUT_EXP || defined __DOXYGEN__
195#define SNTP_RETRY_TIMEOUT_EXP 1
196#endif
197
201#if !defined SNTP_MONITOR_SERVER_REACHABILITY || defined __DOXYGEN__
202#define SNTP_MONITOR_SERVER_REACHABILITY 1
203#endif
204
209#endif /* LWIP_HDR_APPS_SNTP_OPTS_H */