Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Command line options

Copy (cp)

Copies a file or directory to or from a target.

cal.exe cp targetname src dest -o

Parameter Description

targetname

target friendly name

src

source file path

dest

destination file path

-o

overwrite, default is no overwrite

All paths within a target must be fully qualified, starting with fs:/. Anything else will be considered a PC path. The following example copies the file bar.txt (on the PC, relative to the current working directory) to fs:\shared\bar.txt on the target. fs:\shared must exist on the target.

cal.exe cp mytarget .\foo\bar.txt fs:/shared

Move (mv)

Moves a file or directory within a target.

cal.exe mv targetname src dest -o

Parameter Description
targetname Target friendly name
src source file/folder path
dest Destination folder path
-o Overwrite, default is no overwrite

All paths within a target must be fully qualified, starting with fs:/. The following example moves the file from fs:\usermods\foo\foo.mod to fs:/shared/foo.mod on the target. fs:\shared must exist on the target.

cal.exe mv mytarget fs:\usermods\foo\foo.mod fs:\shared

CreateDir (mkdir)

Create a directory on the target.

cal.exe mkdir targetname dir -r

Parameter Description
targetname Target friendly name
dir folder path
-r When present, create directories recursively, default is not recursive

The folder path must be fully qualified, starting with fs:/. The following example creates the directory fs:\shared\foo on the target.

cal.exe mkdir mytarget fs:/shared/foo

Remove (rm)

Remove a file or directory on the target.

cal.exe rm targetname path -r

Parameter Description
targetname Target friendly name
path File or folder path
-r Recursive, applicable to remove directory only. Default is not recursive

The file or folder path must be fully qualified, starting with fs:/. The following example removes the directory fs:\shared\foo from the target.

cal.exe rm mytarget fs:/shared/foo

Rename (rn)

Rename a file or directory on the target.

cal.exe rn targetname src dest

Parameter Description
targetname Target friendly name
src Source file or folder path
dest New name for the file or folder path

The file or folder path must be fully qualified, starting with fs:/. The following example renames the directory fs:/shared/foo to fs:/shared/bar on the target.

cal.exe rn mytarget fs:/shared/foo fs:/shared/bar

GetFileAttrib (ga)

Get the target file attribute.

cal.exe ga targetname src

Parameter Description
targetname Target friendly name
src source file path

The file or folder path must be fully qualified, starting with fs:/. The following example gets the attributes of fs:/shared/foo.mod on the target.

cal.exe ga mytarget fs:/shared/foo.mod

ListDir (ls)

Lists items in the target directory (non-recursive).

cal.exe ls targetname path

Parameter Description
targetname Target friendly name
path Folder path

The folder path must be fully qualified, starting with fs:/. The following example lists the items in fs:/shared on the target.

cal.exe ls mytarget fs:/shared

Exist (ex)

Verify a file or directory exists on target.

cal.exe ex targetname path

Parameter Description
targetname Target friendly path
path File or folder path

The path must be fully qualified, starting with fs:/. For example will verify if fs:/shared exists on the target.

cal.exe ex mytarget fs:/shared

InstallPackage (ip)

Install a package to a collection on a target.

cal.exe ip targetname packageName -v="volID" -c="colectionName"

Parameter Description
targetname Target friendly name
packageName Package name to install
voIID Volume ID, default = 0
collectionName Name of the collection, default = UserMods

All paths within a target must be fully qualified, starting with fs:/. The following example installs the package.brewmp to fs:\usermods on the target.

cal.exe ip mytarget package.brewmp -v="0' -c="UserMods"

UnInstallModule (um)

Install a module from a collection on a target.

cal.exe um targetname moduleName -v="volID" -c="colectionName"

Parameter Description
targetname Target friendly name
module Module name to uninstall
voIID Volume ID, default = 0
collectionName Name of the collection, default = UserMods

All paths within a target must be fully qualified, starting with fs:\. The following example uninstalls moduleName.brewmp from fs:\UserMods

cal.exe um mytarget moduleName.brewmp -v="0' -c="UserMods"

RegModule (regm)

Register a module with target.

cal.exe regm targetname mif mod col

Parameter Description
targetname Target friendly name
mif Module MIF path
mod Module MOD path
col Name of the collection

All paths within a target must be fully qualified, starting with fs:\. The following example registers the fs:/usermods/foo/foo.mif and fs:/usermods/foo/foo.mod in UserMods with the target.

