Modularizando o src

Dependencies:   EALib EthernetInterface_vz mbed-rtos mbed

Fork of header_main_colinas_V0-20-09-14 by VZTECH

clock.h

Committer:
klauss
Date:
2015-05-04
Revision:
120:770f00554b1e
Parent:
119:ee6a53069455
Child:
121:ee02790d00b7

File content as of revision 120:770f00554b1e:

#ifndef __CLOCK_H__
#define __CLOCK_H__

#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include "mbed.h"
#include "EthernetInterface.h"
#include "debug.h"

const uint16_t EXTERNAL_TIME_REQUEST_WAIT_SECONDS = 300;

const int TIME_MSG_SIZE = 64;

const char CLOCK_SERVER_IP[] = "192.168.120.120";

const int CLOCK_SERVER_PORT = 123;

extern time_t current_time;

extern UDPSocket clock_sock;

extern Endpoint clock_server;

extern Timer external_time;

int request_clock_to_server( void );

int check_clock( void );

int update_clock( void );

int init_clock ( void );

int clock_sock_reconnect ( void );

void print_clock ( uint8_t * buffer );

int show_clock ( void );

#endif