Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
YCellular Class Reference

#include <yocto_cellular.h>

Inheritance diagram for YCellular:
Inheritance graph
[legend]

Public Member Functions

virtual string _AT (string cmd)
 
virtual int _invokeValueCallback (string value)
 
Y_AIRPLANEMODE_enum airplaneMode (void)
 
string apn (void)
 
string apnSecret (void)
 
string cellIdentifier (void)
 
string cellOperator (void)
 
Y_CELLTYPE_enum cellType (void)
 
virtual int clearDataCounters (void)
 
string command (void)
 
int dataReceived (void)
 
int dataSent (void)
 
Y_ENABLEDATA_enum enableData (void)
 
Y_AIRPLANEMODE_enum get_airplaneMode (void)
 
string get_apn (void)
 
string get_apnSecret (void)
 
virtual vector< string > get_availableOperators (void)
 
string get_cellIdentifier (void)
 
string get_cellOperator (void)
 
Y_CELLTYPE_enum get_cellType (void)
 
string get_command (void)
 
int get_dataReceived (void)
 
int get_dataSent (void)
 
Y_ENABLEDATA_enum get_enableData (void)
 
string get_imsi (void)
 
int get_linkQuality (void)
 
string get_lockedOperator (void)
 
string get_message (void)
 
string get_pin (void)
 
int get_pingInterval (void)
 
string imsi (void)
 
int linkQuality (void)
 
string lockedOperator (void)
 
string message (void)
 
YCellularnext (void)
 
YCellularnextCellular (void)
 
string pin (void)
 
int pingInterval (void)
 
virtual vector< YCellRecordquickCellSurvey (void)
 
virtual int registerValueCallback (YCellularValueCallback callback)
 
virtual int sendPUK (string puk, string newPin)
 
int set_airplaneMode (Y_AIRPLANEMODE_enum newval)
 
int set_apn (const string &newval)
 
virtual int set_apnAuth (string username, string password)
 
int set_apnSecret (const string &newval)
 
int set_command (const string &newval)
 
int set_dataReceived (int newval)
 
int set_dataSent (int newval)
 
int set_enableData (Y_ENABLEDATA_enum newval)
 
int set_lockedOperator (const string &newval)
 
int set_pin (const string &newval)
 
int set_pingInterval (int newval)
 
int setAirplaneMode (Y_AIRPLANEMODE_enum newval)
 
int setApn (const string &newval)
 
int setApnSecret (const string &newval)
 
int setCommand (const string &newval)
 
int setDataReceived (int newval)
 
int setDataSent (int newval)
 
int setEnableData (Y_ENABLEDATA_enum newval)
 
int setLockedOperator (const string &newval)
 
int setPin (const string &newval)
 
int setPingInterval (int newval)
 
 ~YCellular ()
 
- Public Member Functions inherited from YFunction
void _clearDataStreamCache ()
 
string _decode_json_string (const string &json)
 
string _download (const string &url)
 
YDataStream_findDataStream (YDataSet &dataset, const string &def)
 
string _get_json_path (const string &json, const string &path)
 
vector< string > _json_get_array (const string &json)
 
string _json_get_key (const string &json, const string &data)
 
string _json_get_string (const string &json)
 
int _parseEx (yJsonStateMachine &j)
 
virtual int _parserHelper (void)
 
string _parseString (yJsonStateMachine &j)
 
string _request (const string &request)
 
string _requestEx (int tcpchan, const string &request, yapiRequestProgressCallback callback, void *context)
 
void _throw (YRETCODE errType, string errMsg)
 
YRETCODE _upload (const string &path, const string &content)
 
YRETCODE _uploadWithProgress (const string &path, const string &content, yapiRequestProgressCallback callback, void *context)
 
string advertisedValue (void)
 
void clearCache ()
 
string describe (void)
 
string errMessage (void)
 
string errorMessage (void)
 
YRETCODE errorType (void)
 
YRETCODE errType (void)
 
YFUN_DESCR functionDescriptor (void)
 
string get_advertisedValue (void)
 
string get_errorMessage (void)
 
YRETCODE get_errorType (void)
 
virtual string get_friendlyName (void)
 
YFUN_DESCR get_functionDescriptor (void)
 
string get_functionId (void)
 
string get_hardwareId (void)
 
string get_hubSerial ()
 
string get_logicalName (void)
 
YModuleget_module (void)
 
void * get_userData (void)
 
bool isOnline (void)
 
YRETCODE load (int msValidity)
 
virtual string loadAttribute (string attrName)
 
string logicalName (void)
 
