test code for our MBED board

Dependencies:   mbed lwip

Committer:
lolpcc
Date:
Wed May 04 08:30:52 2011 +0000
Revision:
1:6877bb99aa17

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lolpcc 1:6877bb99aa17 1 #ifndef SNTPCLIENT_H
lolpcc 1:6877bb99aa17 2 #define SNTPCLIENT_H
lolpcc 1:6877bb99aa17 3
lolpcc 1:6877bb99aa17 4 typedef enum {DST_START, DST_STOP} tDST_START;
lolpcc 1:6877bb99aa17 5
lolpcc 1:6877bb99aa17 6 typedef struct DST_POINT {
lolpcc 1:6877bb99aa17 7 time_t t; // Point in time when DST switch happens (in localtime)
lolpcc 1:6877bb99aa17 8 signed int dst; // Active DST value (for gSntpDST)
lolpcc 1:6877bb99aa17 9 signed int dstshift; // DST shift value (regardless if it is active or not)
lolpcc 1:6877bb99aa17 10 } tDstPoint;
lolpcc 1:6877bb99aa17 11
lolpcc 1:6877bb99aa17 12 typedef tDstPoint (*pFncDstCalc)(int tz, int year, tDST_START start);
lolpcc 1:6877bb99aa17 13 typedef enum {
lolpcc 1:6877bb99aa17 14 #define _(z, fnc, gmt, dst, hr1,wk1,wday1,mon1, hr2,wk2,wday2,mon2) z,
lolpcc 1:6877bb99aa17 15 #include "DstZones.h"
lolpcc 1:6877bb99aa17 16 DST_LAST // LAST ITEM IN ENUM
lolpcc 1:6877bb99aa17 17 } tDST_ZONE;
lolpcc 1:6877bb99aa17 18
lolpcc 1:6877bb99aa17 19
lolpcc 1:6877bb99aa17 20 void SNTPSetDstZone(tDST_ZONE zone, bool adjust_clock=false);
lolpcc 1:6877bb99aa17 21 const char *SNTPDstZoneName(tDST_ZONE zone);
lolpcc 1:6877bb99aa17 22 void SNTPSetRecvTimeout(unsigned int val_s);
lolpcc 1:6877bb99aa17 23 void SNTPSetUpdateDelay(unsigned int val_s);
lolpcc 1:6877bb99aa17 24 void SNTPSetTimezone(float hours_from_utc, bool adjust_clock=false);
lolpcc 1:6877bb99aa17 25 void SNTPSetDST(float hours_from_utc, bool adjust_clock=false);
lolpcc 1:6877bb99aa17 26 int SNTPSetAddresses(const char* server_addresses[], int count, void (*p_free)(void*));
lolpcc 1:6877bb99aa17 27 int SNTPReadIniFile(const char* filename);
lolpcc 1:6877bb99aa17 28 void SNTPWriteIniFile(FILE * f);
lolpcc 1:6877bb99aa17 29 void SNTPClientInit(void);
lolpcc 1:6877bb99aa17 30 time_t SNTPTime(void);
lolpcc 1:6877bb99aa17 31 void SNTPSetTime(time_t seconds);
lolpcc 1:6877bb99aa17 32 time_t SNTPTimeUTC(void);
lolpcc 1:6877bb99aa17 33 void SNTPSetTimeUTC(time_t seconds);
lolpcc 1:6877bb99aa17 34 #endif // SNTPCLIENT_H
lolpcc 1:6877bb99aa17 35 //END