smsClient.h
Go to the documentation of this file.
1 
4 #pragma once
5 #include "../../../../LIBRARIES/MIDDLEWARE/src/com/dpyMwClient.h"
6 #include "smsApi.h"
7 #include "smsProto.pb.h"
8 
13 class SmsClient: public DpyMwClient
14 {
15 
16 private:
17  void RegisterCallbacks();
18  std::map<smsProto::SmsEvent_SmsEventType, dpySms::SmsNotifications> mSmsPrototoNotificationmap;
19  std::map<smsProto::InfoElement_Dir,dpySms::SmsDirection> mDirectionProtoToSmsDirectionmap;
20 
21  boost::system::error_code buildSmsInfo(smsProto::InfoElement* protoinfoptr, dpySms::SmsInformation& info);
22 
23 public:
24  SmsClient(std::string& ip, int dport, int sport);
25  ~SmsClient();
26 
27  void asyncGetSmsSources(dpySms::sms_sources_list_handler_function handler);
28  void smsSourceListEvent_S(dpySms::source_list_event_handler_function handler);
29 
30  void getSmsNotifications_S(dpySms::sms_notif_handler handler);
31  void getSmsNotifications_U();
32  void monitorSourcesStatusEvents_S(dpySms::source_status_handler_function handler);
33  void monitorSourcesStatusEvents_U();
34  void asyncGetSmsSourceStatus(std::string sourceid, dpySms::source_status_handler_function handler);
35  void asyncGetSmsInfo(const std::string& smsid, dpySms::sms_info_handler handler);
36  void asyncGetSmsList(dpySms::sms_list_handler handler);
37  void asyncSendSms(const std::string& sourceid,const std::string& content, const std::string& destination, dpySms::send_sms_handler_function handler);
38  void asyncDeleteSms(const std::string& smsid, dpySms::result_handler_function handler);
39 
40 };
boost::function< void(boost::system::error_code, std::list< std::string > sources)> sms_sources_list_handler_function
Prototype of the handler function for getting available sms sources.
Definition: smsApi.h:28
boost::function< void(boost::system::error_code &error_code)> result_handler_function
Prototype of the handler function to obtain a single SMS.
Definition: smsApi.h:49
boost::function< void(boost::system::error_code &ec, std::map< std::string, dpySms::SmsInformation > &smsList)> sms_list_handler
Prototype of the handler function to obtain SMS list.
Definition: smsApi.h:48
Allows to interact with the SMS service.
Definition: smsClient.h:13
boost::function< void(boost::system::error_code, std::string sourceid, ListEvent event)> source_list_event_handler_function
Prototype of the handler function for subscribing to list events.
Definition: smsApi.h:36
boost::function< void(boost::system::error_code &error_code, const std::string &smsid, const dpySms::SmsInformation &smsinfo)> sms_info_handler
Prototype of the handler function to obtain a single SMS.
Definition: smsApi.h:46
boost::function< void(boost::system::error_code, std::string smssourceid, SourceStatus event)> source_status_handler_function
Prototype of the handler function for subscribing to source status events.
Definition: smsApi.h:65
Manages dealer and susbriber.
Definition: dpyMwClient.h:59
boost::function< void(boost::system::error_code &error_code, const std::string &smsid)> send_sms_handler_function
Callback handler used when sending sms.
Definition: smsApi.h:57
boost::function< void(boost::system::error_code &ec, dpySms::SmsNotifications notif, const std::string &sms_identifier, const std::string &sms_source)> sms_notif_handler
Prototype of the handler function for SMS notifications method.
Definition: smsApi.h:44