YModulemodule (void)
 
virtual int muteValueCallbacks (void)
 
YFunctionnext (void)
 
YFunctionnextFunction (void)
 
virtual int registerValueCallback (YFunctionValueCallback callback)
 
int set_advertisedValue (const string &newval)
 
int set_logicalName (const string &newval)
 
void set_userData (void *data)
 
int setAdvertisedValue (const string &newval)
 
int setLogicalName (const string &newval)
 
void setUserData (void *data)
 
virtual int unmuteValueCallbacks (void)
 
void * userData (void)
 
virtual ~YFunction ()
 

Static Public Member Functions

static YCellularFind (string func)
 
static YCellularFindCellular (string func)
 
static YCellularFirst (void)
 
static YCellularFirstCellular (void)
 
- Static Public Member Functions inherited from YFunction
static void _ClearCache (void)
 
static YFunctionFind (string func)
 
static YFunctionFindFunction (string func)
 
static YFunctionFirst (void)
 
static YFunctionFirstFunction (void)
 

Static Public Attributes

static const Y_AIRPLANEMODE_enum AIRPLANEMODE_INVALID = Y_AIRPLANEMODE_INVALID
 
static const Y_AIRPLANEMODE_enum AIRPLANEMODE_OFF = Y_AIRPLANEMODE_OFF
 
static const Y_AIRPLANEMODE_enum AIRPLANEMODE_ON = Y_AIRPLANEMODE_ON
 
static const string APN_INVALID = YAPI_INVALID_STRING
 
static const string APNSECRET_INVALID = YAPI_INVALID_STRING
 
static const string CELLIDENTIFIER_INVALID = YAPI_INVALID_STRING
 
static const string CELLOPERATOR_INVALID = YAPI_INVALID_STRING
 
static const Y_CELLTYPE_enum CELLTYPE_CDMA = Y_CELLTYPE_CDMA
 
static const Y_CELLTYPE_enum CELLTYPE_EGPRS = Y_CELLTYPE_EGPRS
 
static const Y_CELLTYPE_enum CELLTYPE_GPRS = Y_CELLTYPE_GPRS
 
static const Y_CELLTYPE_enum CELLTYPE_HSDPA = Y_CELLTYPE_HSDPA
 
static const Y_CELLTYPE_enum CELLTYPE_INVALID = Y_CELLTYPE_INVALID
 
static const Y_CELLTYPE_enum CELLTYPE_NONE = Y_CELLTYPE_NONE
 
static const Y_CELLTYPE_enum CELLTYPE_WCDMA = Y_CELLTYPE_WCDMA
 
static const string COMMAND_INVALID = YAPI_INVALID_STRING
 
static const int DATARECEIVED_INVALID = YAPI_INVALID_UINT
 
static const int DATASENT_INVALID = YAPI_INVALID_UINT
 
static const Y_ENABLEDATA_enum ENABLEDATA_HOMENETWORK = Y_ENABLEDATA_HOMENETWORK
 
static const Y_ENABLEDATA_enum ENABLEDATA_INVALID = Y_ENABLEDATA_INVALID
 
static const Y_ENABLEDATA_enum ENABLEDATA_NEUTRALITY = Y_ENABLEDATA_NEUTRALITY
 
static const Y_ENABLEDATA_enum ENABLEDATA_NEVER = Y_ENABLEDATA_NEVER
 
static const Y_ENABLEDATA_enum ENABLEDATA_ROAMING = Y_ENABLEDATA_ROAMING
 
static const string IMSI_INVALID = YAPI_INVALID_STRING
 
static const int LINKQUALITY_INVALID = YAPI_INVALID_UINT
 
static const string LOCKEDOPERATOR_INVALID = YAPI_INVALID_STRING
 
static const string MESSAGE_INVALID = YAPI_INVALID_STRING
 
static const string PIN_INVALID = YAPI_INVALID_STRING
 
static const int PINGINTERVAL_INVALID = YAPI_INVALID_UINT
 
- Static Public Attributes inherited from YFunction
static const string ADVERTISEDVALUE_INVALID = YAPI_INVALID_STRING
 
static const string FRIENDLYNAME_INVALID = YAPI_INVALID_STRING
 
static const YFUN_DESCR FUNCTIONDESCRIPTOR_INVALID = Y_FUNCTIONDESCRIPTOR_INVALID
 
static const string FUNCTIONID_INVALID = YAPI_INVALID_STRING
 
static const string HARDWAREID_INVALID = YAPI_INVALID_STRING
 
