Command Line Interface¶
Overview¶
Sensor Controller Studio comes with two command line interface (CLI) programs for use in build automation:
- Code generator operations:
sensor_controller_studio_cli.exe
- Update service operations:
updater_cli.exe
The CLI executables are located in the bin installation subdirectory (typically C:\Program Files (x86)\Texas Instruments\Sensor Controller Studio\bin ).
Note : Executable names, examples and so on in this document, are for Windows. These are similar but not identical for other supported operating systems (see below).
CLI for Code Generator¶
The code generation command line interface, sensor_controller_studio_cli.exe
, supports the following operations:
- Perform code generation, as in the Code Generator Panel :
- Input: A Sensor Controller project file (*.scp)
- Output: Sensor Controller Interface (SCIF) driver source files and associated files (assembly listing file, how-to-use document and Doxygen setup)
- Option to skip file output if there would be no relevant changes in the generated files. This can be used to avoid unnecessary application rebuilds.
- Compare relevant parts of existing generated files against a Sensor Controller project file (*.scp).
- Input: A Sensor Controller project file (*.scp), and the location of the previously generated SCIF driver
- Output:
sensor_controller_studio_cli.exe
returns an error code if files are missing or contain relevant changes
- Access relevant preference settings, as in the Preferences Panel :
- Print the preference setting storage location (registry or file path)
- Print current preference setting value
- Modify preference setting value
“Relevant changes” means all differences that are not Sensor Controller Studio session specific, such as:
- Code generation information in
scif.h
:- Project file directory
- Tool version
- Tool patches
- Created timestamp
- Computer name
- User name
- Computer name and timestamp at the end of each file
- Line endings
Operating System Support¶
The following operating system(s) are currently supported:
- Windows 7, 8.1 and 10, as part of the Sensor Controller Studio installer
- Linux 64-bit, as minimal tarball (tested on Ubuntu 16.04 and 18.04)
Usage¶
Run sensor_controller_studio_cli.exe
without any arguments to view the CLI help text:
SYNTAX:
sensor_controller_studio_cli.exe {PARAMETERS}
PARAMETERS:
-g <file>, --generate <file>
Runs the code generator on the specified project file (full or relative
path). This is equivalent to selecting a project in the Code Generator
panel, and pressing the "Output SCIF driver files" button.
-o <dir>, --output-dir <dir>
For use with the "-g" parameter: Overrides the Project panel's "Source
code output directory" setting (full or relative path). As for the
Project panel setting, a relative path is relative to the project file
specified with the "-g" parameter, not to the current directory.
-c, --compare
For use with the "-g" parameter: Do not output any source code, but
instead compare with existing output files. The operation fails if one
or more files do not exist, or are not identical, except for session
specific information (project file directory, user ID, computer ID,
timestamps, tool version number, tool patches and line endings).
-s, --skip-identical
For use with the "-g" parameter: Skip SCIF driver file output if the
files already exist and are identical, except for session specific
information (project file directory, user ID, computer ID, timestamps,
tool version number, tool patches and line endings).
-pl, --pref-location
Prints the preference settings storage location (registry or file path).
-pr "SettingName", --pref-read "SettingName">
Reads the specified preference setting value, limited to the following
file and directory paths, and code generation options (0 = disabled,
1 = enabled):
- DirUserResourceDefs User directory for resource definition files
- DirUserProcDefs User directory for procedure definition files
- DirUserOsalDefs User directory for OSAL definition files
- DirUserPatchesBase Base directory for update service patches
- DirUserLogs Directory for code generation log files
- CodDoxygenExePath Doxygen.exe path, for use in scif_run_doxygen.bat
- CodShowTimestamp Show timestamp in scif.h file header
- CodShowComputerName Show computer name in scif.h file header
- CodShowUserName Show user name in scif.h file header
- CodAddGenByComment Add "Generated by <computer> at <timestamp>"
comment at the end of each generated file
-pw "SettingName=Value", --pref-write "SettingName=Value"
Writes the specified preference setting value, limited to the same file
and directory path settings and code generation options as for "-pr".
Directory paths must be absolute, and are validated as follows:
- DirUserPatchesBase As a precaution, the specified directory must not
exist when setting this preference (the update
service will delete this directory)
- CodDoxygenExePath The specified file path is not validated
- Others The specified directory must exist
-q, --quiet
For use with the "-g" parameter: Enables quiet mode.
-v, --version
Prints Sensor Controller Studio version information (application version
number and currently used patches).
EXAMPLES:
sensor_controller_studio_cli.exe -g c:/temp/my_project.scp
sensor_controller_studio_cli.exe -g c:/temp/my_project.scp -q -s
sensor_controller_studio_cli.exe -g c:/temp/my_project.scp -o c:/temp/output -c
sensor_controller_studio_cli.exe -pw "DirUserLogs=c:/temp/logs"
sensor_controller_studio_cli.exe -v
RETURN VALUE:
0 - Success
1 - Initialization failed
2 - Invalid parameter(s)
3 - Project loading failed
4 - Code generation failed, or compare mismatch
5 - Patch integrity check failed (one or more files or dependencies missing)
6 - Other error occurred (see the error message)
CLI for Update Service¶
The update service command line interface, updater_cli.exe
, supports the following operations:
- Online (internet access required):
- Check whether the current installation is the latest available release.
updater_cli.exe
returns an error code if a new release is available. - List all available patches
- List all available patches currently not installed.
updater_cli.exe
returns an error code if new patches are available. - Install a specific set of patches, given as a comma-separated list of patch IDs
- Install all available patches
- Check whether the current installation is the latest available release.
- Offline:
- List all currently installed patches
- Remove all currently installed patches
It is possible to override the default update information source for all online operations.
Operating System Support¶
The following operating system(s) are currently supported:
- Windows 7, 8.1 and 10, as part of the Sensor Controller Studio installer
For other operating systems, patches must be downloaded and installed manually. See the link in the Start Page panel.
Usage¶
Run updater_cli.exe
without any arguments to view the CLI help text:
SYNTAX:
updater_cli.exe {PARAMETERS}
PARAMETERS:
-u <op>, --update-op <op>
One of the following update operations can be performed:
rchk Check whether the current installation is the latest
available release. Error code 3 is returned if a new release
is available.
lall List all patches
lnew List all patches currently not installed. Error code 3 is
returned if new patches are available.
linst List all patches currently installed (offline)
1,2,4 Install a specific set of patches, given as a comma-separated
list of patch IDs
* Install all available patches
x Remove all currently installed patches (offline)
-f <url>, --file-url <url>
For use with "-u" operations not marked as offline: Overrides the
default update information file (upd_info.xml) download URL. Patch
files are downloaded from a location relative to this URL.
-ic <mode>, --internet-connection <mode>
For use with "-u" operations not marked as offline: Internet
connection mode:
dir Direct connection
auto Auto-detect system proxy settings (default)
man Manually entered proxy settings ("-ph" and "-pp" required)
-ph <host>, --proxy-host <host>
For use with "-ic man": HTTP proxy host name
-pp <port>, --proxy-port <port>
For use with "-ic man": HTTP proxy port number
-pu <user>, --proxy-user <user>
Optional for use with "-ic man": HTTP proxy user name
-pw <pwd>, --proxy-password <pwd>
Optional for use with "-ic man": HTTP proxy password
EXAMPLES:
updater_cli.exe -u * -ic dir
updater_cli.exe -u linst
RETURN VALUE:
0 - Success
1 - Invalid parameter(s)
2 - Update operation failed
3 - Up-to-date check failed (new release or patches are available)
4 - Patch integrity check failed (one or more files or dependencies missing)