rtcClient.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include "../../../../LIBRARIES/MIDDLEWARE/src/com/dpyMwClient.h"
9 #include "../../common/include/dateSourceTypes.h"
10 #include "rtcApi.h"
11 
16 class RtcClient: public DpyMwClient
17 {
18 private:
22  void RegisterCallbacks();
23 
24 public:
30  };
37  RtcClient(std::string& ip, int dport, int sport);
38 
42  ~RtcClient();
43 
49  void asyncSetSyncTime(std::uint32_t time_s, dpyRtc::result_handler handler);
50 
56  void asyncSetDiffTime(std::uint32_t time_s, dpyRtc::result_handler handler);
57 
63 
69 
75 
81 
89  void performDateSourceOperation(const SOURCE_OPERATION oper, const std::string& source_name, const dpyRtc::DateSources& source, dpyRtc::result_handler handler);
90 };
Interacts with RTC service.
Definition: rtcClient.h:16
Definition: dateSourceTypes.h:28
boost::function< void(boost::system::error_code &ec, struct tm date_and_time)> time_and_date_handler
Handler for result function callback. This type of function is called when the status callback is don...
Definition: rtcApi.h:54
REMOVE_SOURCE.
Definition: rtcClient.h:28
SOURCE_OPERATION
< Types of DATE operations
Definition: rtcClient.h:26
RtcClient(std::string &ip, int dport, int sport)
Constructor of the class.
boost::function< void(boost::system::error_code &ec, struct tm date_and_time, struct tm last_set_date_and_time)> time_date_set_handler
Handler for result function callback. This type of function is called when the status callback is don...
Definition: rtcApi.h:62
boost::function< void(boost::system::error_code &ec, dpyRtc::ParamConfig &)> params_handler
Handler for result function callback. This type of function is called when the status callback is don...
Definition: rtcApi.h:46
CHANGE_SOURCE.
Definition: rtcClient.h:29
void asyncSetSyncTime(std::uint32_t time_s, dpyRtc::result_handler handler)
Method to set synchronism time period in seconds.
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...
ADD_SOURCE.
Definition: rtcClient.h:27
void asyncGetSources(dpyRtc::sources_list_handler handler)
Method used to get a sources list.
Manages dealer and susbriber.
Definition: dpyMwClient.h:59
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.
boost::function< void(boost::system::error_code &ec)> result_handler
Handler for result function callback. This type of function is called when the status callback is don...
Definition: rtcApi.h:39
boost::function< void(boost::system::error_code &ec, std::map< std::string, dpyRtc::DateSources > sourceList)> sources_list_handler
Prototype of the handler function for getting sources list.
Definition: rtcApi.h:69
~RtcClient()
Destructor of the class.
void asyncGetConfigValues(dpyRtc::params_handler handler)
Method to get configuration parameters coming from RTC service.
void asyncGetDateTime(dpyRtc::time_and_date_handler handler)
Method to get date and time coming from RTC service.