static const string LOGICALNAME_INVALID = YAPI_INVALID_STRING
 

Protected Member Functions

virtual int _parseAttr (YJSONObject *json_val)
 
 YCellular (const string &func)
 
- Protected Member Functions inherited from YFunction
YRETCODE _buildSetRequest (const string &changeattr, const string *changeval, string &request, string &errmsg)
 
string _escapeAttr (const string &changeval)
 
YRETCODE _getDescriptor (YFUN_DESCR &fundescr, string &errMsg)
 
YRETCODE _getDevice (YDevice *&dev, string &errMsg)
 
YRETCODE _load_unsafe (int msValidity)
 
YRETCODE _nextFunction (string &hwId)
 
int _parse (YJSONObject *j)
 
YRETCODE _setAttr (string attrname, string newvalue)
 
 YFunction (const string &func)
 

Protected Attributes

Y_AIRPLANEMODE_enum _airplaneMode
 
string _apn
 
string _apnSecret
 
string _cellIdentifier
 
string _cellOperator
 
Y_CELLTYPE_enum _cellType
 
string _command
 
int _dataReceived
 
int _dataSent
 
Y_ENABLEDATA_enum _enableData
 
string _imsi
 
int _linkQuality
 
string _lockedOperator
 
string _message
 
string _pin
 
int _pingInterval
 
YCellularValueCallback _valueCallbackCellular
 
- Protected Attributes inherited from YFunction
string _advertisedValue
 
u64 _cacheExpiration
 
string _className
 
std::map< string, YDataStream * > _dataStreams
 
string _func
 
YFUN_DESCR _fundescr
 
string _funId
 
string _hwId
 
string _lastErrorMsg
 
YRETCODE _lastErrorType
 
string _logicalName
 
string _serial
 
yCRITICAL_SECTION _this_cs
 
void * _userData
 
YFunctionValueCallback _valueCallbackFunction
 

Friends

YCellularyFindCellular (const string &func)
 
YCellularyFirstCellular (void)
 

Additional Inherited Members

- Static Protected Member Functions inherited from YFunction
static void _AddToCache (const string &classname, const string &func, YFunction *obj)
 
static YFunction_FindFromCache (const string &classname, const string &func)
 
static void _UpdateTimedReportCallbackList (YFunction *func, bool add)
 
static void _UpdateValueCallbackList (YFunction *func, bool add)
 
- Static Protected Attributes inherited from YFunction
static std::map< string, YFunction * > _cache
 

Detailed Description

YCellular Class: Cellular function interface

YCellular functions provides control over cellular network parameters and status for devices that are GSM-enabled.

Definition at line 163 of file yocto_cellular.h.

Constructor & Destructor Documentation

YCellular::YCellular ( const string &  func)
protected

Definition at line 114 of file yocto_cellular.cpp.

YCellular::~YCellular ( )

Definition at line 138 of file yocto_cellular.cpp.

Member Function Documentation

string YCellular::_AT ( string  cmd)
virtual

Sends an AT command to the GSM module and returns the command output. The command will only execute when the GSM module is in standard command state, and should leave it in the exact same state. Use this function with great care !

Parameters
cmd: the AT command to execute, like for instance: "+CCLK?".
Returns
a string with the result of the commands. Empty lines are automatically removed from the output.

Definition at line 1101 of file yocto_cellular.cpp.

int YCellular::_invokeValueCallback ( string  value)
virtual

Reimplemented from YFunction.

Definition at line 1017 of file yocto_cellular.cpp.

int YCellular::_parseAttr ( YJSONObject json_val)
protectedvirtual

Reimplemented from YFunction.

Definition at line 155 of file yocto_cellular.cpp.

Y_AIRPLANEMODE_enum YCellular::airplaneMode ( void  )
inline

Definition at line 390 of file yocto_cellular.h.

string YCellular::apn ( void  )
inline

Definition at line 450 of file yocto_cellular.h.

string YCellular::apnSecret ( void  )
inline

Definition at line 479 of file yocto_cellular.h.

string YCellular::cellIdentifier ( void  )
inline

Definition at line 266 of file yocto_cellular.h.

string YCellular::cellOperator ( void  )
inline

Definition at line 253 of file yocto_cellular.h.

Y_CELLTYPE_enum YCellular::cellType ( void  )
inline

Definition at line 279 of file yocto_cellular.h.

int YCellular::clearDataCounters ( void  )
virtual

Clear the transmitted data counters.

Returns
YAPI_SUCCESS when the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 1078 of file yocto_cellular.cpp.

string YCellular::command ( void  )
inline

