Simple test for USSD message.

Dependencies:   CellularUSBModem

Dependents:   C027_USSDTest

Fork of UbloxUSBModem by mbed official

Embed: (wiki syntax)

« Back to documentation index

UbloxModem Class Reference

u-blox WCDMA modem (LISA-U200) More...

#include <UbloxModem.h>

Inherited by UbloxSerModem, and UbloxUSBModem.

Public Member Functions

 UbloxModem (IOStream *atStream, IOStream *pppStream)
 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.

Protected Member Functions

virtual int init ()
 Initialise dongle.
virtual int cleanup ()
 De-initialise dongle.

Detailed Description

u-blox WCDMA modem (LISA-U200)

Definition at line 35 of file UbloxModem.h.


Constructor & Destructor Documentation

UbloxModem ( IOStream *  atStream,
IOStream *  pppStream 
)

Create u-blox API instance.

Parameters:
powerGatingPinOptional pin commanding a power gating transistor on the modem's power line
powerGatingOnWhenPinHightrue if the pin needs to be high to power the dongle, defaults to true

Definition at line 31 of file UbloxModem.cpp.


Member Function Documentation

int cleanup (  ) [protected, virtual]

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

Definition at line 382 of file UbloxModem.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 126 of file UbloxModem.cpp.

int disconnect (  ) [virtual]

Close the internet connection.

Returns:
0 on success, error code on failure

Definition at line 184 of file UbloxModem.cpp.

ATCommandsInterface * getATCommandsInterface (  ) [virtual]

Get the ATCommandsInterface instance.

Returns:
Pointer to the ATCommandsInterface instance

Definition at line 315 of file UbloxModem.cpp.

int getLinkState ( int *  pRssi,
LinkMonitor::REGISTRATION_STATE *  pRegistrationState,
LinkMonitor::BEARER *  pBearer 
)

Get link state.

Parameters:
pRssipointer 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
pRegistrationStatepointer to store the current registration state
pBearerpointer to store the current bearer
Returns:
0 on success, error code on failure

Definition at line 431 of file UbloxModem.cpp.

int getSM ( char *  number,
char *  message,
size_t  maxLength 
) [virtual]

Receive a SM.

Parameters:
numberPointer 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)
messagePointer to a buffer to store the the incoming message
maxLengthMaximum message length that can be stored in buffer (including null-terminating character)
Returns:
0 on success, error code on failure

Definition at line 255 of file UbloxModem.cpp.

int getSMCount ( size_t *  pCount ) [virtual]

Get the number of SMs in the incoming box.

Parameters:
pCountpointer to store the number of unprocessed SMs on
Returns:
0 on success, error code on failure

Definition at line 285 of file UbloxModem.cpp.

int init (  ) [protected, virtual]

Initialise dongle.

The following actions are performed: 1) Start AT interface thread 2) Wait for network registration

Definition at line 320 of file UbloxModem.cpp.

int sendSM ( const char *  number,
const char *  message 
) [virtual]

Send a SM.

Parameters:
numberThe receiver's phone number
messageThe message to send
Returns:
0 on success, error code on failure

Definition at line 225 of file UbloxModem.cpp.

int sendUSSD ( const char *  command,
char *  result,
size_t  maxLength 
)

Send a USSD command & wait for its result.

Parameters:
commandThe command to send
resultBuffer in which to store the result
maxLengthMaximum result length that can be stored in buffer (including null-terminating character)
Returns:
0 on success, error code on failure

Definition at line 404 of file UbloxModem.cpp.