- Since:
- v344
Internal object provides API to work with Bluetooth profile.
Not accessible in global scope.
Can't be manually created but can be received in stbBluetoothDevice
object.
Members
(static) active :boolean
Bluetooth profile connection state.
Type:
- boolean
(static) onOpen :stbBluetoothProfile~onOpenCallback
- Default Value:
- null
Event handler to be used when device profile is connected.
Alternative event name to use with stbBluetoothProfile.addEventListener
: open
.
Type:
(static) onClose :stbBluetoothProfile~onCloseCallback
- Default Value:
- null
Event handler to be used when device profile is connected.
Alternative event name to use with stbBluetoothProfile.addEventListener
: close
.
Type:
Methods
(static) addEventListener(name, callback)
Registers the specified listener.
Available events:
- open
- close
Parameters:
Name | Type | Description |
---|---|---|
name |
string | event name |
callback |
function | event callback function |
(static) removeEventListener(callback)
Removes the event listener previously registered.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | event callback function |
(static) open() → {boolean}
Open Bluetooth profile connection.
Returns:
operation status (false in case of errors or if already opened)
- Type
- boolean
(static) close() → {boolean}
Close Bluetooth profile connection.
Returns:
operation status (false in case of errors or if already closed)
- Type
- boolean
Type Definitions
onOpenCallback(status)
Event handler callback.
Examples
stbBluetoothProfile.onOpen = function ( status ) {
console.log('onOpen event', status);
};
stbBluetoothProfile.addEventListener('open', function ( status ) {
console.log('open listener', status);
});
Parameters:
Name | Type | Description |
---|---|---|
status |
boolean | operation status |
onCloseCallback()
Event handler callback.
Examples
stbBluetoothProfile.onClose = function () {
console.log('onClose event');
};
stbBluetoothProfile.addEventListener('close', function () {
console.log('close listener');
});