Namespace hcap.bluetooth

hcap.bluetooth

Namespace Summary
Constructor Attributes Constructor Name and Description
 

Method Summary

Namespace Detail

hcap.bluetooth

Method Detail

  • <static> hcap.bluetooth.disconnect(param)
    Disconnects the device paired with the given bluetooth service profile.
    hcap.bluetooth.disconnect({
         "service" : "audio_sink",
         "address" : "00:1f:47:e2:04:3f",
         "onSuccess" : function() {
             console.log("onSuccess");
         }, 
         "onFailure" : function(f) {
             console.log("onFailure : errorMessage = " + f.errorMessage);
         }
    });
    Parameters:
    {Object} param
    • {String} param.service [Required] - service profile ("hid" : HID profile / "audio" : audio src(A2DP) profile / "opc" : OPC profile / "audio_sink" : audio sink(A2DP) profile)
    • {String} param.address [Required] - BD (Bluetooth Device) address
    • {Function} param.onSuccess [Optional] - success callback function.
        param.onSuccess = function() {
            // No Parameter. 
        }
    • {Function} param.onFailure [Optional] - failure callback function.
        param.onFailure = function (param) {
            // {String} param.errorMessage - in case of failure, this message provides the details.
        }
    Since:
    1.19.0
    See:
    {Event} bluetooth_event_received
    hcap.bluetooth.setScanState()
  • <static> hcap.bluetooth.getBluetoothSoundSync(param)
    Gets whether bluetooth sound sync application is enabled or disabled.
    hcap.bluetooth.getBluetoothSoundSync({
         "onSuccess" : function (param) {
             console.log("onSuccess : bluetooth sound sync = " + param.enable);
         }, 
         "onFailure" : function(f) {
             console.log("onFailure : errorMessage = " + f.errorMessage);
         }
    });
    Parameters:
    {Object} param
    • {Function} param.onSuccess [Optional] - success callback function.
        param.onSuccess = function (param) {
            // {Boolean} param.enable - true if the bluetooth sound sync application is enabled. false if the bluetooth sound sync application is disabled.
        }
    • {Function} param.onFailure [Optional] - failure callback function.
        param.onFailure = function (param) {
            // {String} param.errorMessage - in case of failure, this message provides the details.
        }
    Since:
    1.20.1
    See:
    hcap.bluetooth.setBluetoothSoundSync()
  • <static> hcap.bluetooth.setBluetoothSoundSync(param)
    Sets the bluetooth sound sync application is enabled or disabled.
    hcap.bluetooth.setBluetoothSoundSync({
         "enable" : true,
         "onSuccess" : function() {
             console.log("onSuccess");
         }, 
         "onFailure" : function(f) {
             console.log("onFailure : errorMessage = " + f.errorMessage);
         }
    });
    Parameters:
    {Object} param
    • {Boolean} param.enable [Required] - true : enable to bluetooth sound sync application, false : disable.
    • {Function} param.onSuccess [Optional] - success callback function.
        param.onSuccess = function() {
            // No Parameter. 
        }
    • {Function} param.onFailure [Optional] - failure callback function.
        param.onFailure = function (param) {
            // {String} param.errorMessage - in case of failure, this message provides the details.
        }
    Since:
    1.20.1
    See:
    hcap.bluetooth.getBluetoothSoundSync()
    {Event} ui_value_changed
  • <static> hcap.bluetooth.setScanState(param)
    Sets the scan configuration such as visibility and connectability of the local device as a bluetooth device.
    We highly recommend not to change the connectability.
    hcap.bluetooth.setScanState({
         "visible" : true,
         "connectable" : true,
         "onSuccess" : function() {
             console.log("onSuccess");
         }, 
         "onFailure" : function(f) {
             console.log("onFailure : errorMessage = " + f.errorMessage);
         }
    });
    Parameters:
    {Object} param
    • {Boolean} param.visible [Required] - true : visible to other bluetooth devices, false : invisible.
    • {Boolean} param.connectable [Required] - true : connectable to other bluetooth devices, false : unconnectable.
    • {Function} param.onSuccess [Optional] - success callback function.
        param.onSuccess = function() {
            // No Parameter. 
        }
    • {Function} param.onFailure [Optional] - failure callback function.
        param.onFailure = function (param) {
            // {String} param.errorMessage - in case of failure, this message provides the details.
        }
    Since:
    1.19.0
    See:
    {Event} bluetooth_event_received
    hcap.bluetooth.disconnect()