cal.exe regm mytarget fs:/UserMods/foo/foo.mif fs:/UserMods/foo/foo.mod UserMods

ListCol (lc)

List the collections on the target.

cal.exe lc targetname

Parameter Description
targetname Target friendly name

ListVol (lv)

List the volumes on the target.

cal.exe lv targetname

Parameter Description
targetname Target friendly name

ListTargets (lt)

List targets.

cal.exe lt -c -v -xml

Parameter Description
No option Lists all connected and non-connected targets
-c Lists only connected targets
-v Verbose mode, CLI output (default)
-xml Verbose mode, XML output

SendKey (sk)

Send a key press event and key release event to foreground application on the target.

cal.exe sk targetname code holdTime

Parameter Description
targetname Target friendly name
code Key code to send (hex)
holdTime Time (in milliseconds) to wait between key press and key release

SendBrewEvent (sv)

Send a Brew MP event to the application on the target.

cal.exe sv targetname classID code param16 param32

Parameter Description
targetname Target friendly name
classID ClassID of the application (hex)
code Event code to send (hex)
param16 16-bit event parameter (hex)
param32 32-bit event parameter (hex)

SendBrewStringEvent (ssv)

Send a Brew MP string event to the application on the target.

cal.exe sv targetname classID code eventStr

Parameter Description
targetname Target friendly name
ClassID ClassID of the application (hex)
code Event code to send (hex)
eventStr Formatted string payload

SendKeyDown (kd)

Send a key press event to the foreground application on the target.

cal.exe sv targetname code param

Parameter Description
targetname Target friendly name
code Key code to send (hex)
param bitflag modifier (hex)

SendKeyUp (ku)

Send a key press event to the foreground application on the target.

cal.exe sv targetname code param

Parameter Description
targetname Target friendly name
code Key code to send (hex)
param Bitflag modifier (hex)

ScreenCapture (sc)

Get a screen bitmap for the target.

cal.exe sc targetname screenID filePath

Parameter Description
targetname Target friendly name
screenID Screen ID
filePath Specify the file path to receive the bitmap

Log (log)

Start and stop logging

cal.exe log targetname -o="filepath" -w="duration"

Parameter Description
targetname Target friendly name
-o Specify the file path to receive the logging messages, default output is CLI.
-w Stop logging in specified seconds. Pressing any PC key will terminate logging immediately regardless of whether -w is specified.

The following example starts logging, saves log messages to c:\temp\log.txt, and terminates in 30 seconds or when a PC key is pressed.

cal log "targetname" -o="c:\temp\log.txt" -w="30"

The following example starts logging, saves log messages to c:\temp\log.txt, and terminates when a PC key is pressed.

cal log "targetname" -o="c:\temp\log.txt"

The following example starts logging, outputs to CLI, and terminates when a PC key is pressed.

cal log "targetname"

ResetTarget (rt)

Reset the target.

cal.exe rt targetname

Parameter Description
targetname Target friendly name

StartApplet (starta)

Start an applet.

cal.exe starta targetname classID -a="arguments" -f="flags"

Parameter Description
targetname Target friendly name
classID ClassID of the applet (hex)
args Argument string is available (default null)
flags Flags for the starting applet (default 0)

StopApplet (stopa)

Stop an applet

cal.exe stopa targetname classID
Parameter Description
targetname Target friendly name
classID ClassID of the applet (hex)

IsAppletRunning (iar)

Test whether the specified applet is running.

cal.exe ipr targetname classID

Parameter Description
targetname Target friendly name
classID ClassID of the applet (hex)

GetAppId (gai)

Get the application ID of the foreground application.

cal.exe gai targetname

Parameter Description
targetname Target friendly name

GetAppletInfo (gra)

Get information on the running applet.

cal.exe gra targetname classID

Parameter Description
targetname Target friendly name
classID ClassID of the applet (hex)

PostEvent (pe)

Post an event to the target.

cal.exe pe targetname classID event param16 param32

Parameter Description
targetname Target friendly name
classID ClassID of the applet (hex)
event Event code (hex)
param16 w16Parameter of the event (hex)
param32` w32Parameter of the event (hex)

ModuleExist (me)

Check if a module exists in the collection

cal.exe me targetname modName colName

Parameter Description
targetname Target friendly name
modName Module name
colName Collection name