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 int |
_linkQuality |
protected int |
_linkState |
protected int |
_mute |
protected String |
_ownAddress |
protected String |
_pairingPin |
protected int |
_preAmplifier |
protected String |
_remoteAddress |
protected String |
_remoteName |
protected YBluetoothLink.UpdateCallback |
_valueCallbackBluetoothLink |
protected int |
_volume |
static String |
COMMAND_INVALID
invalid command value
|
static int |
LINKQUALITY_INVALID
invalid linkQuality value
|
static int |
LINKSTATE_DOWN
invalid linkState value
|
static int |
LINKSTATE_EXISTS |
static int |
LINKSTATE_FREE |
static int |
LINKSTATE_INVALID |
static int |
LINKSTATE_LINKED |
static int |
LINKSTATE_PLAY |
static int |
LINKSTATE_SEARCH |
static int |
MUTE_FALSE
invalid mute value
|
static int |
MUTE_INVALID |
static int |
MUTE_TRUE |
static String |
OWNADDRESS_INVALID
invalid ownAddress value
|
static String |
PAIRINGPIN_INVALID
invalid pairingPin value
|
static int |
PREAMPLIFIER_INVALID
invalid preAmplifier value
|
static String |
REMOTEADDRESS_INVALID
invalid remoteAddress value
|
static String |
REMOTENAME_INVALID
invalid remoteName value
|
static int |
VOLUME_INVALID
invalid volume 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 |
YBluetoothLink(String func) |
protected |
YBluetoothLink(YAPIContext ctx,
String func) |
Modifier and Type | Method and Description |
---|---|
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(com.yoctopuce.YoctoAPI.YJSONObject 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 Bluetooth sound controller for a given identifier.
|
static YBluetoothLink |
FindBluetoothLinkInContext(YAPIContext yctx,
String func)
Retrieves a Bluetooth sound controller for a given identifier in a YAPI context.
|
static YBluetoothLink |
FirstBluetoothLink()
Starts the enumeration of Bluetooth sound controllers currently accessible.
|
static YBluetoothLink |
FirstBluetoothLinkInContext(YAPIContext yctx)
Starts the enumeration of Bluetooth sound controllers currently accessible.
|
String |
get_command() |
int |
get_linkQuality()
Returns the bluetooth receiver signal strength, in pourcents, or 0 if no connection is established.
|
int |
get_linkState()
Returns the bluetooth link state.
|
int |
get_mute()
Returns the state of the mute function.
|
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.
|
int |
get_preAmplifier()
Returns the audio pre-amplifier volume, in per cents.
|
String |
get_remoteAddress()
Returns the MAC-48 address of the remote device to connect to.
|
String |
get_remoteName()
Returns the bluetooth name the remote device, if found on the bluetooth network.
|
int |
get_volume()
Returns the connected headset volume, in per cents.
|
int |
getLinkQuality()
Returns the bluetooth receiver signal strength, in pourcents, or 0 if no connection is established.
|
int |
getLinkState()
Returns the bluetooth link state.
|
int |
getMute()
Returns the state of the mute function.
|
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.
|
int |
getPreAmplifier()
Returns the audio pre-amplifier volume, in per cents.
|
String |
getRemoteAddress()
Returns the MAC-48 address of the remote device to connect to.
|
String |
getRemoteName()
Returns the bluetooth name the remote device, if found on the bluetooth network.
|
int |
getVolume()
Returns the connected headset volume, in per cents.
|
YBluetoothLink |
nextBluetoothLink()
Continues the enumeration of Bluetooth sound controllers 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_mute(int newval)
Changes the state of the mute function.
|
int |
set_pairingPin(String newval)
Changes the PIN code used by the module for bluetooth pairing.
|
int |
set_preAmplifier(int newval)
Changes the audio pre-amplifier volume, in per cents.
|
int |
set_remoteAddress(String newval)
Changes the MAC-48 address defining which remote device to connect to.
|
int |
set_volume(int newval)
Changes the connected headset volume, in per cents.
|
int |
setMute(int newval)
Changes the state of the mute function.
|
int |
setPairingPin(String newval)
Changes the PIN code used by the module for bluetooth pairing.
|
int |
setPreAmplifier(int newval)
Changes the audio pre-amplifier volume, in per cents.
|
int |
setRemoteAddress(String newval)
Changes the MAC-48 address defining which remote device to connect to.
|
int |
setVolume(int newval)
Changes the connected headset volume, in per cents.
|
_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 String OWNADDRESS_INVALID
public static final String PAIRINGPIN_INVALID
public static final String REMOTEADDRESS_INVALID
public static final String REMOTENAME_INVALID
public static final int MUTE_FALSE
public static final int MUTE_TRUE
public static final int MUTE_INVALID
public static final int PREAMPLIFIER_INVALID
public static final int VOLUME_INVALID
public static final int LINKSTATE_DOWN
public static final int LINKSTATE_FREE
public static final int LINKSTATE_SEARCH
public static final int LINKSTATE_EXISTS
public static final int LINKSTATE_LINKED
public static final int LINKSTATE_PLAY
public static final int LINKSTATE_INVALID
public static final int LINKQUALITY_INVALID
public static final String COMMAND_INVALID
protected String _ownAddress
protected String _pairingPin
protected String _remoteAddress
protected String _remoteName
protected int _mute
protected int _preAmplifier
protected int _volume
protected int _linkState
protected int _linkQuality
protected String _command
protected YBluetoothLink.UpdateCallback _valueCallbackBluetoothLink
protected YBluetoothLink(YAPIContext ctx, String func)
func
- : functionidprotected YBluetoothLink(String func)
func
- : functionidprotected void _parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) throws Exception
_parseAttr
in class YFunction
Exception
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_remoteName() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getRemoteName() throws YAPI_Exception
YAPI_Exception
- on errorpublic int get_mute() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getMute() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_mute(int newval) throws YAPI_Exception
newval
- : either YBluetoothLink.MUTE_FALSE or YBluetoothLink.MUTE_TRUE, according to the
state of the mute functionYAPI_Exception
- on errorpublic int setMute(int newval) throws YAPI_Exception
newval
- : either YBluetoothLink.MUTE_FALSE or YBluetoothLink.MUTE_TRUE, according to the
state of the mute functionYAPI_Exception
- on errorpublic int get_preAmplifier() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getPreAmplifier() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_preAmplifier(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the audio pre-amplifier volume, in per centsYAPI_Exception
- on errorpublic int setPreAmplifier(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the audio pre-amplifier volume, in per centsYAPI_Exception
- on errorpublic int get_volume() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getVolume() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_volume(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the connected headset volume, in per centsYAPI_Exception
- on errorpublic int setVolume(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the connected headset volume, in per centsYAPI_Exception
- on errorpublic int get_linkState() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getLinkState() throws YAPI_Exception
YAPI_Exception
- on errorpublic int get_linkQuality() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getLinkQuality() throws YAPI_Exception
YAPI_Exception
- on errorpublic String get_command() throws YAPI_Exception
YAPI_Exception
public int set_command(String newval) throws YAPI_Exception
YAPI_Exception
public static YBluetoothLink FindBluetoothLink(String func)
func
- : a string that uniquely characterizes the Bluetooth sound controller, for instance
MyDevice.bluetoothLink1.public static YBluetoothLink FindBluetoothLinkInContext(YAPIContext yctx, String func)
yctx
- : a YAPI contextfunc
- : a string that uniquely characterizes the Bluetooth sound controller, for instance
MyDevice.bluetoothLink1.public 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()
public static YBluetoothLink FirstBluetoothLinkInContext(YAPIContext yctx)
yctx
- : a YAPI context.Copyright © 2022. All rights reserved.