modemClient.h
Go to the documentation of this file.
1 
5 #pragma once
6 #include "../../../../LIBRARIES/MIDDLEWARE/src/com/dpyMwClient.h"
7 #include "modemProto.pb.h"
8 #include "modemApiPrivate.h"
9 
13 class ModemClient: public DpyMwClient
14 {
15  std::map<modemProto::WarningNotification_Notif,dpyModem::ModemWarning > mWarningPrototoNotificationmap;
16  std::map<modemProto::SmsEvent_Event,dpyModem::SmsEvent> mSmsProtoToEventmap;
17  std::map<modemProto::CallSourceStatus,dpyModem::CallSourceStatus> mCallSourceStatusProtoToStatusMap;
18 
19  std::map<modemProto::CallStatus,dpyModem::CallStatus> mCallStateProtoToEventmap;
20 
21  std::map<modemProto::SimStatus, dpyModem::SimStatus> mProtoToSimStatusMap;
22  std::map<modemProto::ModemStatus_State,dpyModem::ModemState> mProtoToStateMap;
23  std::map<modemProto::ModemStatus_PowerStatus, dpyModem::ModemPowerStatus> mProtoToPowerStatusMap;
24  std::map<modemProto::ModemStatus_SignalQuality, dpyModem::SignalQuality> mProtoToSignalQualityMap;
25  std::map<modemProto::ModemStatus_NetworkStatus, dpyModem::NetworkStatus > mProtoToCelullarNetworkStatusMap;
26  std::map<modemProto::ModemStatus_AccessTechnology, dpyModem::AccessTechnology > mProtoToAccessTechnologyMap;
27 
28  std::map<dpyModemPrivate::VoiceCallOperation,modemProto::VoiceCallOperation_Type> mVoiceOperationToProtomap;
29  std::map<dpyModemPrivate::VoiceCallConfigParam,modemProto::CallParameters> mCallConfigToProtomap;
30  std::map<dpyModem::NetworkMode,modemProto::NetworkMode> mNetworkModeToProtoMap;
31 
32 
33  void RegisterCallbacks();
34  boost::system::error_code parseModemStatus(const modemProto::ModemStatus& protoStatus, dpyModem::ModemStatus& status);
35 
36 public:
42 
43  };
44 
45  ModemClient(std::string& ip, int dport, int sport);
46  ~ModemClient();
47 
48  void getSmsNotifications_S(dpyModemPrivate::sms_notification_handler_function handler);
49  void getSmsNotifications_U();
50 
51  void getApnByImsi(const std::string& imsi, dpyModem::get_apn_by_imsi_handler_function handler);
52  void performApnOperation(const APN_OPERATION& oper,const std::string& imsi, dpyModem::result_handler_function handler, const dpyModem::AccessPointNetwork& new_apn = {} );
53 
54  //From Deepsy 18.10
55  //From Deepsy 19.04
56  void asyncGetModems(dpyModem::modem_list_handler_function handler);
57  void asyncGetModemInfo(const std::string& modemid, dpyModem::modem_info_handler_function handler);
58  void asyncGetModemStatus(const std::string& modemid, dpyModem::modem_status_handler_function handler);
59  void getModemStatusEvents_S(dpyModem::modem_status_handler_function handler);
60 
61  void getModemListEvents_S(dpyModem::modem_list_event_handler_function handler);
62  void getModemWarningEvents_S(dpyModem::modem_warning_event_handler_function handler);
63  void asyncRequestModemOperation(const std::string& modemid, const dpyModem::ModemOperation& operation, dpyModem::result_handler_function handler);
64 
65  void asyncIsDataConnectionEnabled(const std::string& modemid, dpyModem::modem_data_connection_status_handler_function handler);
66  void asyncGetModemSims(const std::string& modemid, dpyModem::sim_list_handler_function handler);
67  void asyncGetActiveSims(const std::string& modemid, dpyModem::sim_list_handler_function handler);
68  void asyncSwitchCurrentSimCard(const std::string& modemid, dpyModem::result_handler_function handler);
69  void getCurrentSimSlot(const std::string& modemid, dpyModem::sim_slot_handler_function handler);
70 
71  void getSimListEvents_S (dpyModem::sim_list_event_handler_function handler);
72  void getSimStatusEvents_S (dpyModem::simStatus_handler_function handler);
73  void getSimStatusEvents_U();
74  void asyncGetSimInfo(const std::string& simid, dpyModem::sim_info_handler_function handler);
75  void asyncGetSimStatus(const std::string& simid, dpyModem::simStatus_handler_function handler);
76  void asyncGetAllSmsInfo(const std::string& simid, dpyModemPrivate::get_sms_info_handler_function handler);
77  void getSmsEvents_S(dpyModemPrivate::sms_event_handler_function handler);
78  void asyncRequestSmsOperation(const std::string& simid, const dpyModemPrivate::SmsOperation& operation, const std::string& firstParameter, const std::string& secondParameter, dpyModem::result_handler_function handler);
79 
80  void asyncGetCallSourceStatus(const std::string& simid,dpyModemPrivate::call_source_status_handler_function handler);
81  void getCallSourceUpdates_S(dpyModemPrivate::call_source_status_handler_function handler);
82  void getCallSourceUpdates_U();
83  void getVoiceCallEvents_S(dpyModemPrivate::voice_call_event_handler_function handler);
84  void getVoiceCallEvents_U();
85  void asyncRequestVoiceCallOperation(const std::string& simid, const dpyModemPrivate::VoiceCallOperation& operation, const std::string& firstParameter, dpyModem::result_handler_function handler);
86  void asyncGetLastVoiceCallInfo(const std::string& simid, dpyModemPrivate::get_sim_call_info_handler_function handler);
87  void asyncSetVoiceCallConfig(const std::string& modemid, const dpyModemPrivate::VoiceCallConfigParam& param, const std::string& value, dpyModem::result_handler_function handler);
88  void asyncGetVoiceCallConfig(const std::string& modemid, dpyModemPrivate::voice_call_config_handler_function handler);
89  [[deprecated("Do not use the IMSI parameter to configure a forced APN. Forced APN is used for all inserted SIMs")]]
90  void asyncForceCustomApn(const std::string& imsi, dpyModem::result_handler_function handler, const bool& force = false, const dpyModem::AccessPointNetwork& custom_apn = {});
91  void asyncForceCustomApn(dpyModem::result_handler_function handler, const bool& force = false, const dpyModem::AccessPointNetwork& custom_apn = {});
92  void asyncGetInterfaceStatistics(const std::string& modemid, dpyModem::interface_statistics_function_handler handler);
93  void asyncForceNetworkMode(const std::string& modemid, dpyModem::NetworkMode mode,dpyModem::result_handler_function handler);
94  void asyncGetForcedAPN(dpyModem::forced_apn_handler_function handler);
95 
96 };
boost::function< void(boost::system::error_code, std::string simid, dpyModem::SimStatus status)> simStatus_handler_function
Prototype of the handler function for sim status getter and events.
Definition: modemApi.h:129
Defines the status information structure that is obtained after a MODEM STATUS report.
Definition: iModem.h:125
boost::function< void(boost::system::error_code error_code, std::string simid, dpyModem::CallInfo callinfo)> get_sim_call_info_handler_function
Prototype of the handler function used to retrieve call info.
Definition: modemApiPrivate.h:72
boost::function< void(boost::system::error_code &ec, SMS_NOTIFICATION sms_notif, std::vector< int > sms_identifiers)> sms_notification_handler_function
Prototype of the handler function for getSmsNotifications_S method.
Definition: modemApiPrivate.h:70
ModemOperation
Defines the possible operations that can be queried to a modem.
Definition: modemApi.h:42
boost::function< void(boost::system::error_code, std::list< std::string > modems)> modem_list_handler_function
Prototype of the handler function for getting available modems.
Definition: modemApi.h:58
boost::function< void(boost::system::error_code error_code, const std::string &modemId, const std::string &interfaceName, std::map< dpyNetworking::Statistics, uint32_t >statisticsValues, const std::string &interfaceIpAddress)> interface_statistics_function_handler
Prototype of the handler function for asyncGetInterfaceStatistics method.
Definition: modemApi.h:146
boost::function< void(boost::system::error_code, std::string simid, dpyModem::CallStatus event)> voice_call_event_handler_function
Prototype of the handler function used to retrieve call events.
Definition: modemApiPrivate.h:76
NetworkMode
Defines the possible network modes.
Definition: iModem.h:97
boost::function< void(boost::system::error_code, std::string simid, dpyModem::CallSourceStatus callSourceStatus)> call_source_status_handler_function
Prototype of the handler function used to retrieve sim status in terms of calls.
Definition: modemApiPrivate.h:75
boost::function< void(boost::system::error_code error_code, std::string modemid, struct ModemStatus &status)> modem_status_handler_function
Prototype of the handler function for modem status getter and events.
Definition: modemApi.h:73
VoiceCallOperation
Defines the possible sms operations.
Definition: modemApiPrivate.h:25
REMOVE_APN.
Definition: modemClient.h:40
boost::function< void(boost::system::error_code error_code, const std::map< std::string, dpyModem::s_SMSInfo > &smsInfoList)> get_sms_info_handler_function
Prototype of the handler function used to retrieve sms info.
Definition: modemApiPrivate.h:71
boost::function< void(boost::system::error_code, std::string modemid, dpyModem::ModemWarning warning)> modem_warning_event_handler_function
Prototype of the handler function for subscribing to modem warnings.
Definition: modemApi.h:90
VoiceCallConfigParam
Defines the possible voice call configuration parameters.
Definition: modemApiPrivate.h:34
Modem Client class that interacts with the modem Service.
Definition: modemClient.h:13
ADD_APN.
Definition: modemClient.h:39
boost::function< void(boost::system::error_code error_code, dpyModem::AccessPointNetwork found_apn)> forced_apn_handler_function
Prototype of the handler function for get the global forced APN.
Definition: modemApi.h:161
CHANGE_APN.
Definition: modemClient.h:41
boost::function< void(boost::system::error_code, SimInfo siminfo)> sim_info_handler_function
Prototype of the handler function used to get a specific sim information.
Definition: modemApi.h:112
SmsOperation
Defines the possible sms operations.
Definition: modemApiPrivate.h:18
boost::function< void(boost::system::error_code, std::string simid, std::string smsid, dpyModem::SmsEvent event)> sms_event_handler_function
Prototype of the handler function used to retrieve sms events.
Definition: modemApiPrivate.h:74
boost::function< void(boost::system::error_code error_code, std::string modemid, const bool &enabled)> modem_data_connection_status_handler_function
Prototype of the handler function to receive modem data connection status.
Definition: modemApi.h:98
boost::function< void(boost::system::error_code, std::list< std::string > sims)> sim_list_handler_function
Prototype of the handler function for getting available sims.
Definition: modemApi.h:65
Manages dealer and susbriber.
Definition: dpyMwClient.h:59
boost::function< void(boost::system::error_code, std::string modemid, std::map< dpyModemPrivate::VoiceCallConfigParam, std::string > call_param_to_value_map)> voice_call_config_handler_function
Prototype of the handler function used to retrieve the call configuration.
Definition: modemApiPrivate.h:77
boost::function< void(boost::system::error_code error_code, const AccessPointNetwork &apn_info)> get_apn_by_imsi_handler_function
Prototype of the handler function for obtaining apn information (getCurrentApn or getApnByImsi method...
Definition: modemApi.h:143
boost::function< void(boost::system::error_code, std::string modemid, std::string simid, ListEvent event)> sim_list_event_handler_function
Prototype of the handler function for subscribing to list events.
Definition: modemApi.h:121
APN_OPERATION
Types of APN operations as used in performApnOperation method.
Definition: modemClient.h:38
boost::function< void(boost::system::error_code error_code, std::string modemid, int simSlot)> sim_slot_handler_function
Prototype of the handler function for get the current sim slot.
Definition: modemApi.h:154
Definition: iSim.h:40
boost::function< void(boost::system::error_code, ModemInfo modeminfo)> modem_info_handler_function
Prototype of the handler function used to get a specific modem information.
Definition: modemApi.h:105
boost::function< void(boost::system::error_code, std::string modemid, ListEvent event)> modem_list_event_handler_function
Prototype of the handler function for subscribing to list events.
Definition: modemApi.h:82
boost::function< void(boost::system::error_code error_code)> result_handler_function
Prototype of the handler function for obtaining result of the different operations.
Definition: modemApi.h:144