Definition at line 563 of file yocto_cellular.h.

int YCellular::dataReceived ( void  )
inline

Definition at line 545 of file yocto_cellular.h.

int YCellular::dataSent ( void  )
inline

Definition at line 520 of file yocto_cellular.h.

Y_ENABLEDATA_enum YCellular::enableData ( void  )
inline

Definition at line 418 of file yocto_cellular.h.

static YCellular* YCellular::Find ( string  func)
inlinestatic

Definition at line 688 of file yocto_cellular.h.

YCellular * YCellular::FindCellular ( string  func)
static

Retrieves a cellular interface for a given identifier. The identifier can be specified using several formats:

  • FunctionLogicalName
  • ModuleSerialNumber.FunctionIdentifier
  • ModuleSerialNumber.FunctionLogicalName
  • ModuleLogicalName.FunctionIdentifier
  • ModuleLogicalName.FunctionLogicalName

This function does not require that the cellular interface is online at the time it is invoked. The returned object is nevertheless valid. Use the method YCellular.isOnline() to test if the cellular interface is indeed online at a given time. In case of ambiguity when looking for a cellular interface by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object's is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

Parameters
func: a string that uniquely characterizes the cellular interface
Returns
a YCellular object allowing you to drive the cellular interface.

Definition at line 966 of file yocto_cellular.cpp.

static YCellular* YCellular::First ( void  )
inlinestatic

Definition at line 712 of file yocto_cellular.h.

YCellular * YCellular::FirstCellular ( void  )
static

Starts the enumeration of cellular interfaces currently accessible. Use the method YCellular.nextCellular() to iterate on next cellular interfaces.

Returns
a pointer to a YCellular object, corresponding to the first cellular interface currently online, or a NULL pointer if there are none.

Definition at line 1285 of file yocto_cellular.cpp.

Y_AIRPLANEMODE_enum YCellular::get_airplaneMode ( void  )

Returns true if the airplane mode is active (radio turned off).

Returns
either Y_AIRPLANEMODE_OFF or Y_AIRPLANEMODE_ON, according to true if the airplane mode is active (radio turned off)

On failure, throws an exception or returns Y_AIRPLANEMODE_INVALID.

Definition at line 525 of file yocto_cellular.cpp.

string YCellular::get_apn ( void  )

Returns the Access Point Name (APN) to be used, if needed. When left blank, the APN suggested by the cell operator will be used.

Returns
a string corresponding to the Access Point Name (APN) to be used, if needed

On failure, throws an exception or returns Y_APN_INVALID.

Definition at line 643 of file yocto_cellular.cpp.

string YCellular::get_apnSecret ( void  )

Returns an opaque string if APN authentication parameters have been configured in the device, or an empty string otherwise. To configure these parameters, use set_apnAuth().

Returns
a string corresponding to an opaque string if APN authentication parameters have been configured in the device, or an empty string otherwise

On failure, throws an exception or returns Y_APNSECRET_INVALID.

Definition at line 701 of file yocto_cellular.cpp.

vector< string > YCellular::get_availableOperators ( void  )
virtual

Returns the list detected cell operators in the neighborhood. This function will typically take between 30 seconds to 1 minute to return. Note that any SIM card can usually only connect to specific operators. All networks returned by this function might therefore not be available for connection.

Returns
a list of string (cell operator names).

Definition at line 1170 of file yocto_cellular.cpp.

string YCellular::get_cellIdentifier ( void  )

Returns the unique identifier of the cellular antenna in use: MCC, MNC, LAC and Cell ID.

Returns
a string corresponding to the unique identifier of the cellular antenna in use: MCC, MNC, LAC and Cell ID

On failure, throws an exception or returns Y_CELLIDENTIFIER_INVALID.

Definition at line 275 of file yocto_cellular.cpp.

string YCellular::get_cellOperator ( void  )

Returns the name of the cell operator currently in use.

Returns
a string corresponding to the name of the cell operator currently in use

On failure, throws an exception or returns Y_CELLOPERATOR_INVALID.

Definition at line 245 of file yocto_cellular.cpp.

Y_CELLTYPE_enum YCellular::get_cellType ( void  )

Active cellular connection type.

Returns
a value among Y_CELLTYPE_GPRS, Y_CELLTYPE_EGPRS, Y_CELLTYPE_WCDMA, Y_CELLTYPE_HSDPA, Y_CELLTYPE_NONE and Y_CELLTYPE_CDMA

On failure, throws an exception or returns Y_CELLTYPE_INVALID.

