AbstractDeviceService
On this page
- AbstractDeviceService ⇐
Abstract- AbstractDeviceService()
- getAvailableDevices([params]) ⇒
Promise.<Array.<AbstractDevice>, Error> - pair([params]) ⇒
Promise - getPairedDeviceList([params]) ⇒
Promise.<Array.<String>, Error> - unpair([params]) ⇒
Promise - _getAvailableDevices([params]) ⇒
Promise.<Array.<String>, Error> - _pair([params]) ⇒
Promise.<*, Error> - _getPairedDeviceList([params]) ⇒
Promise.<Array.<String>, Error> - _unpair([params]) ⇒
Promise.<*, Error> - _onPairingDone([data]) ⇒
Promise - _onPairingProgress(progress) ⇒
Promise - _onPairingError(error) ⇒
Promise - _onUnpairingDone([data]) ⇒
Promise - _onUnpairingError(error) ⇒
Promise - “pairingDone”
- “pairingProgress”
- “pairingError”
- “pairingDone”
- “pairingError”
AbstractDeviceService ⇐ Abstract
Kind: global abstract class
Extends: Abstract
Service:
- AbstractDeviceService ⇐
Abstract- new AbstractDeviceService()
- .getAvailableDevices([params]) ⇒
Promise.<Array.<AbstractDevice>, Error> - .pair([params]) ⇒
Promise - .getPairedDeviceList([params]) ⇒
Promise.<Array.<String>, Error> - .unpair([params]) ⇒
Promise - ._getAvailableDevices([params]) ⇒
Promise.<Array.<String>, Error> - ._pair([params]) ⇒
Promise.<*, Error> - ._getPairedDeviceList([params]) ⇒
Promise.<Array.<String>, Error> - ._unpair([params]) ⇒
Promise.<*, Error> - ._onPairingDone([data]) ⇒
Promise - ._onPairingProgress(progress) ⇒
Promise - ._onPairingError(error) ⇒
Promise - ._onUnpairingDone([data]) ⇒
Promise - ._onUnpairingError(error) ⇒
Promise - “pairingDone”
- “pairingProgress”
- “pairingError”
- “pairingDone”
- “pairingError”
AbstractDeviceService()
Service to handle device feature. This service manage the uses cases when the STB is in discover mode and will make the pairing with the external devices.
getAvailableDevices([params]) ⇒ Promise.<Array.<AbstractDevice>, Error>
Allows to discover the available devices
Kind: instance method of AbstractDeviceService
Returns: Promise.<Array.<AbstractDevice>, Error> - List of available devices
| Param | Type | Default | Description |
|---|---|---|---|
| [params] | Object | ||
| [params.type] | String | $DeviceTypeConst.TYPE_ALL | Device type (default 'TYPE_ALL') |
| [params.connection] | Number | $DeviceConnectionTypeConst.ALL | Device connection type (default 'ALL') |
| [params.unknownOnly] | Boolean | True for getting only available devices that have not yet been configured by user |
pair([params]) ⇒ Promise
Allows to pair a device Note: AbstractDeviceService#pairingProgress must be trigger by implementation
Kind: instance method of AbstractDeviceService
Emits: pairingProgress, pairingDone
| Param | Type | Default | Description |
|---|---|---|---|
| [params] | Object | The device parameters | |
| [params.type] | String | $DeviceTypeConst.TYPE_ALL | Device type (default 'TYPE_ALL') |
| [params.connection] | Number | $DeviceConnectionTypeConst.ALL | Device connection type (default 'ALL') |
| [params.deviceId] | String | Optional device id |
getPairedDeviceList([params]) ⇒ Promise.<Array.<String>, Error>
Allows to retrieve the list of all paired devices name
Kind: instance method of AbstractDeviceService
Returns: Promise.<Array.<String>, Error> - List of paired devices name
| Param | Type | Default | Description |
|---|---|---|---|
| [params] | Object | ||
| [params.type] | String | $DeviceTypeConst.TYPE_ALL | Device type (default 'TYPE_ALL') |
| [params.connection] | Number | $DeviceConnectionTypeConst.ALL | Device connection type (default 'ALL') |
unpair([params]) ⇒ Promise
Allows to unpair a device
Kind: instance method of AbstractDeviceService
Emits: AbstractDeviceService#event:unpairingDone
| Param | Type | Default | Description |
|---|---|---|---|
| [params] | Object | The device parameters | |
| [params.type] | String | $DeviceTypeConst.TYPE_ALL | Device type (default 'TYPE_ALL') |
| [params.connection] | Number | $DeviceConnectionTypeConst.ALL | Device connection type (default 'ALL') |
| [params.deviceId] | String | Optional device id |
_getAvailableDevices([params]) ⇒ Promise.<Array.<String>, Error>
Kind: instance abstract method of AbstractDeviceService
Returns: Promise.<Array.<String>, Error> - List of paired devices name
Access: protected
| Param | Type | Description |
|---|---|---|
| [params] | Object | Device parameters |
_pair([params]) ⇒ Promise.<*, Error>
Kind: instance abstract method of AbstractDeviceService
Returns: Promise.<*, Error> - Promise resolved when pairing is done
Access: protected
| Param | Type | Description |
|---|---|---|
| [params] | Object | Device parameters |
_getPairedDeviceList([params]) ⇒ Promise.<Array.<String>, Error>
Kind: instance abstract method of AbstractDeviceService
Returns: Promise.<Array.<String>, Error> - List of paired devices name
Access: protected
| Param | Type | Description |
|---|---|---|
| [params] | Object | Device parameters |
_unpair([params]) ⇒ Promise.<*, Error>
Kind: instance abstract method of AbstractDeviceService
Returns: Promise.<*, Error> - Promise resolved when unpairing is done
Access: protected
| Param | Type | Description |
|---|---|---|
| [params] | Object | Device parameters |
_onPairingDone([data]) ⇒ Promise
Kind: instance method of AbstractDeviceService
Access: protected
| Param | Type |
|---|---|
| [data] | object |
_onPairingProgress(progress) ⇒ Promise
Kind: instance method of AbstractDeviceService
Access: protected
| Param | Type | Description |
|---|---|---|
| progress | number | Paring progress. |
_onPairingError(error) ⇒ Promise
Kind: instance method of AbstractDeviceService
Access: protected
| Param | Type | Description |
|---|---|---|
| error | Error | Pairing error. |
_onUnpairingDone([data]) ⇒ Promise
Kind: instance method of AbstractDeviceService
Access: protected
| Param | Type |
|---|---|
| [data] | object |
_onUnpairingError(error) ⇒ Promise
Kind: instance method of AbstractDeviceService
Access: protected
| Param | Type | Description |
|---|---|---|
| error | Error | Unpairing error. |
“pairingDone”
Fired when the pairing is done.
Kind: event emitted by AbstractDeviceService
“pairingProgress”
Fired when the pairing is in progress.
Kind: event emitted by AbstractDeviceService
“pairingError”
Fired when the pairing is on error.
Kind: event emitted by AbstractDeviceService
“pairingDone”
Fired when the pairing is done.
Kind: event emitted by AbstractDeviceService
“pairingError”
Fired when the pairing is on error.
Kind: event emitted by AbstractDeviceService