Firmware-830 Command-001

From I-CubeX Wiki
Jump to: navigation, search

STREAM (1, 01h)

The STREAM command sets the port activation status for sensor input, ie. whether WiDig is sampling the port's sensor input, whether via I2C communication from a digital sensor or from an analog sensor, or whether the port is in "ghost" mode, ie. processing sensor input from an adjacent lower-numbered sensor input. Setting port 0 to ghost mode turns it on instead.

In stand-alone mode, only if a signal processing method has been selected (impulse and/or continuous signal processing, see EDIT CONFIG command) each port of the WiDig can be turned on or off for sensor input with the STREAM command. If no signal processing method has been selected the STREAM command has no effect. The activation status of the port for sensor input is stored in non-volatile memory as well as volatile memory for immediate use. Following the activation of a port for sensor input the MIDI message to which the sensor value(s) is/are mapped as set using EDIT CONFIG commands, is sent out by the WiDig. After a RESET command in stand-alone mode the activation status is retrieved from non-volatile memory - each port is turned on or off depending on whether any of the signal processing methods is activated for the first sensor input, whether from an analog or digital sensor.

In host mode the STREAM command has immediate effect and if the port is activated for sensor input, STREAM DATA messages or I2C DATA messages are output. The activation status of the port for sensor input is only stored in volatile memory for immediate use. After a RESET command in host mode each port is turned off for sensor input.

Upon completion of the command the WiDig sends out the same message.

The [BODY] of the STREAM command consists of a single 7-bit byte with the following format :

0x0g0yyy: x = 1; on (overrides ghost bit)
x = 0; off
g = 1; ghost on
g = 0; ghost off
yyy = [0..7]; port number, where the first port number = 0, and the last (8th) port number = 7

Example:

In order to turn on the 3rd port for sensor input, the following message is sent:

240, 125, 0 {DEV}, 1 {STREAM}, 66 {x = 1, g = 1 or g = 0, yyy = 02}, 247 (F0h, 7Dh, 00h, 01h, 42h, F7h)

In order to ghost the 2nd port's sensor input to the 3rd port, the following message is sent:

240, 125, 0 {DEV}, 1 {STREAM}, 66 {x = 0, g = 1, yyy = 02}, 247 (F0h, 7Dh, 00h, 01h, 42h, F7h)

In order to turn off the same port for sensor input, the following message is sent:

240, 125, 0 {DEV}, 1 {STREAM}, 2 {x = 0, g = 0, yyy = 02}, 247 (F0h, 7Dh, 00h, 01h, 02h, F7h)