
__________________________________________________________________________________________
PAC-4010 User Manual V1.0 Copyright 2016 Advantech Co. Ltd. All rights reserved. Page
80
5.8 SDK Command Proxy
BCMSH is a user-land proxy that allows user to execute SDK commands in standard
Linux shell and get return code and output string. BCMSH is installed to
“/opt/sdk-xgs-robo”
of target filesystem, and the below is the help message.
Table 5-11: BCMSH Help Message
Usage:
bcmsh [-c "command"|-f <script>]
Options:
-c "command"
-f <script>
-s <session>
-h
: execute a sdk command
: execute sdk commands from a script file
: execute in separated thread session
: print this help
The
“-c”
and
“-f”
options are mutual exclusive and one of them must be specified.
The
“-c <command>”
option is used to execute exactly one SDK command.
Below is a command example:
$/opt/sdk-xgs-robo/bcmsh –c“0:tx 100 pbm=xe0”
The
“-f <script>”
option is used to execute a SDK command script that contains one
or more SDK commands. In additional, the script supports comment by adding
“#”
character in front of each line of message string.
Below are a command example and the demo script:
$/opt/sdk-xgs-robo/bcmsh -f /home/user/bcmsh_example.scr
# SDK demo command script
# send test packet
0:tx 1 pbm=xe0 ubm=xe0
# pause a short time for counter collection
sleep 1
# show counters
0:show counters xe0
By default, the SDK commands sent by BCMSH are queued in one Unix FIFO (named
pipe). A background POSIX thread (i.e. the default execution thread) will monitor this
FIFO, extract and execute the incoming command serially. In addition, this thread will
redirect command output string to another UNIX FIFO together with command’s return
code. BCMSH will display the output string to stdout and quit with the return code. This
allows user to access SDK function via standard UNIX shell seamlessly from local or
remote host.
Содержание PAC-4010
Страница 2: ......