Modularizando o src
Dependencies: EALib EthernetInterface_vz mbed-rtos mbed
Fork of header_main_colinas_V0-20-09-14 by
clock.h@120:770f00554b1e, 2015-05-04 (annotated)
- Committer:
- klauss
- Date:
- Mon May 04 17:25:29 2015 +0000
- Revision:
- 120:770f00554b1e
- Parent:
- 119:ee6a53069455
- Child:
- 121:ee02790d00b7
clock request to server XXX port 123
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
klauss | 119:ee6a53069455 | 1 | #ifndef __CLOCK_H__ |
klauss | 119:ee6a53069455 | 2 | #define __CLOCK_H__ |
klauss | 119:ee6a53069455 | 3 | |
klauss | 119:ee6a53069455 | 4 | #include <stdlib.h> |
klauss | 119:ee6a53069455 | 5 | #include <stdint.h> |
klauss | 119:ee6a53069455 | 6 | #include <string.h> |
klauss | 119:ee6a53069455 | 7 | #include "mbed.h" |
klauss | 119:ee6a53069455 | 8 | #include "EthernetInterface.h" |
klauss | 119:ee6a53069455 | 9 | #include "debug.h" |
klauss | 120:770f00554b1e | 10 | |
klauss | 120:770f00554b1e | 11 | const uint16_t EXTERNAL_TIME_REQUEST_WAIT_SECONDS = 300; |
klauss | 120:770f00554b1e | 12 | |
klauss | 120:770f00554b1e | 13 | const int TIME_MSG_SIZE = 64; |
klauss | 120:770f00554b1e | 14 | |
klauss | 120:770f00554b1e | 15 | const char CLOCK_SERVER_IP[] = "192.168.120.120"; |
klauss | 120:770f00554b1e | 16 | |
klauss | 120:770f00554b1e | 17 | const int CLOCK_SERVER_PORT = 123; |
klauss | 119:ee6a53069455 | 18 | |
klauss | 119:ee6a53069455 | 19 | extern time_t current_time; |
klauss | 119:ee6a53069455 | 20 | |
klauss | 119:ee6a53069455 | 21 | extern UDPSocket clock_sock; |
klauss | 119:ee6a53069455 | 22 | |
klauss | 119:ee6a53069455 | 23 | extern Endpoint clock_server; |
klauss | 119:ee6a53069455 | 24 | |
klauss | 119:ee6a53069455 | 25 | extern Timer external_time; |
klauss | 119:ee6a53069455 | 26 | |
klauss | 119:ee6a53069455 | 27 | int request_clock_to_server( void ); |
klauss | 119:ee6a53069455 | 28 | |
klauss | 119:ee6a53069455 | 29 | int check_clock( void ); |
klauss | 119:ee6a53069455 | 30 | |
klauss | 119:ee6a53069455 | 31 | int update_clock( void ); |
klauss | 119:ee6a53069455 | 32 | |
klauss | 119:ee6a53069455 | 33 | int init_clock ( void ); |
klauss | 119:ee6a53069455 | 34 | |
klauss | 119:ee6a53069455 | 35 | int clock_sock_reconnect ( void ); |
klauss | 119:ee6a53069455 | 36 | |
klauss | 119:ee6a53069455 | 37 | void print_clock ( uint8_t * buffer ); |
klauss | 119:ee6a53069455 | 38 | |
klauss | 119:ee6a53069455 | 39 | int show_clock ( void ); |
klauss | 120:770f00554b1e | 40 | |
klauss | 119:ee6a53069455 | 41 | #endif |