Definition at line 305 of file yocto_cellular.cpp.

string YCellular::get_command ( void  )

Definition at line 901 of file yocto_cellular.cpp.

int YCellular::get_dataReceived ( void  )

Returns the number of bytes received so far.

Returns
an integer corresponding to the number of bytes received so far

On failure, throws an exception or returns Y_DATARECEIVED_INVALID.

Definition at line 854 of file yocto_cellular.cpp.

int YCellular::get_dataSent ( void  )

Returns the number of bytes sent so far.

Returns
an integer corresponding to the number of bytes sent so far

On failure, throws an exception or returns Y_DATASENT_INVALID.

Definition at line 800 of file yocto_cellular.cpp.

Y_ENABLEDATA_enum YCellular::get_enableData ( void  )

Returns the condition for enabling IP data services (GPRS). When data services are disabled, SMS are the only mean of communication.

Returns
a value among Y_ENABLEDATA_HOMENETWORK, Y_ENABLEDATA_ROAMING, Y_ENABLEDATA_NEVER and Y_ENABLEDATA_NEUTRALITY corresponding to the condition for enabling IP data services (GPRS)

On failure, throws an exception or returns Y_ENABLEDATA_INVALID.

Definition at line 582 of file yocto_cellular.cpp.

string YCellular::get_imsi ( void  )

Returns an opaque string if a PIN code has been configured in the device to access the SIM card, or an empty string if none has been configured or if the code provided was rejected by the SIM card.

Returns
a string corresponding to an opaque string if a PIN code has been configured in the device to access the SIM card, or an empty string if none has been configured or if the code provided was rejected by the SIM card

On failure, throws an exception or returns Y_IMSI_INVALID.

Definition at line 338 of file yocto_cellular.cpp.

int YCellular::get_linkQuality ( void  )

Returns the link quality, expressed in percent.

Returns
an integer corresponding to the link quality, expressed in percent

On failure, throws an exception or returns Y_LINKQUALITY_INVALID.

Definition at line 216 of file yocto_cellular.cpp.

string YCellular::get_lockedOperator ( void  )

Returns the name of the only cell operator to use if automatic choice is disabled, or an empty string if the SIM card will automatically choose among available cell operators.

Returns
a string corresponding to the name of the only cell operator to use if automatic choice is disabled, or an empty string if the SIM card will automatically choose among available cell operators

On failure, throws an exception or returns Y_LOCKEDOPERATOR_INVALID.

Definition at line 468 of file yocto_cellular.cpp.

string YCellular::get_message ( void  )

Returns the latest status message from the wireless interface.

Returns
a string corresponding to the latest status message from the wireless interface

On failure, throws an exception or returns Y_MESSAGE_INVALID.

Definition at line 367 of file yocto_cellular.cpp.

string YCellular::get_pin ( void  )

Returns an opaque string if a PIN code has been configured in the device to access the SIM card, or an empty string if none has been configured or if the code provided was rejected by the SIM card.

Returns
a string corresponding to an opaque string if a PIN code has been configured in the device to access the SIM card, or an empty string if none has been configured or if the code provided was rejected by the SIM card

On failure, throws an exception or returns Y_PIN_INVALID.

Definition at line 400 of file yocto_cellular.cpp.

int YCellular::get_pingInterval ( void  )

Returns the automated connectivity check interval, in seconds.

Returns
an integer corresponding to the automated connectivity check interval, in seconds

On failure, throws an exception or returns Y_PINGINTERVAL_INVALID.

Definition at line 746 of file yocto_cellular.cpp.

string YCellular::imsi ( void  )
inline

Definition at line 295 of file yocto_cellular.h.

int YCellular::linkQuality ( void  )
inline

Definition at line 241 of file yocto_cellular.h.

string YCellular::lockedOperator ( void  )
inline

Definition at line 362 of file yocto_cellular.h.

string YCellular::message ( void  )
inline

Definition at line 307 of file yocto_cellular.h.

YCellular* YCellular::next ( void  )
inline

Definition at line 699 of file yocto_cellular.h.

YCellular * YCellular::nextCellular ( void  )

Continues the enumeration of cellular interfaces started using yFirstCellular().

Returns
a pointer to a YCellular object, corresponding to a cellular interface currently online, or a NULL pointer if there are no more cellular interfaces to enumerate.

Definition at line 1275 of file yocto_cellular.cpp.

string YCellular::pin ( void  )
inline

Definition at line 323 of file yocto_cellular.h.

int YCellular::pingInterval ( void  )
inline

Definition at line 495 of file yocto_cellular.h.

