Signal

The Signal class represents an Signal as defined in the app's app.json.

Methods

cmd

(async) cmd(commandId, optsopt): Promise.<any>

Transmit a command

Parameters

Name Type Description
commandId
string

The ID of the command, as specified in /app.json

opts
object <optional>

Transmission options

repetitions
object <optional>

A custom amount of repetitions. 1 means 1 transmit in total, 2 means 2 transmits in total, etc.

device
Device <optional>

The device being transmitted to

}

Returns

Promise.<any>

disableRX

(async) disableRX(): Promise.<void>

Stop receiving messages for this signal. This is a shorthand method for ManagerRF#disableSignalRX.

Returns

Promise.<void>

enableRX

(async) enableRX(): Promise.<void>

Start receiving messages for this signal. This is a shorthand method for ManagerRF#enableSignalRX.

Returns

Promise.<void>

tx

(async) tx(frame, optsopt): Promise.<any>

Transmit a frame

Parameters

Name Type Description
frame
Array.<number>

An array of word indexes

opts
object <optional>

Transmission options

repetitions
object <optional>

A custom amount of repetitions. 1 means 1 transmit in total, 2 means 2 transmits in total, etc.

device
Device <optional>

The device being transmitted to

}

Returns

Promise.<any>

Events

cmd

.on('cmd')

This event is fired when a signal command has been received.

Parameters

Name Type Description
commandId
string

The ID of the command, as specified in /app.json

payload

.on('payload')

This event is fired when a signal payload has been received.

Parameters

Name Type Description
payload
Array.<number>

An array of word indexes

first
boolean

If this is the first detected repetition