u-blox USB modems (GSM and CDMA)

Dependencies:   CellularUSBModem

Dependents:   C027_CANInterfaceComm C027_ModemTransparentUSBCDC_revb UbloxModemHTTPClientTest C027_HTTPClientTest ... more

Legacy Networking Libray

This is an mbed 2 networking library. For an mbed OS 5 compatible library, please see:

Import libraryC027Interface

Socket interface for C027Interface. Implements the NetworkSocketAPI

Files at this revision

API Documentation at this revision

Comitter:
bogdanm
Date:
Thu Oct 17 16:51:09 2013 +0300
Parent:
2:4be5e62433b1
Child:
4:6e9d98f8c237
Commit message:
Make UbloxUSBGSMModem and UbloxUSBCDMAModem inherit from CellularModem

Changed in this revision

UbloxUSBCDMAModem.h Show annotated file Show diff for this revision Revisions of this file
UbloxUSBGSMModem.h Show annotated file Show diff for this revision Revisions of this file
--- a/UbloxUSBCDMAModem.h	Thu Oct 17 13:53:58 2013 +0300
+++ b/UbloxUSBCDMAModem.h	Thu Oct 17 16:51:09 2013 +0300
@@ -27,10 +27,11 @@
 #include "USBSerialStream.h"
 #include "ip/PPPIPInterface.h"
 #include "sms/CDMASMSInterface.h"
+#include "CellularModem.h"
 
 /** u-blox LISA-C200 modem
  */
-class UbloxUSBCDMAModem
+class UbloxUSBCDMAModem: public CellularModem
 {
 public:
   /** Create Sprint USB Modem (Sierra Wireless 598U) API instance
@@ -44,12 +45,12 @@
   /** Open a 3G internet connection
       @return 0 on success, error code on failure
   */
-  int connect(const char* apn = NULL, const char* user = NULL, const char* password = NULL);
+  virtual int connect(const char* apn = NULL, const char* user = NULL, const char* password = NULL);
 
   /** Close the internet connection
      @return 0 on success, error code on failure
   */
-  int disconnect();
+  virtual int disconnect();
 
 
   /** Send a SM
@@ -57,7 +58,7 @@
      @param message The message to send
      @return 0 on success, error code on failure
    */
-  int sendSM(const char* number, const char* message);
+  virtual int sendSM(const char* number, const char* message);
 
 
   /** Receive a SM
@@ -66,25 +67,25 @@
      @param maxLength Maximum message length that can be stored in buffer (including null-terminating character)
      @return 0 on success, error code on failure
    */
-  int getSM(char* number, char* message, size_t maxLength);
+  virtual int getSM(char* number, char* message, size_t maxLength);
 
   /** Get the number of SMs in the incoming box
      @param pCount pointer to store the number of unprocessed SMs on
      @return 0 on success, error code on failure
    */
-  int getSMCount(size_t* pCount);
+  virtual int getSMCount(size_t* pCount);
 
   /** Get the ATCommandsInterface instance
      @return Pointer to the ATCommandsInterface instance
    */
-  ATCommandsInterface* getATCommandsInterface();
+  virtual 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);
+  virtual int power(bool enable);
 
 protected:
   bool power();
--- a/UbloxUSBGSMModem.h	Thu Oct 17 13:53:58 2013 +0300
+++ b/UbloxUSBGSMModem.h	Thu Oct 17 16:51:09 2013 +0300
@@ -29,10 +29,11 @@
 #include "sms/GSMSMSInterface.h"
 #include "ussd/USSDInterface.h"
 #include "link/LinkMonitor.h"
+#include "CellularModem.h"
 
 /** u-blox WCDMA modem (LISA-U200)
  */
-class UbloxUSBGSMModem
+class UbloxUSBGSMModem: public CellularModem
 {
 public:
   /** Create u-blox API instance
@@ -46,12 +47,12 @@
   /** Open a 3G internet connection
       @return 0 on success, error code on failure
   */
-  int connect(const char* apn = NULL, const char* user = NULL, const char* password = NULL);
+  virtual int connect(const char* apn = NULL, const char* user = NULL, const char* password = NULL);
 
   /** Close the internet connection
      @return 0 on success, error code on failure
   */
-  int disconnect();
+  virtual int disconnect();
 
 
   /** Send a SM
@@ -59,7 +60,7 @@
      @param message The message to send
      @return 0 on success, error code on failure
    */
-  int sendSM(const char* number, const char* message);
+  virtual int sendSM(const char* number, const char* message);
 
 
   /** Receive a SM
@@ -68,13 +69,13 @@
      @param maxLength Maximum message length that can be stored in buffer (including null-terminating character)
      @return 0 on success, error code on failure
    */
-  int getSM(char* number, char* message, size_t maxLength);
+  virtual int getSM(char* number, char* message, size_t maxLength);
 
   /** Get the number of SMs in the incoming box
      @param pCount pointer to store the number of unprocessed SMs on
      @return 0 on success, error code on failure
    */
-  int getSMCount(size_t* pCount);
+  virtual int getSMCount(size_t* pCount);
 
   /** Send a USSD command & wait for its result
     @param command The command to send
@@ -95,14 +96,14 @@
   /** Get the ATCommandsInterface instance
     @return Pointer to the ATCommandsInterface instance
    */
-  ATCommandsInterface* getATCommandsInterface();
+  virtual 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);
+  virtual int power(bool enable);
 
 protected:
   bool power(); //< Turn power to USB dongle ON.