smsSourceList.h
1 #pragma once
2 
3 #include "../../../../../SERVICES/MODEM/api/src/modemApiPrivate.h"
4 
5 #include <boost/shared_ptr.hpp>
6 #include <boost/make_shared.hpp>
7 
8 #include "iSmsSourceList.h"
9 
10 class SmsServer;
16 class SmsSourceList: public ISmsSourceList, public SmsSourceObserver
17 {
18 private:
19 
20  SmsServer* mServer;
21  boost::asio::io_service& mIo;
22  std::map<std::string, boost::shared_ptr<ISmsSource>> mIdToSmsSourceMap;
23  ModemManagerPrivate mModemManager;
24  std::vector<ISmsSourceList*> observersDeviceListObserver;
25 
26  void retrieveSmsSources();
27 
28  //Modem handlers
29  void modemAvailabilityHandler(bool available);
30  void modemListHandler(boost::system::error_code ec, std::list<std::string> modems);
31  void processModemSimListEvent(boost::system::error_code ec, std::string modemid, std::string simid, dpyModem::ListEvent event);
32  //TODO: void processModemSmsEvent(boost::system::error_code ec, std::string simid, std::string smsid, dpyModem::SmsEvent event);
33  void updateSourceStatus(const std::string& sourceid, const dpySms::SourceStatus& status);
34  void createSim(const std::string& id,const std::string& modemid );
35  void deleteSim(const std::string& id);
36 
37  //Inherited from Sms observers
38  //TODO:void updateSourceStatus(const std::string& sourceid, const dpySms::SourceStatus& status);
39  void smsEvent(const std::string& smsid,const std::string& sourceid, const dpySms::SmsNotifications& event);
40  boost::system::error_code getSourceId(const std::string& smsid,std::string& sourceid );
41 
42 public:
43  SmsSourceList(boost::asio::io_service& io,SmsServer* server);
44  virtual ~SmsSourceList();
45 
46  boost::system::error_code getSmsSources(std::list<boost::shared_ptr<ISmsSource>>& list);
47  boost::system::error_code getSmsSource(const std::string& sourceid, boost::shared_ptr<ISmsSource>& source);
48  boost::system::error_code getSmsInfo(const std::string& smsid, dpySms::SmsInformation& info);
49  std::list<boost::shared_ptr<ISms>> getSmsList() const;
50  boost::system::error_code sendSms(const std::string& sourceid, const std::string& destination, const std::string& content, std::string& smsid);
51  boost::system::error_code deleteSms(const std::string& smsid);
52 
53 };
SourceStatus
Source Status.
Definition: iVoiceCallSource.h:18
Manages router and publisher.
Definition: smsServer.h:18
ListEvent
Definition: iModem.h:15
A class that keeps track of the sms sources and makes them available through the execution of the pro...
Definition: smsSourceList.h:16
Allows to interact with a modem from inside the Deepsy.
Definition: modemApiPrivate.h:88