Interacts with RTC service.

#include <rtcClient.h>

Inheritance diagram for RtcClient:

Public Types

enum  SOURCE_OPERATION { ADD_SOURCE, REMOVE_SOURCE, CHANGE_SOURCE }
 < Types of DATE operations More...
 

Public Member Functions

 RtcClient (std::string &ip, int dport, int sport)
 Constructor of the class. More...
 
 ~RtcClient ()
 Destructor of the class.
 
void asyncSetSyncTime (std::uint32_t time_s, dpyRtc::result_handler handler)
 Method to set synchronism time period in seconds. More...
 
void asyncSetDiffTime (std::uint32_t time_s, dpyRtc::result_handler handler)
 Method to set maximum time in seconds allowed to RTC to be drifted from UTC valid time. More...
 
void asyncGetConfigValues (dpyRtc::params_handler handler)
 Method to get configuration parameters coming from RTC service. More...
 
void asyncGetDateTime (dpyRtc::time_and_date_handler handler)
 Method to get date and time coming from RTC service. More...
 
void asyncGetDateTime (dpyRtc::time_date_set_handler handler)
 Method to get date and time coming from RTC service. More...
 
void asyncGetSources (dpyRtc::sources_list_handler handler)
 Method used to get a sources list. More...
 
void performDateSourceOperation (const SOURCE_OPERATION oper, const std::string &source_name, const dpyRtc::DateSources &source, dpyRtc::result_handler handler)
 Method used to perform different date source operations. More...
 
- Public Member Functions inherited from DpyMwClient
 DpyMwClient (std::string &ip, int dport, int sport)
 
void start ()
 
void stop ()
 
void subscribe (int messageType, boost::any handler)
 
void unsubscribe (int messageType)
 
bool isAlive ()
 
void monitorServiceAvailability_S (const f_hearbeat_handler &handler)
 
void monitorServiceAvailability_U ()
 

Additional Inherited Members

- Protected Member Functions inherited from DpyMwClient
void sendRequest (int requestType, int responseType, std::string content, boost::any handler, int ms_timeout=2000)
 
- Protected Attributes inherited from DpyMwClient
map_proto_register_client m_register_map
 
std::mutex m_map_mutex
 

Member Enumeration Documentation

Enumerator
ADD_SOURCE 

ADD_SOURCE.

REMOVE_SOURCE 

REMOVE_SOURCE.

CHANGE_SOURCE 

CHANGE_SOURCE.

Constructor & Destructor Documentation

RtcClient ( std::string &  ip,
int  dport,
int  sport 
)
Parameters
ipIP address to be binded to the client
dportPort to use by dealer
sportto use by subscriber

Member Function Documentation

void asyncGetConfigValues ( dpyRtc::params_handler  handler)
Parameters
handlerHandler used to get response
void asyncGetDateTime ( dpyRtc::time_and_date_handler  handler)
Parameters
handlerHandler used to get response
void asyncGetDateTime ( dpyRtc::time_date_set_handler  handler)
Parameters
handlerHandler used to get response
void asyncGetSources ( dpyRtc::sources_list_handler  handler)
Parameters
handlerHandler to be called when a response comes from the service
void asyncSetDiffTime ( std::uint32_t  time_s,
dpyRtc::result_handler  handler 
)
Parameters
time_sTime provided in seconds
handlerHandler used to get response
void asyncSetSyncTime ( std::uint32_t  time_s,
dpyRtc::result_handler  handler 
)
Parameters
time_sTime provided in seconds
handlerHandler used to get response
void performDateSourceOperation ( const SOURCE_OPERATION  oper,
const std::string &  source_name,
const dpyRtc::DateSources source,
dpyRtc::result_handler  handler 
)
Parameters
opertype of operation
source_namesource name that will be used for the operation
sourcedate source that will be passed depending on the operation
handleris the function that will be called when the response to the command arrives