RS232 Serial Communication¶
The RS232 Serial Communication feature allows one to send commands to affect control and functionality of the USBHub3c.
Use Cases
Affecting USBHub3c control.Audio/Video applications.
Configuration¶
The default configuration of the RS232 Serial Communication feature is:
8 Data bitsNo ParityNo Flow Control1 Stop bit9600 Baudrate
This feature does have some configurability through the USBHub3c UART Entity
Extron Compatible Serial Commands¶
The RS232 Serial Communication feature is capable of changing the USBHub3c upstream port, requesting the current status of the upstream/downstream connections, enable/disable of ports, and the USBHub3c part number/firmware version queries. This can be accomplished with a protocol that is compatible with Extron’s Simple Instruction Set over RS232.
Commands¶
The following is a list of all commands the USBHub3c supports with their arguments, descriptions, and expected responses.
Cmd |
Arguments |
Description |
Expected Responses |
---|---|---|---|
|
None |
Get current upstream port index |
|
|
|
Change upstream port to |
|
|
|
Change upstream port to |
|
|
None |
Get connection status |
|
|
None |
Get part number |
S99-USBHUB-3C-PRO\r\n S99-USBHUB-3C-LAB\r\n |
|
None |
Get firmware version |
|
|
|
Get enable/disable status of |
Port #*0\r\n Port #*1\r\n |
|
# Port$ Enable 0/1 |
Set |
|
Error Codes¶
The following is a list of all error codes the USBHub3c supports with descriptions.
Code |
Description |
---|---|
|
invalid port number, check the port number and make sure it’s valid. |
|
invalid command, verify that you formatted the command correctly. |
|
invalid value, verify that the value is within the acceptable range for this command. |
|
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:
1!
Chn 1\r\n
I
Chn 1 InACT010000 OutACT001000\r\n
3*0P
Port 3*0\r\n
API Configurations:
static const int TEST_SERIAL = 0;
aUSBHub3c 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
stem.uart[TEST_SERIAL].setProtocol(1)
// Perform a system save so the changes persist
// through power cycles
stem.system.save();
stem.disconnect();
TEST_SERIAL = 0
stem = brainstem.stem.USBHub3c()
stem.discoverAndConnect(brainstem.link.Spec.USB)
# Enable the port
stem.uart[TEST_SERIAL].setEnable(1)
# Change baudrate to 115200 from default 9600
stem.uart[TEST_SERIAL].setBaudRate(115200)
# Change Protocol to Extron Compatible
# 0 - Disabled/Undefined
# 1 - Extron Compatible
stem.uart[TEST_SERIAL].setProtocol(1)
# Perform a system save so the changes persist
# through power cycles
stem.system.save()
stem.disconnect()