vector< YCellRecord > YCellular::quickCellSurvey ( void  )
virtual

Returns a list of nearby cellular antennas, as required for quick geolocation of the device. The first cell listed is the serving cell, and the next ones are the neighboor cells reported by the serving cell.

Returns
a list of YCellRecords.

Definition at line 1206 of file yocto_cellular.cpp.

int YCellular::registerValueCallback ( YCellularValueCallback  callback)
virtual

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of ySleep or yHandleEvents. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a NULL pointer as argument.

Parameters
callback: the callback function to call, or a NULL pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.

Definition at line 998 of file yocto_cellular.cpp.

int YCellular::sendPUK ( string  puk,
string  newPin 
)
virtual

Sends a PUK code to unlock the SIM card after three failed PIN code attempts, and setup a new PIN into the SIM card. Only ten consecutives tentatives are permitted: after that, the SIM card will be blocked permanently without any mean of recovery to use it again. Note that after calling this method, you have usually to invoke method set_pin() to tell the YoctoHub which PIN to use in the future.

Parameters
puk: the SIM PUK code
newPin: new PIN code to configure into the SIM card
Returns
YAPI_SUCCESS when the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 1041 of file yocto_cellular.cpp.

int YCellular::set_airplaneMode ( Y_AIRPLANEMODE_enum  newval)

Changes the activation state of airplane mode (radio turned off).

Parameters
newval: either Y_AIRPLANEMODE_OFF or Y_AIRPLANEMODE_ON, according to the activation state of airplane mode (radio turned off)
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 557 of file yocto_cellular.cpp.

int YCellular::set_apn ( const string &  newval)

Returns the Access Point Name (APN) to be used, if needed. When left blank, the APN suggested by the cell operator will be used.

Parameters
newval: a string
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 675 of file yocto_cellular.cpp.

int YCellular::set_apnAuth ( string  username,
string  password 
)
virtual

Configure authentication parameters to connect to the APN. Both PAP and CHAP authentication are supported.

Parameters
username: APN username
password: APN password
Returns
YAPI_SUCCESS when the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 1066 of file yocto_cellular.cpp.

int YCellular::set_apnSecret ( const string &  newval)

Definition at line 723 of file yocto_cellular.cpp.

int YCellular::set_command ( const string &  newval)

Definition at line 923 of file yocto_cellular.cpp.

int YCellular::set_dataReceived ( int  newval)

Changes the value of the incoming data counter.

Parameters
newval: an integer corresponding to the value of the incoming data counter
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 885 of file yocto_cellular.cpp.

int YCellular::set_dataSent ( int  newval)

Changes the value of the outgoing data counter.

Parameters
newval: an integer corresponding to the value of the outgoing data counter
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 831 of file yocto_cellular.cpp.

int YCellular::set_enableData ( Y_ENABLEDATA_enum  newval)

Changes the condition for enabling IP data services (GPRS). The service can be either fully deactivated, or limited to the SIM home network, or enabled for all partner networks (roaming). Caution: enabling data services on roaming networks may cause prohibitive communication costs !

When data services are disabled, SMS are the only mean of communication.

Parameters
newval: a value among Y_ENABLEDATA_HOMENETWORK, Y_ENABLEDATA_ROAMING, Y_ENABLEDATA_NEVER and Y_ENABLEDATA_NEUTRALITY corresponding to the condition for enabling IP data services (GPRS)
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 619 of file yocto_cellular.cpp.

int YCellular::set_lockedOperator ( const string &  newval)

Changes the name of the cell operator to be used. If the name is an empty string, the choice will be made automatically based on the SIM card. Otherwise, the selected operator is the only one that will be used.

Parameters
newval: a string corresponding to the name of the cell operator to be used
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 501 of file yocto_cellular.cpp.

int YCellular::set_pin ( const string &  newval)

Changes the PIN code used by the module to access the SIM card. This function does not change the code on the SIM card itself, but only changes the parameter used by the device to try to get access to it. If the SIM code does not work immediately on first try, it will be automatically forgotten and the message will be set to "Enter SIM PIN". The method should then be invoked again with right correct PIN code. After three failed attempts in a row, the message is changed to "Enter SIM PUK" and the SIM card PUK code must be provided using method sendPUK.

Remember to call the saveToFlash() method of the module to save the new value in the device flash.

Parameters
newval: a string corresponding to the PIN code used by the module to access the SIM card
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 441 of file yocto_cellular.cpp.

int YCellular::set_pingInterval ( int  newval)

Changes the automated connectivity check interval, in seconds.

