| cmdDEV_VAL | Index |
Command Code:
The Packet:
| 0 | 1 | 2 | 3 | 4 | ||||
| address | 3 | cmdDEV_VAL | DEVCODE | DATA |
| DEVCODE - | [ (7) HOST | (6) RFLX | (5:0) DevID (0-63)] |
| DATA - | Device input data bytes. |
Description:
This command is used internally by a BrainStem to route device input bytes to the host, a reflex, or a VM.
DEVCODE
When the HOST bit is set, the Stem sends a data packet to the host tagged with a cmdDEV_VAL byte, followed by the device ID and the data byte(s). When the RFLX bit is set, the Stem issues an internal cmdRAW_INPUT command with the device ID as the MSG byte and the DATA bytes as the INPUT parameters. If neither HOST nor RFLX is set, the data will go to any VM process that is waiting for it. If no VM process awaits the data, the data is discarded.
A user can bypass the normal input protocols by issuing this command. The only case where this is necessary is when sending data to a semaphore via a command. Otherwise, use of this command is strongly discouraged.
The following table shows command packets that indicate completion for a semaphore. These packets include an address byte of 2 and a size byte.
| Semaphore | Device ID | Command to Return Byte | Command to Return Short |
| 0 | 53 (0x35) | 2 3 4 53 0 | 2 4 4 53 0 0 |
| 1 | 54 (0x36) | 2 3 4 54 0 | 2 4 4 54 0 0 |
| 2 | 55 (0x37) | 2 3 4 55 0 | 2 4 4 55 0 0 |
| 3 | 56 (0x38) | 2 3 4 56 0 | 2 4 4 56 0 0 |