Knight KE / Mbed OS Game_Master
Embed: (wiki syntax)

« Back to documentation index

AT_CellularSIM Class Reference

Class AT_CellularSIM. More...

#include <AT_CellularSIM.h>

Inherits mbed::CellularSIM, and mbed::AT_CellularBase.

Inherited by QUECTEL_BC95_CellularSIM, and QUECTEL_BG96_CellularSIM.

Public Types

enum  SupportedFeature
 

Cellular module need to define an array of unsupported features if any, by default all features are supported.

More...

Public Member Functions

virtual nsapi_error_t set_pin (const char *sim_pin)
 Open the SIM card by setting the pin code for SIM.
virtual nsapi_error_t change_pin (const char *sim_pin, const char *new_pin)
 Change sim pin code.
virtual nsapi_error_t set_pin_query (const char *sim_pin, bool query_pin)
 Change is pin query needed after boot.
virtual nsapi_error_t get_sim_state (SimState &state)
 Get sim card's state.
virtual nsapi_error_t get_imsi (char *imsi)
 Get IMSI from the sim card.
virtual nsapi_error_t get_iccid (char *buf, size_t buf_size)
 Get serial number from the SIM card.
ATHandlerget_at_handler ()
 Getter for at handler.
device_err_t get_device_error () const
 Gets the device error that happened when using AT commands/responses.

Static Protected Attributes

static const SupportedFeature_unsupported_features
 Check if some functionality is supported by a cellular module.

Detailed Description

Class AT_CellularSIM.

Class for SIM card handling.

Definition at line 31 of file AT_CellularSIM.h.


Member Enumeration Documentation

enum SupportedFeature [inherited]

Cellular module need to define an array of unsupported features if any, by default all features are supported.

Parameters:
featuresArray of type SupportedFeature with last element FEATURE_END_MARK

Definition at line 51 of file AT_CellularBase.h.


Member Function Documentation

nsapi_error_t change_pin ( const char *  sim_pin,
const char *  new_pin 
) [virtual]

Change sim pin code.

Parameters:
sim_pinCurrent PIN for sim
new_pinNew PIN for sim
Returns:
zero on success

Implements CellularSIM.

Definition at line 99 of file AT_CellularSIM.cpp.

ATHandler & get_at_handler (  ) [inherited]

Getter for at handler.

Common method for all AT-classes.

Returns:
reference to ATHandler

Definition at line 27 of file AT_CellularBase.cpp.

device_err_t get_device_error (  ) const [inherited]

Gets the device error that happened when using AT commands/responses.

This is at error returned by the device. Returned CME/CMS errors can be found from 3gpp documents 27007 and 27005.

Returns:
at error (CME/CMS) while communicating with the device

Definition at line 32 of file AT_CellularBase.cpp.

nsapi_error_t get_iccid ( char *  buf,
size_t  buf_size 
) [virtual]

Get serial number from the SIM card.

Parameters:
bufSIM ICCID as zero terminated string
buf_sizemax length of SIM ICCID is MAX_ICCID_LENGTH
Returns:
zero on success, on failure negative error code

Implements CellularSIM.

Definition at line 154 of file AT_CellularSIM.cpp.

nsapi_error_t get_imsi ( char *  imsi ) [virtual]

Get IMSI from the sim card.

Remarks:
Given imsi buffer length must be 16 or more as imsi max length is 15!
Parameters:
imsipreallocated char* which after successful request contains imsi
Returns:
zero on success

Implements CellularSIM.

Definition at line 137 of file AT_CellularSIM.cpp.

nsapi_error_t get_sim_state ( SimState &  state ) [virtual]

Get sim card's state.

Parameters:
statecurrent state of SIM
Returns:
zero on success

Implements CellularSIM.

Definition at line 33 of file AT_CellularSIM.cpp.

nsapi_error_t set_pin ( const char *  sim_pin ) [virtual]

Open the SIM card by setting the pin code for SIM.

Parameters:
sim_pinPIN for the SIM card
Returns:
zero on success

Implements CellularSIM.

Definition at line 81 of file AT_CellularSIM.cpp.

nsapi_error_t set_pin_query ( const char *  sim_pin,
bool  query_pin 
) [virtual]

Change is pin query needed after boot.

Parameters:
sim_pinValid PIN for SIM card
query_pinFalse is PIN query not needed, True if PIN query needed after boot.
Returns:
zero on success

Implements CellularSIM.

Definition at line 112 of file AT_CellularSIM.cpp.


Field Documentation

AT_CellularBase::SupportedFeature const * _unsupported_features [static, protected, inherited]

Check if some functionality is supported by a cellular module.

For example, most of standard AT commands are optional and not implemented by all cellular modules.

Parameters:
featurecheck for feature to support
Returns:
true on supported, otherwise false

Definition at line 66 of file AT_CellularBase.h.