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

« Back to documentation index

CellularSIM Class Reference

CellularSIM Class Reference

Class CellularSIM. More...

#include <CellularSIM.h>

Inherited by AT_CellularSIM.

Public Member Functions

virtual nsapi_error_t set_pin (const char *sim_pin)=0
 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)=0
 Change sim pin code.
virtual nsapi_error_t set_pin_query (const char *sim_pin, bool query_pin)=0
 Change is pin query needed after boot.
virtual nsapi_error_t get_sim_state (SimState &state)=0
 Get sim card's state.
virtual nsapi_error_t get_imsi (char *imsi)=0
 Get IMSI from the sim card.
virtual nsapi_error_t get_iccid (char *buf, size_t buf_size)=0
 Get serial number from the SIM card.

Protected Member Functions

virtual ~CellularSIM ()
 virtual Destructor

Detailed Description

Class CellularSIM.

An abstract interface for SIM card handling.

Definition at line 35 of file CellularSIM.h.


Constructor & Destructor Documentation

virtual ~CellularSIM (  ) [protected, virtual]

virtual Destructor

Definition at line 43 of file CellularSIM.h.


Member Function Documentation

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

Change sim pin code.

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

Implemented in AT_CellularSIM.

virtual nsapi_error_t get_iccid ( char *  buf,
size_t  buf_size 
) [pure 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

Implemented in AT_CellularSIM.

virtual nsapi_error_t get_imsi ( char *  imsi ) [pure 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

Implemented in AT_CellularSIM.

virtual nsapi_error_t get_sim_state ( SimState &  state ) [pure virtual]

Get sim card's state.

Parameters:
statecurrent state of SIM
Returns:
zero on success

Implemented in AT_CellularSIM.

virtual nsapi_error_t set_pin ( const char *  sim_pin ) [pure virtual]

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

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

Implemented in AT_CellularSIM.

virtual nsapi_error_t set_pin_query ( const char *  sim_pin,
bool  query_pin 
) [pure 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

Implemented in AT_CellularSIM.