AbstractDeviceService

AbstractDeviceService ⇐ Abstract

Kind: global abstract class
Extends: Abstract
Service:

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

ParamTypeDefaultDescription
[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

ParamTypeDefaultDescription
[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

ParamTypeDefaultDescription
[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

ParamTypeDefaultDescription
[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

ParamTypeDescription
[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

ParamTypeDescription
[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

ParamTypeDescription
[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

ParamTypeDescription
[params]Object

Device parameters

_onPairingDone([data]) ⇒ Promise

Kind: instance method of AbstractDeviceService
Access: protected

ParamType
[data]object

_onPairingProgress(progress) ⇒ Promise

Kind: instance method of AbstractDeviceService
Access: protected

ParamTypeDescription
progressnumber

Paring progress.

_onPairingError(error) ⇒ Promise

Kind: instance method of AbstractDeviceService
Access: protected

ParamTypeDescription
errorError

Pairing error.

_onUnpairingDone([data]) ⇒ Promise

Kind: instance method of AbstractDeviceService
Access: protected

ParamType
[data]object

_onUnpairingError(error) ⇒ Promise

Kind: instance method of AbstractDeviceService
Access: protected

ParamTypeDescription
errorError

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