The send command sends serial data to connected devices using RS-232, Infrared, or CEC.
| |
|---|
| Command Type | SDVoE |
| Minimum Version | 2.x.x |
Usage
send <target> <type>[:<port>] <data_string>
Arguments
| Argument | Required | Description |
|---|
target | Yes | Hostname or MAC address of a single device, or a device group. See Targets. |
type | Yes | The connection type to send through. See Types. |
port | No | The device port to send to. Applies to rs232 only; defaults to 0. See Ports. |
data_string | Yes | The data to send, as printable ASCII with escapes. See Data string. |
Targets
| Value | Sends to |
|---|
<device> | A single device |
ALL | All devices |
ALL_TX | All transmitter devices |
ALL_RX | All receiver devices |
Types
| Value | Sends via |
|---|
rs232 | The RS-232 port on the device |
infrared | The infrared port on the device |
cec | CEC, to the connected HDMI device |
Ports
The physical RS-232 port maps to different port values depending on the hardware:
| Model | Physical RS-232 port |
|---|
| DN-150 | 0 |
| DN-210/DN-220 | 0 |
| DN-225 | 1 |
| DN-300 | 0 |
Data string
The data_string is a printable ASCII text string. Spaces, ASCII control characters, and non-ASCII byte values must be escaped:
| Escape | Meaning |
|---|
\0 | Null character |
\n | Line feed |
\r | Carriage return |
\t | Horizontal tab |
\xnn | Byte value, where nn are two hexadecimal characters |
\\ | A single backslash |
\ | Space character |
Examples
Send a string out a device's RS-232 port
send 001ec0f03668 rs232:0 Hello\ World!
Send a control-character-terminated command to a display
send projector rs232 PWR\ ON\r
Return value
For each device targeted, the result contains either an entry in the success array (success) or a device error object in the error array (failure). The success array is named after the type: send_rs232, send_infrared, or send_cec.
send 001ec0f03668 rs232:0 Hello\ World!
{
"status": "SUCCESS",
"request_id": null,
"result": {
"send_rs232": [
{ "device_id": "001ec0f03668" }
],
"error": []
},
"error": null
}
| Member | Type | Description |
|---|
send_rs232 / send_infrared / send_cec | Array of objects | The devices for which the request succeeded. Each entry has one member, device_id |
error | Array of DeviceError | The devices for which the command failed, and the reason why |
Errors
Request-level errors:
| Error | Cause |
|---|
ILLEGAL_ARGUMENT | The target is not a valid device ID or group name |
ILLEGAL_ARGUMENT | The data string is not in the format described above |
The request may also fail for individual devices:
| Error | Cause |
|---|
DEVICE_TYPE | The device does not have a UART, or lacks the specified RS-232 port |
REST API
POST /api/device/{target}
{
"op": "send:cec",
"port_index": "Integer (optional)",
"data_hex": "String"
}
POST /api/device/{target}
{
"op": "send:infrared",
"data_hex": "String"
}
POST /api/device/{target}
{
"op": "send:rs232",
"port_index": "Integer (optional)",
"data_type": "\"hex\" (optional)",
"data_string": "String"
}
Values labeled with a type name such as String or Integer are placeholders, not literal text. Replace them with actual values; fields marked (optional) can be omitted.
{target} takes a DisplayNet device name as readily as a device ID, and a locked device refuses a mutating operation. See SDVoE API operations for what DisplayNet adds to these calls.
See also
connect: route serial connections between devices
request: receive serial data routed to the API
display: volume and mute for the display attached to a receiver