Port CPU Control

The API commands related to controlling code and command execution on port CPUs is documented in Port CPU Control. This section discusses a high-level API command which may be used as a replacement for the pcpuCommandService.

Issue Port CPU Commands

issuePcpuCommand

The issuePcpuCommand command executes a Linux command on a set of ports. Refer to issuePcpuCommand for a complete description of this command. The format of this command is as follows:

issuePcpuCommand portList command

where portList is a TCL list of ports passed in by reference and command is the text of the command to be executed, which must use an absolute path. For example, ‘/bin/ls’. No filename expansion is performed on the command. For example, ‘/bin/ls /bin/ix*’ finds no matches. This, and the restriction on absolute path, may be avoided by executing the command through a bash shell, as in the following example:

set portList [list [list 1 1 1] [list 1 1 2]]

issuePcpuCommand portList “/bin/bash -c ‘ls -l /bin/ix*’”

The result of the command’s execution indicates whether the command was sent to the ports or not. No indication is given that the ports actually ran successfully on the ports. The individual port by port result of the command can be retrieved by using the getFirst / getNext functions of pcpuCommandService.