Parameters
newval: an integer corresponding to the automated connectivity check interval, in seconds
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 777 of file yocto_cellular.cpp.

int YCellular::setAirplaneMode ( Y_AIRPLANEMODE_enum  newval)
inline

Definition at line 404 of file yocto_cellular.h.

int YCellular::setApn ( const string &  newval)
inline

Definition at line 464 of file yocto_cellular.h.

int YCellular::setApnSecret ( const string &  newval)
inline

Definition at line 483 of file yocto_cellular.h.

int YCellular::setCommand ( const string &  newval)
inline

Definition at line 567 of file yocto_cellular.h.

int YCellular::setDataReceived ( int  newval)
inline

Definition at line 558 of file yocto_cellular.h.

int YCellular::setDataSent ( int  newval)
inline

Definition at line 533 of file yocto_cellular.h.

int YCellular::setEnableData ( Y_ENABLEDATA_enum  newval)
inline

Definition at line 437 of file yocto_cellular.h.

int YCellular::setLockedOperator ( const string &  newval)
inline

Definition at line 377 of file yocto_cellular.h.

int YCellular::setPin ( const string &  newval)
inline

Definition at line 346 of file yocto_cellular.h.

int YCellular::setPingInterval ( int  newval)
inline

Definition at line 508 of file yocto_cellular.h.

Friends And Related Function Documentation

YCellular* yFindCellular ( const string &  func)
friend

Retrieves a cellular interface for a given identifier. The identifier can be specified using several formats:

  • FunctionLogicalName
  • ModuleSerialNumber.FunctionIdentifier
  • ModuleSerialNumber.FunctionLogicalName
  • ModuleLogicalName.FunctionIdentifier
  • ModuleLogicalName.FunctionLogicalName

This function does not require that the cellular interface is online at the time it is invoked. The returned object is nevertheless valid. Use the method YCellular.isOnline() to test if the cellular interface is indeed online at a given time. In case of ambiguity when looking for a cellular interface by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object's is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

Parameters
func: a string that uniquely characterizes the cellular interface
Returns
a YCellular object allowing you to drive the cellular interface.

Definition at line 749 of file yocto_cellular.h.

YCellular* yFirstCellular ( void  )
friend

Starts the enumeration of cellular interfaces currently accessible. Use the method YCellular.nextCellular() to iterate on next cellular interfaces.

Returns
a pointer to a YCellular object, corresponding to the first cellular interface currently online, or a NULL pointer if there are none.

Definition at line 760 of file yocto_cellular.h.

Member Data Documentation

Y_AIRPLANEMODE_enum YCellular::_airplaneMode
protected

Definition at line 179 of file yocto_cellular.h.

string YCellular::_apn
protected

Definition at line 181 of file yocto_cellular.h.

string YCellular::_apnSecret
protected

Definition at line 182 of file yocto_cellular.h.

string YCellular::_cellIdentifier
protected

Definition at line 173 of file yocto_cellular.h.

string YCellular::_cellOperator
protected

Definition at line 172 of file yocto_cellular.h.

Y_CELLTYPE_enum YCellular::_cellType
protected

Definition at line 174 of file yocto_cellular.h.

string YCellular::_command
protected

Definition at line 186 of file yocto_cellular.h.

int YCellular::_dataReceived
protected

Definition at line 185 of file yocto_cellular.h.

int YCellular::_dataSent
protected

Definition at line 184 of file yocto_cellular.h.

Y_ENABLEDATA_enum YCellular::_enableData
protected

Definition at line 180 of file yocto_cellular.h.

string YCellular::_imsi
protected

Definition at line 175 of file yocto_cellular.h.

int YCellular::_linkQuality
protected

Definition at line 171 of file yocto_cellular.h.

string YCellular::_lockedOperator
protected

Definition at line 178 of file yocto_cellular.h.

string YCellular::_message
protected

Definition at line 176 of file yocto_cellular.h.

string YCellular::_pin
protected

Definition at line 177 of file yocto_cellular.h.

int YCellular::_pingInterval
protected

Definition at line 183 of file yocto_cellular.h.

YCellularValueCallback YCellular::_valueCallbackCellular
protected

Definition at line 187 of file yocto_cellular.h.

const Y_AIRPLANEMODE_enum YCellular::AIRPLANEMODE_INVALID = Y_AIRPLANEMODE_INVALID
static

Definition at line 219 of file yocto_cellular.h.

const Y_AIRPLANEMODE_enum YCellular::AIRPLANEMODE_OFF = Y_AIRPLANEMODE_OFF
static

