Custom Control Codes for Serial Ports
Custom control codes can be defined for ease of use per port or can be applied to all ports. For example, users could define a different Power Menu control code for every port, while having a single control code for View History that applies to all ports.
Custom control codes can be used by any user with access to the serial port. In order to run the shortcuts, the user presses the CTRL key + the keycode.
Note:Only Admin users can specify short-cut control codes.
Configure Custom Control Codes
Admin users can configure control codes for any of the pmshell
commands through the REST API, ogcli and the new interactive config shell.
Control code limitations are as follows:
-
Cannot set multiple control codes for a port to use the same keycode
-
The available key codes are a-z, excluding ‘i’ and ‘m’ as these can be triggered by commonly used keys TAB and BACKSPACE.
To disable a certain control code for an individual port, set the port’s control code to an empty string.
Configure Control Codes for a Specified Port (CLI Examples)
Control Codes Action | CLI Examples |
---|---|
Set control codes for a given port. In this example, the user sets multiple control codes for port 2 |
|
Clear all control codes for a given port, in this example, port 2 |
ogcli update port port02 << 'END'
control_code.break="" control_code.chooser="" control_code.pmhelp="" control_code.portlog="" control_code.power="" control_code.quit="" END |
Configure a Control Code Value for All Ports
To set a particular control code to one value across all serial ports, admin users can use the script set-serial-control-codes
from the CLI as follows:
set-serial-control-codes CONTROL_CODE KEY
where:
-
CONTROL_CODE - Must be one of the following values:
break, chooser, pmhelp, portlog, power
orquit
. -
KEY - Must be a single lower case letter a-z excluding ‘i' and ‘m’ or an empty string designated by '’ which is used to clear the control code.
Control Codes for All Ports via CLI (Examples)
Control Codes Action | CLI Examples |
---|---|
Set chooser control code to CTRL-a on all ports |
set-serial-control-codes chooser a
|
Clear chooser control code on all ports |
set-serial-control-codes chooser ''
|