USB Host Library for Sprint Dongles
Dependencies: Socket USBHostWANDongleSprint lwip-sys lwip
Dependents: SprintUSBModemWebsocketTest SprintUSBModemHTTPClientTest SprintUSBModemNTPClientTest SprintUSBModemSMSTest ... more
Fork of SprintUSBModem_bleedingedge by
Diff: SprintUSBModem.h
- Revision:
- 2:f4d9c4ea17f9
- Parent:
- 0:8f57713b2147
- Child:
- 4:23100b0757d6
--- a/SprintUSBModem.h Wed Sep 12 09:46:58 2012 +0000 +++ b/SprintUSBModem.h Wed Sep 26 07:08:18 2012 +0000 @@ -34,9 +34,10 @@ { public: /** Create Sprint USB Modem (Sierra Wireless 598U) API instance - + @param powerGatingPin Optional pin commanding a power gating transistor on the modem's power line + @param powerGatingOnWhenPinHigh true if the pin needs to be high to power the dongle, defaults to true */ - SprintUSBModem(); + SprintUSBModem(PinName powerGatingPin = NC, bool powerGatingOnWhenPinHigh = true); //Internet-related functions @@ -78,8 +79,18 @@ */ 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(); + int cleanup(); private: WANDongle m_dongle; @@ -97,6 +108,9 @@ bool m_ipInit; bool m_smsInit; bool m_atOpen; + + PinName m_powerGatingPin; + bool m_powerGatingOnWhenPinHigh; };