IModem Class Referenceabstract
Modem interface class.
#include <iModem.h>
Public Member Functions | |
virtual | ~IModem () |
Destructor. | |
std::string | getId () const |
Retrieve the modem ID. More... | |
virtual boost::system::error_code | getModemInfo (dpyModem::ModemInfo &info) const =0 |
Retrieve modem related information. More... | |
virtual boost::system::error_code | getCurrentSim (boost::shared_ptr< ISim > &sim) const =0 |
Retrieve current sim object being used. More... | |
virtual boost::system::error_code | getSims (std::list< boost::shared_ptr< ISim >> &list) const =0 |
Retrieve available sims for this modem. More... | |
virtual bool | isSimActive (const std::string &simId) const =0 |
Obtain the status of a sim in terms of active/inactive. More... | |
virtual boost::system::error_code | getActiveSims (std::list< boost::shared_ptr< ISim >> &list) const =0 |
Retrieve active sims for this modem. More... | |
virtual boost::system::error_code | getSimById (const std::string &simid, boost::shared_ptr< ISim > &sim) const =0 |
Retrieve a specific sim by specifying its id. More... | |
virtual boost::system::error_code | getStatus (dpyModem::ModemStatus &status)=0 |
Obtain current modem status, a structure composed by different parameters. More... | |
virtual bool | enableModem (boost::system::error_code &ec)=0 |
Enable the modem. More... | |
virtual bool | disableModem (boost::system::error_code &ec)=0 |
Disable the modem. More... | |
virtual bool | sleepModem (boost::system::error_code &ec)=0 |
Sleep the modem. More... | |
virtual bool | softwareRestartModem (boost::system::error_code &ec)=0 |
Perform a software restart of the modem. More... | |
virtual bool | hardwareRestartModem (boost::system::error_code &ec)=0 |
Perform a hardware restart of the modem. More... | |
virtual boost::system::error_code | enableDataConnection ()=0 |
Sets the modem data connection flag to true and, therefore, the modem will try to provide data connectivity. More... | |
virtual boost::system::error_code | disableDataConnection ()=0 |
Disables data connections performed with the modem, therefore, the modem will not try to use the data network. More... | |
virtual bool | isDataConnectionEnabled ()=0 |
Returns the status of the data connection flag, which informs the user if the data connection is enabled , allowing data connections, or disabled. More... | |
virtual boost::system::error_code | forceNetworkMode (const dpyModem::NetworkMode &mode)=0 |
Force a specific Network Mode to work with. More... | |
boost::system::error_code | subscribe (ModemObserver *observer) |
Subscribe to the different modem events. More... | |
boost::system::error_code | unsubscribe (ModemObserver *observer) |
Unsubscribe from the different modem events. More... | |
Protected Member Functions | |
void | setId (const std::string &id) |
void | notifyModemStateUpdate (const std::string &modemid, const dpyModem::ModemState &status) |
void | notifyModemWarningEvent (const std::string &modemid, const dpyModem::ModemWarning &warning) |
void | notifySimListEvent (const std::string &modemid, const std::string &simid, const dpyModem::ListEvent &event) |
void | notifySimStatusUpdate (const std::string &simid, const dpyModem::SimStatus &status) |
Protected Attributes | |
std::map< std::string, boost::shared_ptr< ISim > > | mIdToSimMap |
Associates modem ids with the sim objects. | |
Member Function Documentation
|
pure virtual |
- Returns
- DPY_OK if the operation was performed, DPY_NO_EFFECT if the connection was already disabled
|
pure virtual |
- Parameters
-
ec error code
- Returns
- true if the operation could be performed, false otherwise
|
pure virtual |
- Remarks
- Modem data connection is enabled by default
- Returns
- DPY_OK if the operation was performed, DPY_NO_EFFECT if the connection was already disabled
|
pure virtual |
- Parameters
-
ec error code
- Returns
- true if the operation could be performed, false otherwise
|
pure virtual |
- Parameters
-
mode network mode to be set, select ANY so that the best one is selected automatically.
- Returns
- error code
|
pure virtual |
- Parameters
-
list list of active sims
- Returns
- error code
|
pure virtual |
- Parameters
-
sim current sim
- Returns
- error code
std::string getId | ( | ) | const |
- Returns
- modem ID
|
pure virtual |
- Parameters
-
info structure to be filled with the modem information
- Returns
- error code
|
pure virtual |
- Parameters
-
simid id to be retrieved sim resultant sim object with the specified id
- Returns
- error code
|
pure virtual |
- Parameters
-
list list of sims
- Returns
- error code
|
pure virtual |
- Parameters
-
status modem status
- Returns
- error code
|
pure virtual |
- Remarks
- Do not use this method unless it is strictly necessary, use IModem::softwareRestartModem instead
- Parameters
-
ec error code
- Returns
- true if the operation could be performed, false otherwise
|
pure virtual |
- Returns
- true if it is enabled, false if disabled
|
pure virtual |
- Parameters
-
simId sim whose activity status wants to be retrieved
- Returns
- true if the specified sim is active on this modem
|
pure virtual |
- Remarks
- In sleep mode, the modem does not perform data connections and voice calls or SMS are not available from the user side. However, it may be able to wake up the system by making voice calls or sending SMS to the device.
- Parameters
-
ec error code
- Returns
- true if the operation could be performed, false otherwise
|
pure virtual |
- Parameters
-
ec error code
- Returns
- true if the operation could be performed, false otherwise
boost::system::error_code subscribe | ( | ModemObserver * | observer | ) |
- Parameters
-
observer object to subscribe
- Returns
- error code
boost::system::error_code unsubscribe | ( | ModemObserver * | observer | ) |
- Parameters
-
observer object to unsubscribe
- Returns
- error code