public class YBluetoothLink extends YFunction
Modifier and Type | Class and Description |
---|---|
static interface |
YBluetoothLink.TimedReportCallback
TimedReportCallback for BluetoothLink
|
static interface |
YBluetoothLink.UpdateCallback
Deprecated UpdateCallback for BluetoothLink
|
Modifier and Type | Field and Description |
---|---|
protected String |
_command |
protected String |
_message |
protected String |
_ownAddress |
protected String |
_pairingPin |
protected String |
_remoteAddress |
protected YBluetoothLink.UpdateCallback |
_valueCallbackBluetoothLink |
static String |
COMMAND_INVALID
invalid command value
|
static String |
MESSAGE_INVALID
invalid message value
|
static String |
OWNADDRESS_INVALID
invalid ownAddress value
|
static String |
PAIRINGPIN_INVALID
invalid pairingPin value
|
static String |
REMOTEADDRESS_INVALID
invalid remoteAddress 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 |
YBluetoothLink(String func) |
Modifier and Type | Method and Description |
---|---|
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(org.json.JSONObject json_val) |
int |
connect()
Attempt to connect to the previously selected remote device.
|
int |
disconnect()
Disconnect from the previously selected remote device.
|
static YBluetoothLink |
FindBluetoothLink(String func)
Retrieves a cellular interface for a given identifier.
|
static YBluetoothLink |
FirstBluetoothLink()
Starts the enumeration of cellular interfaces currently accessible.
|
String |
get_command() |
String |
get_message()
Returns the latest status message from the bluetooth interface.
|
String |
get_ownAddress()
Returns the MAC-48 address of the bluetooth interface, which is unique on the bluetooth network.
|
String |
get_pairingPin()
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 |
get_remoteAddress()
Returns the MAC-48 address of the remote device to connect to.
|
String |
getCommand() |
String |
getMessage()
Returns the latest status message from the bluetooth interface.
|
String |
getOwnAddress()
Returns the MAC-48 address of the bluetooth interface, which is unique on the bluetooth network.
|
String |
getPairingPin()
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 |
getRemoteAddress()
Returns the MAC-48 address of the remote device to connect to.
|
YBluetoothLink |
nextBluetoothLink()
Continues the enumeration of cellular interfaces started using yFirstBluetoothLink().
|
int |
registerValueCallback(YBluetoothLink.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
set_command(String newval) |
int |
set_pairingPin(String newval)
Changes the PIN code used by the module for bluetooth pairing.
|
int |
set_remoteAddress(String newval)
Changes the MAC-48 address defining which remote device to connect to.
|
int |
setCommand(String newval) |
int |
setPairingPin(String newval)
Changes the PIN code used by the module for bluetooth pairing.
|
int |
setRemoteAddress(String newval)
Changes the MAC-48 address defining which remote device to connect to.
|
_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 String OWNADDRESS_INVALID
public static final String PAIRINGPIN_INVALID
public static final String REMOTEADDRESS_INVALID
public static final String MESSAGE_INVALID
public static final String COMMAND_INVALID
protected String _ownAddress
protected String _pairingPin
protected String _remoteAddress
protected String _message
protected String _command
protected YBluetoothLink.UpdateCallback _valueCallbackBluetoothLink
protected YBluetoothLink(String func)
func
- : functionidprotected void _parseAttr(org.json.JSONObject json_val) throws org.json.JSONException
_parseAttr
in class YFunction
org.json.JSONException
public String get_ownAddress() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getOwnAddress() throws YAPI_Exception
YAPI_Exception
- on errorpublic String get_pairingPin() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getPairingPin() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_pairingPin(String newval) throws YAPI_Exception
newval
- : a string corresponding to the PIN code used by the module for bluetooth pairingYAPI_Exception
- on errorpublic int setPairingPin(String newval) throws YAPI_Exception
newval
- : a string corresponding to the PIN code used by the module for bluetooth pairingYAPI_Exception
- on errorpublic String get_remoteAddress() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getRemoteAddress() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_remoteAddress(String newval) throws YAPI_Exception
newval
- : a string corresponding to the MAC-48 address defining which remote device to connect toYAPI_Exception
- on errorpublic int setRemoteAddress(String newval) throws YAPI_Exception
newval
- : a string corresponding to the MAC-48 address defining which remote device to connect toYAPI_Exception
- on errorpublic String get_message() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getMessage() throws YAPI_Exception
YAPI_Exception
- on errorpublic 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 YBluetoothLink FindBluetoothLink(String func)
func
- : a string that uniquely characterizes the cellular interfacepublic int registerValueCallback(YBluetoothLink.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 connect() throws YAPI_Exception
YAPI_Exception
- on errorpublic int disconnect() throws YAPI_Exception
YAPI_Exception
- on errorpublic YBluetoothLink nextBluetoothLink()
public static YBluetoothLink FirstBluetoothLink()
Copyright © 2015. All rights reserved.