u-blox USB modems (GSM and CDMA)
Dependencies: CellularUSBModem
Dependents: C027_CANInterfaceComm C027_ModemTransparentUSBCDC_revb UbloxModemHTTPClientTest C027_HTTPClientTest ... more
UbloxUSBGSMModem Class Reference
u-blox WCDMA modem (LISA-U200) More...
#include <UbloxUSBGSMModem.h>
Public Member Functions | |
UbloxUSBGSMModem (PinName powerGatingPin=NC, bool powerGatingOnWhenPinHigh=true) | |
Create u-blox API instance. | |
virtual int | connect (const char *apn=NULL, const char *user=NULL, const char *password=NULL) |
Open a 3G internet connection. | |
virtual int | disconnect () |
Close the internet connection. | |
virtual int | sendSM (const char *number, const char *message) |
Send a SM. | |
virtual int | getSM (char *number, char *message, size_t maxLength) |
Receive a SM. | |
virtual int | getSMCount (size_t *pCount) |
Get the number of SMs in the incoming box. | |
int | sendUSSD (const char *command, char *result, size_t maxLength) |
Send a USSD command & wait for its result. | |
int | getLinkState (int *pRssi, LinkMonitor::REGISTRATION_STATE *pRegistrationState, LinkMonitor::BEARER *pBearer) |
Get link state. | |
virtual ATCommandsInterface * | getATCommandsInterface () |
Get the ATCommandsInterface instance. | |
virtual int | power (bool enable) |
Switch power on or off In order to use this function, a pin name must have been entered in the constructor. | |
Protected Member Functions | |
int | init () |
Initialise dongle. | |
int | cleanup () |
De-initialise dongle. |
Detailed Description
u-blox WCDMA modem (LISA-U200)
Definition at line 36 of file UbloxUSBGSMModem.h.
Constructor & Destructor Documentation
UbloxUSBGSMModem | ( | PinName | powerGatingPin = NC , |
bool | powerGatingOnWhenPinHigh = true |
||
) |
Create u-blox API instance.
- Parameters:
-
powerGatingPin Optional pin commanding a power gating transistor on the modem's power line powerGatingOnWhenPinHigh true if the pin needs to be high to power the dongle, defaults to true
Definition at line 31 of file UbloxUSBGSMModem.cpp.
Member Function Documentation
int cleanup | ( | ) | [protected] |
De-initialise dongle.
The following actions are performed: 1) Tear down PPP session 2) Set SMS,USSD, and LinkMonitor subsystems to un-initialised 3) Close the AT commands interface 4) Tear down the USB connection to dongle
Definition at line 581 of file UbloxUSBGSMModem.cpp.
int connect | ( | const char * | apn = NULL , |
const char * | user = NULL , |
||
const char * | password = NULL |
||
) | [virtual] |
Open a 3G internet connection.
- Returns:
- 0 on success, error code on failure
Definition at line 181 of file UbloxUSBGSMModem.cpp.
int disconnect | ( | ) | [virtual] |
Close the internet connection.
- Returns:
- 0 on success, error code on failure
Definition at line 280 of file UbloxUSBGSMModem.cpp.
ATCommandsInterface * getATCommandsInterface | ( | ) | [virtual] |
Get the ATCommandsInterface instance.
- Returns:
- Pointer to the ATCommandsInterface instance
Definition at line 475 of file UbloxUSBGSMModem.cpp.
int getLinkState | ( | int * | pRssi, |
LinkMonitor::REGISTRATION_STATE * | pRegistrationState, | ||
LinkMonitor::BEARER * | pBearer | ||
) |
Get link state.
- Parameters:
-
pRssi pointer to store the current RSSI in dBm, between -51 dBm and -113 dBm if known; -51 dBm means -51 dBm or more; -113 dBm means -113 dBm or less; 0 if unknown pRegistrationState pointer to store the current registration state pBearer pointer to store the current bearer
- Returns:
- 0 on success, error code on failure
Definition at line 447 of file UbloxUSBGSMModem.cpp.
int getSM | ( | char * | number, |
char * | message, | ||
size_t | maxLength | ||
) | [virtual] |
Receive a SM.
- Parameters:
-
number Pointer to a buffer to store the sender's phone number (must be at least 17 characters-long, including the sapce for the null-terminating char) message Pointer to a buffer to store the the incoming message maxLength Maximum message length that can be stored in buffer (including null-terminating character)
- Returns:
- 0 on success, error code on failure
Definition at line 366 of file UbloxUSBGSMModem.cpp.
int getSMCount | ( | size_t * | pCount ) | [virtual] |
Get the number of SMs in the incoming box.
- Parameters:
-
pCount pointer to store the number of unprocessed SMs on
- Returns:
- 0 on success, error code on failure
Definition at line 393 of file UbloxUSBGSMModem.cpp.
int init | ( | ) | [protected] |
Initialise dongle.
The following actions are performed: 1) Power up 2) Establish USB connection to dongle 3) Start AT interface thread 4) Wait for network registration
Definition at line 509 of file UbloxUSBGSMModem.cpp.
int power | ( | bool | enable ) | [virtual] |
Switch power on or off In order to use this function, a pin name must have been entered in the constructor.
- Parameters:
-
enable true to switch the dongle on, false to switch it off
- Returns:
- 0 on success, error code on failure
Definition at line 480 of file UbloxUSBGSMModem.cpp.
int sendSM | ( | const char * | number, |
const char * | message | ||
) | [virtual] |
Send a SM.
- Parameters:
-
number The receiver's phone number message The message to send
- Returns:
- 0 on success, error code on failure
Definition at line 339 of file UbloxUSBGSMModem.cpp.
int sendUSSD | ( | const char * | command, |
char * | result, | ||
size_t | maxLength | ||
) |
Send a USSD command & wait for its result.
- Parameters:
-
command The command to send result Buffer in which to store the result maxLength Maximum result length that can be stored in buffer (including null-terminating character)
- Returns:
- 0 on success, error code on failure
Definition at line 420 of file UbloxUSBGSMModem.cpp.
Generated on Tue Jul 12 2022 19:17:01 by 1.7.2