RS232 Serial Communication

The RS232 Serial Communication feature allows one to send commands to control and configure USB-C-Switch Pro.

Use Cases

Affecting USB-C-Switch Pro control.
Audio/Video applications.

Configuration

The default configuration of the RS232 Serial Communication feature is:

8 Data bits
No Parity
No Flow Control
1 Stop bit
9600 Baudrate

This feature does have some configurability through the USB-C-Switch Pro UART Entity

Extron Compatible Serial Commands

Using a protocol compatible with Extron’s Simple Instruction Set over RS232, the RS232 Serial Communication feature can:

  • Select / Enable / Disable Mux ports

  • Query the USB-C-Switch Pro part number and firmware version.

Commands

The following is a list of all commands the USB-C-Switch Pro supports with their arguments, descriptions, and expected responses. For USB-C-Switch Pro, “Upstream Port” refers to the Mux port index independent of the port direction.

Cmd

Arguments

Description

Expected Responses

!

None

Get current mux port index

Chn #\r\n

#!

# Port

Change mux port to # port number

Chn #\r\n

#^

# Port

Change mux port to # port number

Chn #\r\n

N

None

Get part number

S105-USB-C-SWITCH-PRO\r\n

Q

None

Get firmware version

<M>.<m>.<p>\r\n

#P

# Port

Get enable/disable status of # port number

Port #*0\r\n
Port #*1\r\n

#*$P

# Port
$ Enable 0/1

Set $ enable/disable of # port number

Port #*$\r\n

Error Codes

The following is a list of all error codes the USB-C-Switch Pro supports with descriptions.

Code

Description

E01

invalid port number, check the port number and make sure it’s valid.

E10

invalid command, verify that you formatted the command correctly.

E13

invalid value, verify that the value is within the acceptable range for this command.

E14

invalid configuration, verify the system is in a state it can accept this command.

General Notes

All commands are ASCII strings.
\r is the ASCII character for carriage return.
\n is the ASCII character for new line.

Examples

Extron Compatible Serial Commands:

Select Mux Port 1

Tx: 1!
Rx: Chn 1\r\n

API Configurations:

static const int TEST_SERIAL = 0;

aUSBCSwitchPro stem;
stem.discoverAndConnect(USB);

// Enable the port
stem.uart[TEST_SERIAL].setEnable(true);

// Change baudrate to 115200 from default 9600
stem.uart[TEST_SERIAL].setBaudRate(115200);

// Change Protocol to Extron Compatible
// 0 - Disabled/Undefined
// 1 - Extron Compatible
// 2 - Brainstem Transport
// 6 - Loopback
stem.uart[TEST_SERIAL].setProtocol(1)

// Perform a system save so the changes persist
// through power cycles
stem.system.save();

stem.disconnect();

Relevant API’s

stem.uart[x].setEnable()[cpp][python][NET][LabVIEW]
stem.uart[x].getEnable()[cpp][python][NET][LabVIEW]
stem.uart[x].setBaudRate()[cpp][python][NET][LabVIEW]
stem.uart[x].getBaudRate()[cpp][python][NET][LabVIEW]
stem.uart[x].setProtocol()[cpp][python][NET][LabVIEW]
stem.uart[x].getProtocol()[cpp][python][NET][LabVIEW]
stem.uart[x].setLinkChannel()[cpp][python][NET][LabVIEW]
stem.uart[x].getLinkChannel()[cpp][python][NET][LabVIEW]
stem.uart[x].setStopBits()[cpp][python][NET][LabVIEW]
stem.uart[x].getStopBits()[cpp][python][NET][LabVIEW]
stem.uart[x].setParity()[cpp][python][NET][LabVIEW]
stem.uart[x].getParity()[cpp][python][NET][LabVIEW]
stem.uart[x].setDataBits()[cpp][python][NET][LabVIEW]
stem.uart[x].getDataBits()[cpp][python][NET][LabVIEW]
stem.uart[x].getCapableProtocols()[cpp][python][NET][LabVIEW]
stem.uart[x].getAvailableProtocols()[cpp][python][NET][LabVIEW]