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 String |
_apn |
protected String |
_apnSecret |
protected String |
_cellOperator |
protected String |
_command |
protected int |
_enableData |
protected int |
_linkQuality |
protected String |
_lockedOperator |
protected String |
_message |
protected String |
_pin |
protected YCellular.UpdateCallback |
_valueCallbackCellular |
static String |
APN_INVALID
invalid apn value
|
static String |
APNSECRET_INVALID
invalid apnSecret value
|
static String |
CELLOPERATOR_INVALID
invalid cellOperator value
|
static String |
COMMAND_INVALID
invalid command value
|
static int |
ENABLEDATA_HOMENETWORK
invalid enableData value
|
static int |
ENABLEDATA_INVALID |
static int |
ENABLEDATA_NEVER |
static int |
ENABLEDATA_ROAMING |
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
|
_advertisedValue, _cacheExpiration, _className, _dataStreams, _func, _funId, _hwId, _lastErrorMsg, _lastErrorType, _logicalName, _serial, _userData, _valueCallbackFunction, ADVERTISEDVALUE_INVALID, FUNCTIONDESCRIPTOR_INVALID, LOGICALNAME_INVALID
Modifier | Constructor and Description |
---|---|
protected |
YCellular(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(org.json.JSONObject json_val) |
static YCellular |
FindCellular(String func)
Retrieves a cellular interface for a given identifier.
|
static YCellular |
FirstCellular()
Starts the enumeration of cellular interfaces currently accessible.
|
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.
|
String |
get_cellOperator()
Returns the name of the cell operator currently in use.
|
String |
get_command() |
int |
get_enableData()
Returns the condition for enabling IP data services (GPRS).
|
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.
|
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 |
getCellOperator()
Returns the name of the cell operator currently in use.
|
String |
getCommand() |
int |
getEnableData()
Returns the condition for enabling IP data services (GPRS).
|
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.
|
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_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_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 |
setApn(String newval)
Returns the Access Point Name (APN) to be used, if needed.
|
int |
setApnSecret(String newval) |
int |
setCommand(String newval) |
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.
|
_AddToCache, _devRequest, _download, _escapeAttr, _FindFromCache, _json_get_array, _json_get_key, _json_get_string, _parse, _parserHelper, _setAttr, _throw, _UpdateTimedReportCallbackList, _UpdateValueCallbackList, _upload, _upload, describe, errMessage, errorMessage, errorType, errType, FindFunction, FirstFunction, functionDescriptor, get_advertisedValue, get_errorMessage, get_errorType, get_friendlyName, get_functionDescriptor, get_functionId, get_hardwareId, get_logicalName, get_module, get_userData, getAdvertisedValue, getErrorMessage, getErrorType, getFriendlyName, getFunctionDescriptor, getFunctionId, getHardwareId, getLogicalName, getModule, getUserData, isOnline, load, module, nextFunction, registerValueCallback, set_logicalName, set_userData, setLogicalName, setUserData, toString, userData
public static final int LINKQUALITY_INVALID
public static final String CELLOPERATOR_INVALID
public static final String MESSAGE_INVALID
public static final String PIN_INVALID
public static final String LOCKEDOPERATOR_INVALID
public static final int ENABLEDATA_HOMENETWORK
public static final int ENABLEDATA_ROAMING
public static final int ENABLEDATA_NEVER
public static final int ENABLEDATA_INVALID
public static final String APN_INVALID
public static final String APNSECRET_INVALID
public static final String COMMAND_INVALID
protected int _linkQuality
protected String _cellOperator
protected String _message
protected String _pin
protected String _lockedOperator
protected int _enableData
protected String _apn
protected String _apnSecret
protected String _command
protected YCellular.UpdateCallback _valueCallbackCellular
protected YCellular(String func)
func
- : functionidprotected void _parseAttr(org.json.JSONObject json_val) throws org.json.JSONException
_parseAttr
in class YFunction
org.json.JSONException
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_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_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_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 and
YCellular.ENABLEDATA_NEVER 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 and Y_ENABLEDATA_NEVER
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 setApnSecret(String newval) throws YAPI_Exception
YAPI_Exception
public String get_command() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getCommand() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_command(String newval) throws YAPI_Exception
YAPI_Exception
public int setCommand(String newval) throws YAPI_Exception
YAPI_Exception
public static YCellular FindCellular(String func)
func
- : a string that uniquely characterizes the cellular interfacepublic 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 String _AT(String cmd) throws YAPI_Exception
cmd
- : the AT command to execute, like for instance: "+CCLK?".YAPI_Exception
public ArrayList<YCellRecord> quickCellSurvey() throws YAPI_Exception
YAPI_Exception
public YCellular nextCellular()
public static YCellular FirstCellular()
Copyright © 2015. All rights reserved.