public class YCellular extends YFunction
Modifier and Type | Class and Description |
---|---|
static interface |
YCellular.TimedReportCallback
TimedReportCallback for Cellular
|
static interface |
YCellular.UpdateCallback
Deprecated UpdateCallback for Cellular
|
Modifier and Type | Field and Description |
---|---|
protected int |
_airplaneMode |
protected String |
_apn |
protected String |
_apnSecret |
protected String |
_cellIdentifier |
protected String |
_cellOperator |
protected int |
_cellType |
protected String |
_command |
protected int |
_dataReceived |
protected int |
_dataSent |
protected int |
_enableData |
protected String |
_imsi |
protected int |
_linkQuality |
protected String |
_lockedOperator |
protected String |
_message |
protected String |
_pin |
protected int |
_pingInterval |
protected String |
_radioConfig |
protected YCellular.UpdateCallback |
_valueCallbackCellular |
static int |
AIRPLANEMODE_INVALID |
static int |
AIRPLANEMODE_OFF
invalid airplaneMode value
|
static int |
AIRPLANEMODE_ON |
static String |
APN_INVALID
invalid apn value
|
static String |
APNSECRET_INVALID
invalid apnSecret value
|
static String |
CELLIDENTIFIER_INVALID
invalid cellIdentifier value
|
static String |
CELLOPERATOR_INVALID
invalid cellOperator value
|
static int |
CELLTYPE_CDMA |
static int |
CELLTYPE_EC_GSM_IOT |
static int |
CELLTYPE_EGPRS |
static int |
CELLTYPE_GPRS
invalid cellType value
|
static int |
CELLTYPE_HSDPA |
static int |
CELLTYPE_INVALID |
static int |
CELLTYPE_LTE_M |
static int |
CELLTYPE_NB_IOT |
static int |
CELLTYPE_NONE |
static int |
CELLTYPE_WCDMA |
static String |
COMMAND_INVALID
invalid command value
|
static int |
DATARECEIVED_INVALID
invalid dataReceived value
|
static int |
DATASENT_INVALID
invalid dataSent value
|
static int |
ENABLEDATA_HOMENETWORK
invalid enableData value
|
static int |
ENABLEDATA_INVALID |
static int |
ENABLEDATA_NEUTRALITY |
static int |
ENABLEDATA_NEVER |
static int |
ENABLEDATA_ROAMING |
static String |
IMSI_INVALID
invalid imsi value
|
static int |
LINKQUALITY_INVALID
invalid linkQuality value
|
static String |
LOCKEDOPERATOR_INVALID
invalid lockedOperator value
|
static String |
MESSAGE_INVALID
invalid message value
|
static String |
PIN_INVALID
invalid pin value
|
static int |
PINGINTERVAL_INVALID
invalid pingInterval value
|
static String |
RADIOCONFIG_INVALID
invalid radioConfig value
|
_advertisedValue, _cacheExpiration, _className, _dataStreams, _func, _funId, _hwId, _lastErrorMsg, _lastErrorType, _logicalName, _serial, _userData, _valueCallbackFunction, _yapi, ADVERTISEDVALUE_INVALID, FUNCTIONDESCRIPTOR_INVALID, LOGICALNAME_INVALID
Modifier | Constructor and Description |
---|---|
protected |
YCellular(String func) |
protected |
YCellular(YAPIContext ctx,
String func) |
Modifier and Type | Method and Description |
---|---|
String |
_AT(String cmd)
Sends an AT command to the GSM module and returns the command output.
|
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) |
int |
clearDataCounters()
Clear the transmitted data counters.
|
static YCellular |
FindCellular(String func)
Retrieves a cellular interface for a given identifier.
|
static YCellular |
FindCellularInContext(YAPIContext yctx,
String func)
Retrieves a cellular interface for a given identifier in a YAPI context.
|
static YCellular |
FirstCellular()
Starts the enumeration of cellular interfaces currently accessible.
|
static YCellular |
FirstCellularInContext(YAPIContext yctx)
Starts the enumeration of cellular interfaces currently accessible.
|
int |
get_airplaneMode()
Returns true if the airplane mode is active (radio turned off).
|
String |
get_apn()
Returns the Access Point Name (APN) to be used, if needed.
|
String |
get_apnSecret()
Returns an opaque string if APN authentication parameters have been configured
in the device, or an empty string otherwise.
|
ArrayList<String> |
get_availableOperators()
Returns the list detected cell operators in the neighborhood.
|
String |
get_cellIdentifier()
Returns the unique identifier of the cellular antenna in use: MCC, MNC, LAC and Cell ID.
|
String |
get_cellOperator()
Returns the name of the cell operator currently in use.
|
int |
get_cellType()
Active cellular connection type.
|
String |
get_command() |
int |
get_dataReceived()
Returns the number of bytes received so far.
|
int |
get_dataSent()
Returns the number of bytes sent so far.
|
int |
get_enableData()
Returns the condition for enabling IP data services (GPRS).
|
String |
get_imsi()
Returns the International Mobile Subscriber Identity (MSI) that uniquely identifies
the SIM card.
|
int |
get_linkQuality()
Returns the link quality, expressed in percent.
|
String |
get_lockedOperator()
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.
|
String |
get_message()
Returns the latest status message from the wireless interface.
|
String |
get_pin()
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.
|
int |
get_pingInterval()
Returns the automated connectivity check interval, in seconds.
|
String |
get_radioConfig()
Returns the type of protocol used over the serial line, as a string.
|
int |
getAirplaneMode()
Returns true if the airplane mode is active (radio turned off).
|
String |
getApn()
Returns the Access Point Name (APN) to be used, if needed.
|
String |
getApnSecret()
Returns an opaque string if APN authentication parameters have been configured
in the device, or an empty string otherwise.
|
String |
getCellIdentifier()
Returns the unique identifier of the cellular antenna in use: MCC, MNC, LAC and Cell ID.
|
String |
getCellOperator()
Returns the name of the cell operator currently in use.
|
int |
getCellType()
Active cellular connection type.
|
int |
getDataReceived()
Returns the number of bytes received so far.
|
int |
getDataSent()
Returns the number of bytes sent so far.
|
int |
getEnableData()
Returns the condition for enabling IP data services (GPRS).
|
String |
getImsi()
Returns the International Mobile Subscriber Identity (MSI) that uniquely identifies
the SIM card.
|
int |
getLinkQuality()
Returns the link quality, expressed in percent.
|
String |
getLockedOperator()
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.
|
String |
getMessage()
Returns the latest status message from the wireless interface.
|
String |
getPin()
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.
|
int |
getPingInterval()
Returns the automated connectivity check interval, in seconds.
|
String |
getRadioConfig()
Returns the type of protocol used over the serial line, as a string.
|
YCellular |
nextCellular()
Continues the enumeration of cellular interfaces started using yFirstCellular().
|
ArrayList<YCellRecord> |
quickCellSurvey()
Returns a list of nearby cellular antennas, as required for quick
geolocation of the device.
|
int |
registerValueCallback(YCellular.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
sendPUK(String puk,
String newPin)
Sends a PUK code to unlock the SIM card after three failed PIN code attempts, and
setup a new PIN into the SIM card.
|
int |
set_airplaneMode(int newval)
Changes the activation state of airplane mode (radio turned off).
|
int |
set_apn(String newval)
Returns the Access Point Name (APN) to be used, if needed.
|
int |
set_apnAuth(String username,
String password)
Configure authentication parameters to connect to the APN.
|
int |
set_apnSecret(String newval) |
int |
set_command(String newval) |
int |
set_dataReceived(int newval)
Changes the value of the incoming data counter.
|
int |
set_dataSent(int newval)
Changes the value of the outgoing data counter.
|
int |
set_enableData(int newval)
Changes the condition for enabling IP data services (GPRS).
|
int |
set_lockedOperator(String newval)
Changes the name of the cell operator to be used.
|
int |
set_pin(String newval)
Changes the PIN code used by the module to access the SIM card.
|
int |
set_pingInterval(int newval)
Changes the automated connectivity check interval, in seconds.
|
int |
set_radioConfig(String newval)
Changes the type of protocol used over the serial line.
|
int |
setAirplaneMode(int newval)
Changes the activation state of airplane mode (radio turned off).
|
int |
setApn(String newval)
Returns the Access Point Name (APN) to be used, if needed.
|
int |
setDataReceived(int newval)
Changes the value of the incoming data counter.
|
int |
setDataSent(int newval)
Changes the value of the outgoing data counter.
|
int |
setEnableData(int newval)
Changes the condition for enabling IP data services (GPRS).
|
int |
setLockedOperator(String newval)
Changes the name of the cell operator to be used.
|
int |
setPin(String newval)
Changes the PIN code used by the module to access the SIM card.
|
int |
setPingInterval(int newval)
Changes the automated connectivity check interval, in seconds.
|
int |
setRadioConfig(String newval)
Changes the type of protocol used over the serial line.
|
_AddToCache, _clearDataStreamCache, _download, _escapeAttr, _FindFromCache, _FindFromCacheInContext, _get_json_path_struct, _get_json_path, _json_get_array, _json_get_key, _json_get_string, _parse, _parserHelper, _setAttr, _throw, _UpdateTimedReportCallbackList, _UpdateValueCallbackList, _upload, _upload, _uploadEx, clearCache, describe, errMessage, errorMessage, errorType, errType, FindFunction, FindFunctionInContext, FirstFunction, FirstFunctionInContext, functionDescriptor, get_advertisedValue, get_errorMessage, get_errorType, get_friendlyName, get_functionDescriptor, get_functionId, get_hardwareId, get_logicalName, get_module, get_serialNumber, get_userData, getAdvertisedValue, getErrorMessage, getErrorType, getFriendlyName, getFunctionDescriptor, getFunctionId, getHardwareId, getLogicalName, getModule, getUserData, isOnline, isReadOnly, load, loadAttribute, module, muteValueCallbacks, nextFunction, registerValueCallback, set_advertisedValue, set_logicalName, set_userData, setLogicalName, setUserData, toString, unmuteValueCallbacks, userData
public static final int LINKQUALITY_INVALID
public static final String CELLOPERATOR_INVALID
public static final String CELLIDENTIFIER_INVALID
public static final int CELLTYPE_GPRS
public static final int CELLTYPE_EGPRS
public static final int CELLTYPE_WCDMA
public static final int CELLTYPE_HSDPA
public static final int CELLTYPE_NONE
public static final int CELLTYPE_CDMA
public static final int CELLTYPE_LTE_M
public static final int CELLTYPE_NB_IOT
public static final int CELLTYPE_EC_GSM_IOT
public static final int CELLTYPE_INVALID
public static final String IMSI_INVALID
public static final String MESSAGE_INVALID
public static final String PIN_INVALID
public static final String RADIOCONFIG_INVALID
public static final String LOCKEDOPERATOR_INVALID
public static final int AIRPLANEMODE_OFF
public static final int AIRPLANEMODE_ON
public static final int AIRPLANEMODE_INVALID
public static final int ENABLEDATA_HOMENETWORK
public static final int ENABLEDATA_ROAMING
public static final int ENABLEDATA_NEVER
public static final int ENABLEDATA_NEUTRALITY
public static final int ENABLEDATA_INVALID
public static final String APN_INVALID
public static final String APNSECRET_INVALID
public static final int PINGINTERVAL_INVALID
public static final int DATASENT_INVALID
public static final int DATARECEIVED_INVALID
public static final String COMMAND_INVALID
protected int _linkQuality
protected String _cellOperator
protected String _cellIdentifier
protected int _cellType
protected String _imsi
protected String _message
protected String _pin
protected String _radioConfig
protected String _lockedOperator
protected int _airplaneMode
protected int _enableData
protected String _apn
protected String _apnSecret
protected int _pingInterval
protected int _dataSent
protected int _dataReceived
protected String _command
protected YCellular.UpdateCallback _valueCallbackCellular
protected YCellular(YAPIContext ctx, String func)
func
- : functionidprotected YCellular(String func)
protected void _parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) throws Exception
_parseAttr
in class YFunction
Exception
public int get_linkQuality() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getLinkQuality() throws YAPI_Exception
YAPI_Exception
- on errorpublic String get_cellOperator() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getCellOperator() throws YAPI_Exception
YAPI_Exception
- on errorpublic String get_cellIdentifier() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getCellIdentifier() throws YAPI_Exception
YAPI_Exception
- on errorpublic int get_cellType() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getCellType() throws YAPI_Exception
YAPI_Exception
- on errorpublic String get_imsi() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getImsi() throws YAPI_Exception
YAPI_Exception
- on errorpublic String get_message() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getMessage() throws YAPI_Exception
YAPI_Exception
- on errorpublic String get_pin() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getPin() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_pin(String newval) throws YAPI_Exception
newval
- : a string corresponding to the PIN code used by the module to access the SIM cardYAPI_Exception
- on errorpublic int setPin(String newval) throws YAPI_Exception
newval
- : a string corresponding to the PIN code used by the module to access the SIM cardYAPI_Exception
- on errorpublic String get_radioConfig() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getRadioConfig() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_radioConfig(String newval) throws YAPI_Exception
newval
- : a string corresponding to the type of protocol used over the serial lineYAPI_Exception
- on errorpublic int setRadioConfig(String newval) throws YAPI_Exception
newval
- : a string corresponding to the type of protocol used over the serial lineYAPI_Exception
- on errorpublic String get_lockedOperator() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getLockedOperator() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_lockedOperator(String newval) throws YAPI_Exception
newval
- : a string corresponding to the name of the cell operator to be usedYAPI_Exception
- on errorpublic int setLockedOperator(String newval) throws YAPI_Exception
newval
- : a string corresponding to the name of the cell operator to be usedYAPI_Exception
- on errorpublic int get_airplaneMode() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getAirplaneMode() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_airplaneMode(int newval) throws YAPI_Exception
newval
- : either YCellular.AIRPLANEMODE_OFF or YCellular.AIRPLANEMODE_ON, according to the
activation state of airplane mode (radio turned off)YAPI_Exception
- on errorpublic int setAirplaneMode(int newval) throws YAPI_Exception
newval
- : either Y_AIRPLANEMODE_OFF or Y_AIRPLANEMODE_ON, according to the activation state
of airplane mode (radio turned off)YAPI_Exception
- on errorpublic int get_enableData() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getEnableData() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_enableData(int newval) throws YAPI_Exception
newval
- : a value among YCellular.ENABLEDATA_HOMENETWORK, YCellular.ENABLEDATA_ROAMING,
YCellular.ENABLEDATA_NEVER and YCellular.ENABLEDATA_NEUTRALITY corresponding to the condition for
enabling IP data services (GPRS)YAPI_Exception
- on errorpublic int setEnableData(int newval) throws YAPI_Exception
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)YAPI_Exception
- on errorpublic String get_apn() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getApn() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_apn(String newval) throws YAPI_Exception
newval
- : a stringYAPI_Exception
- on errorpublic int setApn(String newval) throws YAPI_Exception
newval
- : a stringYAPI_Exception
- on errorpublic String get_apnSecret() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getApnSecret() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_apnSecret(String newval) throws YAPI_Exception
YAPI_Exception
public int get_pingInterval() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getPingInterval() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_pingInterval(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the automated connectivity check interval, in secondsYAPI_Exception
- on errorpublic int setPingInterval(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the automated connectivity check interval, in secondsYAPI_Exception
- on errorpublic int get_dataSent() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getDataSent() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_dataSent(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the value of the outgoing data counterYAPI_Exception
- on errorpublic int setDataSent(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the value of the outgoing data counterYAPI_Exception
- on errorpublic int get_dataReceived() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getDataReceived() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_dataReceived(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the value of the incoming data counterYAPI_Exception
- on errorpublic int setDataReceived(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the value of the incoming data counterYAPI_Exception
- on errorpublic String get_command() throws YAPI_Exception
YAPI_Exception
public int set_command(String newval) throws YAPI_Exception
YAPI_Exception
public static YCellular FindCellular(String func)
func
- : a string that uniquely characterizes the cellular interface, for instance
YHUBGSM1.cellular.public static YCellular FindCellularInContext(YAPIContext yctx, String func)
yctx
- : a YAPI contextfunc
- : a string that uniquely characterizes the cellular interface, for instance
YHUBGSM1.cellular.public int registerValueCallback(YCellular.UpdateCallback callback)
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.public int _invokeValueCallback(String value)
_invokeValueCallback
in class YFunction
public int sendPUK(String puk, String newPin) throws YAPI_Exception
puk
- : the SIM PUK codenewPin
- : new PIN code to configure into the SIM cardYAPI_Exception
- on errorpublic int set_apnAuth(String username, String password) throws YAPI_Exception
username
- : APN usernamepassword
- : APN passwordYAPI_Exception
- on errorpublic int clearDataCounters() throws YAPI_Exception
YAPI_Exception
- on errorpublic String _AT(String cmd) throws YAPI_Exception
cmd
- : the AT command to execute, like for instance: "+CCLK?".YAPI_Exception
public ArrayList<String> get_availableOperators() throws YAPI_Exception
YAPI_Exception
public ArrayList<YCellRecord> quickCellSurvey() throws YAPI_Exception
YAPI_Exception
public YCellular nextCellular()
public static YCellular FirstCellular()
public static YCellular FirstCellularInContext(YAPIContext yctx)
yctx
- : a YAPI context.Copyright © 2020. All rights reserved.