Definition at line 217 of file yocto_cellular.h.

const Y_AIRPLANEMODE_enum YCellular::AIRPLANEMODE_ON = Y_AIRPLANEMODE_ON
static

Definition at line 218 of file yocto_cellular.h.

const string YCellular::APN_INVALID = YAPI_INVALID_STRING
static

Definition at line 225 of file yocto_cellular.h.

const string YCellular::APNSECRET_INVALID = YAPI_INVALID_STRING
static

Definition at line 226 of file yocto_cellular.h.

const string YCellular::CELLIDENTIFIER_INVALID = YAPI_INVALID_STRING
static

Definition at line 205 of file yocto_cellular.h.

const string YCellular::CELLOPERATOR_INVALID = YAPI_INVALID_STRING
static

Definition at line 204 of file yocto_cellular.h.

const Y_CELLTYPE_enum YCellular::CELLTYPE_CDMA = Y_CELLTYPE_CDMA
static

Definition at line 211 of file yocto_cellular.h.

const Y_CELLTYPE_enum YCellular::CELLTYPE_EGPRS = Y_CELLTYPE_EGPRS
static

Definition at line 207 of file yocto_cellular.h.

const Y_CELLTYPE_enum YCellular::CELLTYPE_GPRS = Y_CELLTYPE_GPRS
static

Definition at line 206 of file yocto_cellular.h.

const Y_CELLTYPE_enum YCellular::CELLTYPE_HSDPA = Y_CELLTYPE_HSDPA
static

Definition at line 209 of file yocto_cellular.h.

const Y_CELLTYPE_enum YCellular::CELLTYPE_INVALID = Y_CELLTYPE_INVALID
static

Definition at line 212 of file yocto_cellular.h.

const Y_CELLTYPE_enum YCellular::CELLTYPE_NONE = Y_CELLTYPE_NONE
static

Definition at line 210 of file yocto_cellular.h.

const Y_CELLTYPE_enum YCellular::CELLTYPE_WCDMA = Y_CELLTYPE_WCDMA
static

Definition at line 208 of file yocto_cellular.h.

const string YCellular::COMMAND_INVALID = YAPI_INVALID_STRING
static

Definition at line 230 of file yocto_cellular.h.

const int YCellular::DATARECEIVED_INVALID = YAPI_INVALID_UINT
static

Definition at line 229 of file yocto_cellular.h.

const int YCellular::DATASENT_INVALID = YAPI_INVALID_UINT
static

Definition at line 228 of file yocto_cellular.h.

const Y_ENABLEDATA_enum YCellular::ENABLEDATA_HOMENETWORK = Y_ENABLEDATA_HOMENETWORK
static

Definition at line 220 of file yocto_cellular.h.

const Y_ENABLEDATA_enum YCellular::ENABLEDATA_INVALID = Y_ENABLEDATA_INVALID
static

Definition at line 224 of file yocto_cellular.h.

const Y_ENABLEDATA_enum YCellular::ENABLEDATA_NEUTRALITY = Y_ENABLEDATA_NEUTRALITY
static

Definition at line 223 of file yocto_cellular.h.

const Y_ENABLEDATA_enum YCellular::ENABLEDATA_NEVER = Y_ENABLEDATA_NEVER
static

Definition at line 222 of file yocto_cellular.h.

const Y_ENABLEDATA_enum YCellular::ENABLEDATA_ROAMING = Y_ENABLEDATA_ROAMING
static

Definition at line 221 of file yocto_cellular.h.

const string YCellular::IMSI_INVALID = YAPI_INVALID_STRING
static

Definition at line 213 of file yocto_cellular.h.

const int YCellular::LINKQUALITY_INVALID = YAPI_INVALID_UINT
static

Definition at line 203 of file yocto_cellular.h.

const string YCellular::LOCKEDOPERATOR_INVALID = YAPI_INVALID_STRING
static

Definition at line 216 of file yocto_cellular.h.

const string YCellular::MESSAGE_INVALID = YAPI_INVALID_STRING
static

Definition at line 214 of file yocto_cellular.h.

const string YCellular::PIN_INVALID = YAPI_INVALID_STRING
static

Definition at line 215 of file yocto_cellular.h.

const int YCellular::PINGINTERVAL_INVALID = YAPI_INVALID_UINT
static

Definition at line 227 of file yocto_cellular.h.


The documentation for this class was generated from the following files:


yoctopuce_altimeter
Author(s): Anja Sheppard
autogenerated on Mon Jun 10 2019 15:49:13