Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Socket USBHostWANDongle lwip-sys lwip
Fork of VodafoneUSBModem by
Diff: VodafoneUSBModem.h
- Revision:
- 26:d37501dc6c61
- Parent:
- 22:06fb2a93a1f6
- Child:
- 27:37d3ac289e86
--- a/VodafoneUSBModem.h Wed Aug 29 15:49:14 2012 +0000
+++ b/VodafoneUSBModem.h Wed Aug 29 16:28:13 2012 +0000
@@ -36,9 +36,9 @@
{
public:
/** Create Vodafone USB Modem (K3770/K3772-Z) dongle API instance
-
+ @param powerGatingPin Optional pin commanding a power gating transistor on the modem's power line
*/
- VodafoneUSBModem();
+ VodafoneUSBModem(PinName powerGatingPin = NC);
//Internet-related functions
@@ -92,11 +92,20 @@
int getLinkState(int* pRssi, LinkMonitor::REGISTRATION_STATE* pRegistrationState, LinkMonitor::BEARER* pBearer);
/** Get the ATCommandsInterface instance
- @return Pointer to the ATCommandsInterface instance
+ @return Pointer to the ATCommandsInterface instance
*/
ATCommandsInterface* getATCommandsInterface();
+
+ /** Switch power on or off
+ In order to use this function, a pin name must have been entered in the constructor
+ @param enable true to switch the dongle on, false to switch it off
+ @return 0 on success, error code on failure
+ */
+ int power(bool enable);
protected:
+ bool power();
+
int init();
private:
@@ -119,6 +128,8 @@
bool m_ussdInit;
bool m_linkMonitorInit;
bool m_atOpen;
+
+ PinName m_powerGatingPin;
};
