cetoys - RAPI with Windows and UNIX

Prerequisites

Linux

Refer to http://www.synce.org on the needed packages, there is a lot of package dependencies. Below are the packages I had to install in order to bring things to work on my OpenSuSE 11.1:
dynamite-0.1.1-1.2.x86_64.rpm
libdynamite0-0.1.1-1.2.x86_64.rpm
libdynamite-devel-0.1.1-1.2.x86_64.rpm
libmimedir0-0.5.1-1.2.x86_64.rpm
libmimedir-devel-0.5.1-1.2.x86_64.rpm
libopensync-plugin-synce-0.12-2.2.x86_64.rpm
libopensync-plugin-synce-legacy-0.22-1.3.x86_64.rpm
liborange0-0.3.2-1.3.x86_64.rpm
liborange-devel-0.3.2-1.3.x86_64.rpm
librapi2-0.12-1.3.x86_64.rpm
librapi-devel-0.12-1.3.x86_64.rpm
librra0-0.12-1.3.x86_64.rpm
librra-devel-0.12-1.3.x86_64.rpm
librtfcomp0-1.1-1.2.x86_64.rpm
librtfcomp-devel-1.1-1.2.x86_64.rpm
libsynce0-0.12-1.3.x86_64.rpm
libsynce-devel-0.12-1.3.x86_64.rpm
libunshield0-0.5.1-1.2.x86_64.rpm
libunshield-devel-0.5.1-1.2.x86_64.rpm
orange-0.3.2-1.3.x86_64.rpm
python-rapi2-0.12-1.3.x86_64.rpm
python-rra-0.12-1.3.x86_64.rpm
python-rtfcomp-1.1-1.2.x86_64.rpm
rapi2-tools-0.12-1.3.x86_64.rpm
rra-tools-0.12-1.3.x86_64.rpm
synce-hal-0.2-2.3.x86_64.rpm
synce-kpm-0.12-3.2.x86_64.rpm
synce-sync-engine-0.12-2.2.x86_64.rpm
unshield-0.5.1-1.2.x86_64.rpm
unshield-debuginfo-0.5.1-1.2.x86_64.rpm
usb-rndis-lite-kmp-default-0.11_samsung_2.6.27.7_9.1-1.2.x86_64.rpm
(agree, maybe not really all of them were necessary). Then I had to do the following:
  1. add module ipaq to /etc/modprobe.d/blacklist
  2. allow extended network functions on my T-Mobile MDA III (HTC3300) (German: Erweiterte Netzwerkfunktionen aktivieren, any ideas, how it is called in English?)
  3. define dhcp client for the network interface rndis0 appearing after the function above has been activated and the PDA connected through USB to the PC. I defined the following in /etc/sysconfig/network/ifcfg-rndis0
    BOOTPROTO='dhcp'
    BROADCAST=''
    ETHTOOL_OPTIONS=''
    IFPLUGD_PRIORITY='0'
    IPADDR=''
    MTU=''
    NAME='RNDIS'
    NETMASK=''
    NETWORK=''
    REMOTE_IPADDR=''
    STARTMODE='ifplugd'
    USERCONTROL='no'
    
  4. after that the interface rndis0 should get some IP address and you should be able to communicate with the device through IP. rapi ls / (or pls / from the package rapi2-tools) shuld list the contents of the root directory on the device.

Windows

Install MS Active Sync, you can usually find it on the companion CD for the Windows CE/Mobile device, you can also try to download it from Microsoft, though not all versions for all languages are available there. Connect your device to the PC, click a lot of OKs and Continues in MS Active Sync dialog boxes appearing after that, then you should be able to access the device for example from MS Active Sync explorer window. If this works, rapi.exe should also be able to do the things.

Recent Windows versions (Vista, 7) already contain a RAPI client, so that there is no need to install anything.

Compilation

Presently cegcc and MS Embedded Visual C 4.x are supported for the Windows CE executables. gcc, MinGW and diverse MS Visual C versions can be used for the desktop versions. The compilation for Unix/Linux needs libsynce. Optionally, if compiling with -DRAPI_SDK, librapi is needed for Unix and rapi.lib/.h contained in Windows Mobile SDK are needed for MS Windows. Though I'm not sure, if MS RAPI SDK will work with MinGW.

CeGCC

cegcc can be found on http://cegcc.sourceforge.net, I used the available rpm version for Linux, under Windows you'll need the cygwin environment and the cygwin version of cegcc. Enter the directory ce and call make -f makefile.cegcc in order to create the Windows CE executables scrsht.exe, sms.exe, cellinfo.exe and clipboard.exe. Don't forget to copy cegcc.dll to a direcotry on the device, which is in the search path or to the same directory, where the exe files will reside.

Warning! cegcc doesn't seem to handle windows resources correctly and the GUIs of windows CE executables may crash in the current version. Please appologize and use preferably the Windows CE executables compiled with Microsoft compilers, included for example in the cabinet installation package.

Linux

The linux version assumes the existence of libsynce (http://www.synce.org) and - optionally - of librapi, if compiling with -DRAPI_SDK. Enter the directory rapi and issue make -f makefile.linux in order to create the executable rapi. You can use cegcc under linux in order to create the Windows CE executables in the directory ce. You may also use the overal makefile.linux or cetoys.spec in order to create the linux rpm.

Embedded Visual C 4.x

Similar to CeGCC enter the directory ce and call nmake -f makefile.evc in order to create the Windows CE binaries. Few environment variables must be set in order to bring EVC to work, please check the windows script below:
REM Environment for Microsoft eMbedded C++ 4.0 (eVC4.exe)
REM Call nmake -f makefile.evc4 in order to compile

REM The installation directory of MS Embedded Visual C 4
SET EVC=%ProgramFiles%\Microsoft eMbedded C++ 4.0

REM Set to APRMV4, ARMV4I, ARMV4T, EMULATOR, MIPS16 SIPSII, SH3, SH4, X86 etc.
SET TARGETCPU=ARMV4I

REM you shouldn't need to change anything below
SET EVCSDK=%ProgramFiles%\Windows CE Tools\wce400\STANDARDSDK

SET INCLUDE=%EVCSDK%\include\%TARGETCPU%;%EVCSDK%\MFC\include;%EVSDK%\ATL\include;%INCLUDE%
SET LIB=%EVCSDK%\lib\%TARGETCPU%;%EVCSDK%\MFC\lib\%TARGETCPU%;%EVCSDK%\ATL\lib\%TARGETCPU%;%LIB%
SET PATH=%EVC%\Common\EVC\Bin;%EVC%\EVC\WCE400\BIN;%PATH%

MinGW

Download and install Mingw from http://www.mingw.org. Refer to http://www.mingw.org/wiki/HOWTO_Install_the_MinGW_GCC_Compiler_Suite for how to download and install it. You'll need the gcc compiler, binutils, win32 api and GNU make. Enter the directory rapi and run make -f makefile.mingw. Similarly you can create the desktop versions of the executables scrsht.exe, sms.exe, cellinfo.exe and clipboard.exe by executing make -f makefile.mingw in the subdirectory ce.

Visual C

The code should compile with VC 7, 8 and 9 (Brand names: VS Toolkit 2003 + Platform SDK, Visual Studio 2005 and 2008 or the freely available MS Windows SDK). Enter the directories rapi and ce and issue nmake -f makefile.vc in the command console window of Visual Studio or Windows SDK. Alternatively to the command console window you can set the following environment variables in order to bring MS VC to work:
REM Environment for Microsoft Visual Studio or Microsoft Windows SDK 6.1
REM Call nmake -f makefile.vc in order to compile.

REM The installation directory of Visual C
REM SET VC=%ProgramFiles%\Microsoft Visual Studio 8\VC
SET VC=%ProgramFiles%\Microsoft Visual Studio 9.0\VC

REM Location of Microsoft Platform SDK
REM SET MSSDK=%VC%\PlatformSDK
SET MSSDK=%ProgramFiles%\Microsoft SDKs\Windows\v6.1

REM You shouldn't need to change anything below
SET TARGETCPU=
SET INCLUDE=%VC%\include;%MSSDK%\include;%INCLUDE%
SET LIB=%VC%\lib;%MSSDK%\lib
REM Don't forget to include the MS NET Framework directory due to cvtres.exe
SET PATH=%VC%\bin;%VC%\..\Common7\IDE;%MSSDK%\bin;%SystemRoot%\Microsoft.NET\Framework\v2.0.50727;%PATH%
If your a lucky owner of Windows Mobile SDK, you can compile the code with -DRAPI_SDK against rapi.h and rapi.lib. Please refer to the comments in rapi/makefile.evc for how to do it.

Usage

The package consists of the following programs:
  1. The desktop computer executable rapi.
  2. The cabinet package for Windows CE/Mobile or the RPM package for Linux includes Windows CE ARM binaries of the following programs:
    1. sms.exe for sending sms
    2. scrsht.exe for screenshots
    3. clipboard.exe for clipboard operations
    4. cellinfo.exe for tower cell informations
    5. cetdll.dll for tower cell informations available over RAPI invoke
  3. The MSI version for Microsoft Windows compiled with MinGW or Microsoft Visual C additionaly includes desktop versions of programs sms.exe, scrsht.exe, clipboard.exe, cellinfo.exe. Theoretically they are fully functioning programs, though eg. sms.exe expects sms.dll and cellinfo.exe relies on the RIL API dll, which usually don't exist on the desktop versions of MS Windows and therefore they most probably won't work there.

The Windows CE binaries are required in few functions of the desktop executable rapi (rapi.exe under windows), so it is recomended to install them prior to running the desktop program. Either install the cabinet installation package (recommended)

rapi install cetoys-rN.cab
or - in case of the RPM installation package on Linux - copy the windows CE executables from /usr/share/cetoys to some location on the device
rapi md /cetoys
rapi put /usr/share/cetoys/* /cetoys

Warning! cegcc doesn't seem to handle windows resources correctly and the GUIs of windows CE executables may crash in the current version. Please applogize and use preferably the Windows CE executables compiled with Microsoft compilers, included for example in the cabinet installation package or avoid to use Windows CE programs without command line parameters.

sms.exe

sms.exe is a program for sending SMS using the windows SMS API dynamic library sms.dll. Calling the program without command line arguments opens a GUI, where the phone number of the SMS recipient and the SMS text can be entered. The SMS text can be longer than 160 characters, the Windows SMS API seems to corectly split longer textes into 160 characters chunks. Aletrnatively the program can be called with command line arguments. The first word of the command line argument is then the phone number of the sms recipient, the remaining part is the SMS text. The Windows CE version of this program is used in the function "sms" of the desktop executable rapi.

scrsht.exe

Program for making screenshots of the whole current MS Windows desktop. Calling the program without command line argument opens a common file save dialog, in which the program asks where to store the screenshot. The screenshot is stored as the windows bitmap (DIB) file. A command line argument, if any, means the name of the file into which to store the screenshot. The Windows CE version of this program is required in the function "scrsht" of the desktop executable rapi.

clipboard.exe

Copies contents of a file into the clipboard or pastes the contents of the clipboard into the file. Currently the program contains no GUI, it can be called only with command line arguments, the Windows CE version of this program is required in the function "cb" of the desktop executable rapi.

For pasting the data from the clipboard into a file the program must be called with the following command line arguments:

\Program Files\cetoys\clipboard.exe paste /Temp/myfile
where:
  1. \Program Files\cetoys\clipboard.exe is the full path to the program, \Program Files\cetoys is the usual installation path for the package cetoys on Windows CE and english versions of desktop Windows.
  2. paste instructs the program to paste data from the clipboard.
  3. /Temp/myfile or \Temp\myfile is the name of the file into which the pasted data will be written.

The program is able to copy only text data into clipboard, as CF_TEXT. Text, windows unicode text (UCS-2LE), bitmap, DIB and Shell IDList Array can be pasted. Text is pasted transparently, without converting it from or to unicode, bitmap and DIB data is stored as windows bitmap file, from the format Shell IDList Array (produced for example by windows explorer) the full path of the first file in the list is stored as text. Depending on the compilation type it can be either windows unicode or ansi text, for Windows CE only unicode text (UCS-2LE) is supported.

cellinfo.exe

is a GUI application fo retrieving the IDs of the current cellurar tower used by the mobile phone in a Windows Mobile device or theoretically in any windows system supporting the Microsoft RIL API. The program is also able to import CSV data provided by http://www.opencellid.org and show the current location of the cell tower. The CSV data can be imported either directly in the GUI of cellinfo.exe or using a command line utility cidb.exe (cidb on unix) for desktop computers.

Importing CSV files from www.opecellid.org on mobile devices is a time consuming process and it will mostly crash due to lack of memory there. Plese create the binary import files on a desktop PC using either the desktop version of cellinfo.exe or the command line utility cidb and then copy the binary files to some location on the device. In cellinfo.exe on the device the copied binary file may be then selected this time in the mobile version of the executable cellinfo.exe.

The CSV file with locations of cell towers can be imported as follows using cellinfo.exe:

  1. Press the button "Config" in the main window of the application.
  2. In the configuration window press the button "Select" above and select the CSV file downloaded from http://www.opencellid.org.
  3. Press the button "Define" and enter the name of the binary import file to create. In the examples below I use the name "cells.db".
  4. The CSV file from www.opencellid.org usually contains cell tower locations for the whole world. If you want to import the locations only for a specific geographic area, then enter additionally a minimum and maximum latitude and longitude of the area. Selecting a small area will even allow you to import the data directly on the mobile device, for example I was able to import data for whole Germany on HTC 3300 with 128 MB RAM. Entering values of eg. from -180 (or less) degrees to +180 (or more) degrees causes importing data for the whole world.
  5. Press the button "Load", after some time the data will be imported. It takes maybe few seconds on a desktop PC and maybe hours on a mobile device.
  6. Press "OK" and the file is ready to use, as long as the program cellinfo.exe is running on an RIL enabled device (so, practically on a mobile phone).

Using the command line utility cidb (cidb.exe) the CSV file can be imported as follows:

 ./cidb create cells.txt cells.db -180 180 -180 180
where
  1. "create" is the parameter letting the utility to import the data. Alternatively you can check the imported data using the parameter "read".
  2. cells.txt is the name of the CSV file downloaded from http://www.opencellid.org
  3. cells.db is the name of the created binary import file.
  4. -180 and 180 are optional minimum and maximum latitudes and longitudes.

Do the following in order to use the binary import file created on the desktop PC:

  1. Copy the file to the device, it may be large, so better copy it to the memory card rather than to the internal memory of the device:
       rapi put cells.db "/Memory Card"
       
  2. Launch cellinfo.exe on the device, press the button "Config" in the main window.
  3. Press the button "Select" next to the input box "DB File" and select the file "cells.db" located on memory card. Alernatively you can just enter the full path to the file in the input box without using the confusing OpenFileDialog from Windows CE.
  4. Press OK an the database is ready to use.

The cerrent cell tower may be either queried using the button "Query" in the main window of cellinfo.exe or by defining a query timer. The timer interval for the query timer can be defined in seconds in the configuration window, accessible through the button "Config" of the main window, in the input box "Timer (s)". If the value is > 0, then the timer is activated for the given amount of seconds, else it is switched off. As usual for the configuration window, the setting must be commited with the button "OK".

The configuration window allows to define yet another setting: the UDP port. If the port is > 0, then each cell tower query result is send to localhost on the given port using UDP. Regardless if it is a result of the query performed with the "Query" button in the main window or executed from the timer. The UDP packet sent has the following format:

  1. latitude, integer, degrees multiplicated with 1e7
  2. longitude, integer, degrees multiplicated with 1e7
  3. country code of the tower, integer
  4. network provider code, integer
  5. area code, integer
  6. cell tower code, integer
  7. the numbers are sent as strings separated with whitespaces and with a trailing line feed.

For example the application map.exe from the package serialcs (http://serialcs.sourceforge.net) is able to read the data and show the position of the cell tower on a map.

The import routines expect the following format of the CSV file:

  1. comma separated
  2. dot as decimal point
  3. 2. column - latitude
  4. 3. column - longitude
  5. 4. column - country code
  6. 5. column - mobile network code
  7. 6. column - area code
  8. 7. column - cell tower code

cetdll.dll

A DLL with similar functions like cellinfo.exe but intented to call over RAPI invoke functions. Heavy under construction and not ready to use yet. Though the dll compiles also under desktop windows systems, it is not usable there.

rapi

rapi (rapi.exe under desktop windows) is the command line utility for accesing numerous Windows CE and Mobile functions from a desktop computer over Microsoft RAPI. The program can be currently compiled for Microsoft Windows desktop systems and for Linux with installed librapi. Call
rapi help
for the full list of parametrs supported by the program. The paths used as parameter to the RAPI calls may include eighter backslashes or slashes as directory separators. In the examples below slashes will be prefered.

rapi ls

rapi ls [directory]
Lists the given directory on the device. If the directory parameter is not given, then the root directory is listed. One line per directory entry is printed to stdout, each line consists of the following columns:
  1. attributes "ACD+HONRST', A - archive, C - compressed, D - directory, + - has children, H - hidden, O - in ROM, N - normal, R - read only, S - system, T - temporary.
  2. file or directory creation time, format yyyyMMdd HHmmss
  3. file or directory write time, format yyyyMMdd HHmmss
  4. file or directory access time, format yyyyMMdd HHmmss
  5. file or directory size
  6. file or directory name

Example: listing of th edirectory "My Documents" on a german Windows Mobile 6:

% rapi ls "/My Documents"
--D------- 20071101 110024 20071031 230000 20071101 110024          0 Eigene Bilder
--D------- 20071101 110024 20071031 230000 20071101 110024          0 Vorlagen
--D------- 20071101 110026 20071031 230000 20071101 110026          0 PersĂśnlich
--D------- 20071101 110026 20071031 230000 20071101 110026          0 Geschäftlich
--D------- 20071101 110026 20071031 230000 20071101 110026          0 Eigene Musik
--D------- 20071101 110026 20071031 230000 20071101 110026          0 Meine KlingeltĂśne
--D------- 20071101 110028 20071031 230000 20071101 110028          0 Eigene Videos
A-------S- 20071101 110028 20071031 230000 20071101 110028      13561 Alouette.mid
A-------S- 20071101 110028 20071031 230000 20071101 110028       1248 ding.amr
--D------- 20090807 184504 20090807 000000 20090807 184504          0 Anrufe
--D------- 20071101 110028 20071031 230000 20071101 110028          0 UAContents
--D------- 20071101 110032 20071031 230000 20071101 110032          0 My Midlets
-------RS- 20071102 002856 20071101 230000 20071102 002856     282296 T-Mobile.bmp
--D------- 20081219 211918 20081218 230000 20081219 211918          0 Gemeinsame Verwendung von Bluetooth
A--------- 20090210 140924 20090209 230000 20090629 204720        330 cb.cfg
--D------- 20090228 205750 20090227 230000 20090228 205750          0 WĂśrterbĂźcher

rapi md

rapi md directory
Creates a directory on the device. Example:
rapi md "/My Documents/Eugene"

rapi rd

rapi rd directory
Deletes a directory on the device. Example:
rapi rd "/My Documents/Eugene"

rapi cat

rapi cat file
Shows a file from the device on the stadard output of the desktop computer. The file is copied transparently to stdout, also windows unicode (UCS-2LE) files. On non windows unicode capable terminals (so, on most terminals) such windows unicode files may be unreadable for human eyes.

Example:

stoinski@daniel:~> rapi cat /Windows/sync.lnk
42#:MSSYNCAPP
stoinski@daniel:~> rapi cat "/My Docements/file.txt" | iconv -f UCS-2LE
...

rapi get

rapi get source [target]
Copies the source file from the device into the given target on the desktop computer. The source file must be a single file, this function does not accept wildcards or recursive copies of directories. The target may be:
  1. a name of the file, in this case the source is copied to the given file
  2. a name of a directory, in this case the source file is copied to a file on the desktop computer, having the same name as the source file and located in the given directory on the desktop computer.
  3. it may be an empty string or a single minus "-" character, in this case the output is stdout and this function behaves the same way as rapi cat.

Example:

stoinski@daniel:/tmp> rapi get /Windows/sync.lnk .        
stoinski@daniel:/tmp> cat sync.lnk 
42#:MSSYNCAPP
stoinski@daniel:/tmp> rapi get /Windows/sync.lnk -
42#:MSSYNCAPP
stoinski@daniel:/tmp> rapi get /Windows/sync.lnk file.txt
stoinski@daniel:/tmp> cat file.txt 
42#:MSSYNCAPP

rapi mget

rapi mget source1 [... sourceN] [target]
Copies source files from the device to the given target. This function is very similar to "rapi get", but it is also able to copy multiple source files or source files described by wildcards in Windows syntax. This function is currently still unable to recursively copy directories, see hints in "rapi tar" if you want a recursive copy.

Example:

rapi mget "/My Documents/*.doc" .
rapi mget /pdafile1 /pdafile2 desktop_directory
rapi mget "/My Documents/*.txt" -

The function does not warn about overwriting files on the desktop computer.

rapi put

rapi put file1 [ ... fileN] target
Puts the given files file1 - optionally - up to fileN from the desktop computer to the target on the device. The target may be eighter a file or directory name on the device. If it is a file name, then the source file from the desktop computer is copied exactly to the file with the given name on the device. If multiple sources are given, then the next source overwrites the one previously copied to the device. If the target is a directory name, then the source files are copied to files on the device having the same name as the sorce files and located in the given directory.

The function does not warn about overwriting files on the device. Further on shells with wildcard expanding, so on most unix shells and on cmd.exe with few modifications, the source files may be given as wildcards. The shell cares then about finding local files accordimg to the given pattern.

The sorce file name may be also an empty string or a single minus "-" character, in this case the source is read from the standard input stdin.

Examples:

rapi put MyCV.doc "/My Documents"
rapi put MyCV.doc "/My Documents/HisCV.doc"
rapi put mom.png dad.png aunt.png "/My Documents/My Pictures"
iconv -f UTF-8 -t UCS-2LE file.txt | rapi put - /file.txt

rapi run

rapi run program [parameters]
Runs a program on the Windows CE device. Multiple parameters or parameters containing whitespaces must be quoted. Examples:
rapi run "/Program Files/cetoys/scrsht.exe" "/Memory card/temp/file.bmp"
rapi run "/Program Files/cetoys/sms.exe" "+48123456789 Will come later"
rapi run "/Program Files/cetoys/clipboard.exe" "paste /file.txt"
All examples call programs included in the installation package cetoys.cab in their default installation directories. The first one makes a screensot into the file file.bmp in directory temp on the memory card. The second example sends an SMS. details. The last example pastes current clipboard data on the device into the file file.txt (be aware that the program is able to paste also bitmaps) in the root of the file system on the device.

rapi rm

rapi rm file
Deletes a single file on the device. Example
rapi rm "/My Documents/For Mary.doc"
Only single files can be deleted with this function. Use "rapi mdel" for deleting multiple files or file groups named by wildcards.

rapi del

Exactly the same as "rapi rm".

rapi mdel

rapi mdel file1 [... fileN]

Removes multiple files on the device. The files can be named exactly or using wildcards in windows syntax. Example:

rapi mdel "/My Documents/*.doc"
rapi mdel "/My Documents/ToMary.doc" "/My Documents/ToKaty.doc"

rapi mv

rapi mv file_src file_target
Renames one file from file_src to file_target on the device.

rapi ln

rapi ln file file_link

Creates a link file_lnk to the file on the device. This function mostly won't work on unix, where librapi doesn't implement it.

rapi folders

rapi folders
Lists special folders available on the device for the following special folder IDs:
  1. CSIDL_PROGRAMS,
  2. CSIDL_PERSONAL,
  3. CSIDL_STARTUP,
  4. CSIDL_RECENT,
  5. CSIDL_STARTMENU,
  6. CSIDL_DESKTOPDIRECTORY,
  7. CSIDL_FONTS,
  8. CSIDL_FAVORITES

Example: rapi folders on Windows Mobile 6 version for Germany:

C:\temp> rapi folders
CSIDL_PROGRAMS           2 \Windows\StartmenĂź\Programme
CSIDL_PERSONAL           5 \My Documents
CSIDL_STARTUP            7 \Windows\AutoStart
CSIDL_RECENT             8 
CSIDL_STARTMENU         11 \Windows\StartmenĂź
CSIDL_DESKTOPDIRECTORY  16 
CSIDL_FONTS             20 \Windows\Schriftarten
CSIDL_FAVORITES         22 

rapi reg

rapi reg [HKCU|HKLM|HKCR] keypath
Shows value of the key for the given path.
  1. HKCU - HKEY_CURRENT_USER
  2. HKLM - HKEY_LOCAL_MACHINE
  3. HKCR - HKEY_CLASSES_ROOT

Keypath is the registry key separated with backslashes, slashes not allowed. Example:

% rapi reg HKCU "Software\\Microsoft\\Excel\\Pocket 2.0\\Default Font"
...
[Software\Microsoft\Excel\Pocket 2.0\Default Font]\FaceName REG_SZ Tahoma
[Software\Microsoft\Excel\Pocket 2.0\Default Font]\PitchFamily REG_BINARY len 1
[Software\Microsoft\Excel\Pocket 2.0\Default Font]\Quality REG_BINARY len 1
[Software\Microsoft\Excel\Pocket 2.0\Default Font]\ClipPrecision REG_BINARY len 1
[Software\Microsoft\Excel\Pocket 2.0\Default Font]\OutPrecision REG_BINARY len 1
[Software\Microsoft\Excel\Pocket 2.0\Default Font]\CharSet REG_BINARY len 1
[Software\Microsoft\Excel\Pocket 2.0\Default Font]\StrikeOut REG_BINARY len 1
[Software\Microsoft\Excel\Pocket 2.0\Default Font]\Underline REG_BINARY len 1
[Software\Microsoft\Excel\Pocket 2.0\Default Font]\Italic REG_BINARY len 1
...

rapi ver

Prints version of the operating system on the device.
C:\temp> rapi ver
Version 5.2 build 1620 platform id 3 csd 

rapi chmod

rapi chmod mode1 [mode2 ... moden] file -\n"
Changes file attributes for file to mode. mode may be either a number, then the file attribute is set exactly to this number, else it may be one of:
  1. +/-A - add or remove the archive attribute
  2. +/-H - add or remove the hidden attribute
  3. +/-R - add or remove the read only attribute
  4. +/-S - add or remove the system attribute
  5. +/-T - add or remove the temporary attribute

The function won't possibly work on unix systems where librarpi doesn't implement it the underlying RAPI function.

Example:

rapi chmod +H /Speicherkarte/temp/cells.db

rapi installed

Shows names of packages installed on the device. Example:
C:\temp>rapi installed
stoinski cetoys
stoinski serial
stoinski dict
Microsoft Guava Bubbles
PythonCE Python25
4wce WCE FTP Client
Mozilla Minimo
Microsoft Windows Mobile Green
Customization Customize_Tool
In fact the fuction lists the registry key "Software\\Apps" in HKLM.

rapi uninstall

Uninstalls package, the package name according to names returned by "rapi installed". In fact the fuction calls unload.exe with the given parameter. Recently the unload process has changed and the Windows Mobile or CE doesn't include unload.exe. This function will not work on such devices.

rapi install

rapi install file.cab
Installs the given cabinet file on the device. The cabinet file file.cab is assumed to be located on the desktop computer. In fact the function copies the given cabinet file from the desktop computer to the file
\Windows\AppMgr\Install\install.cab
on the device using a function similar to rapi put and then it calls program wceload.exe there using rapi run.

Example:

rapi install /tmp/cetoys.cab

rapi smsexepath

Shows the path to the program for sending SMS. This program is needed by the function rapi sms. The path is searched in the following order:
  1. If the environment variable CETOYS_SMS_EXE is set and it points to an existing file on the device, then the value of this variable is returned.
  2. Else it looks for the installation directory of the package "stoinski cetoys" by looking for the registry key [\Software\Apps\stoinski cetoys]\InstDir or the directory \Program Files\cetoys. If one of the directories exist, then it returns the path to the program sms.exe in this directory.
  3. Else it says, that the program sms.exe does not exist.

Example:

stoinski@daniel:/tmp> rapi smsexepath
\Programme\cetoys\sms.exe
stoinski@daniel:/tmp> rapi ls /Speicherkarte/temp/sms.exe
A--------- 20100522 110602 20100522 000000 20100522 110602      40683 sms.exe
stoinski@daniel:/tmp> CETOYS_SMS_EXE=/Speicherkarte/temp/sms.exe rapi smsexepath
/Speicherkarte/temp/sms.exe

rapi sms

rapi sms phone "SMS text"
Sends SMS with the given text to the given phone number. In fact it uses the program returned in the function rapi smsexepath and passes the given phone and text as command line parameters to it. In the most cases the program sms.exe will be used, which is then called as:
\Program Files\cetoys\sms.exe "phone SMS text"
using rapi run.

rapi shtexepath

Shows the path to the program for making screenshots. This program is needed by the function rapi scrsht. The path is searched in the following order:
  1. If the environment variable CETOYS_SHT_EXE is set and it points to an existing file on the device, then the value of this variable is returned.
  2. Else it looks for the installation directory of the package "stoinski cetoys" by looking for the registry key [\Software\Apps\stoinski cetoys]\InstDir or the directory \Program Files\cetoys. If one of the directories exist, then it returns the path to the program scrsht.exe in this directory.
  3. Else it says, that the program scrsht.exe does not exist.

Example:

stoinski@daniel:~> rapi shtexepath
\Programme\cetoys\scrsht.exe

rapi scrsht

rapi scrsht [file.bmp|-]
Makes a screenshot of the current screen on the device and stores it in the given file or writes to standard output. In particular the function makes the following:
  1. Finds program for making screenshots on the device, which name is returned by rapi shtexepath. By default it is the program scrsht.exe located in the installation directory of the package "stoinski cetoys".
  2. The program is called on the device with one parameter: a temporary file name. The call is made on the similar way like in rapi run.
  3. The temporary file is copied to the given file or to stdout on the desktop computer, similarly like it is done in rapi get.
  4. The temporary file is removed from the device.

Examples:

rapi scrsht file.bmp
rapi scrsht | xv -

rapi cbexepath

Shows the path to the program for clipboard operations. This program is needed by the function rapi cb. The path is searched in the following order:
  1. If the environment variable CETOYS_CB_EXE is set and it points to an existing file on the device, then the value of this variable is returned.
  2. Else it looks for the installation directory of the package "stoinski cetoys" by looking for the registry key [\Software\Apps\stoinski cetoys]\InstDir or the directory \Program Files\cetoys. If one of the directories exist, then in returns the path to the program clipboard.exe in this directory.
  3. Else it says, that the program clipboard.exe does not exist.

Example:

stoinski@daniel:~> ./rapi cbexepath
\Programme\cetoys\clipboard.exe

rapi cb

rapi cb copy|paste [file|-]
Copies the contents of the given file for standard input on the desktop computer into the clipboard of the device or pastes the contents of the clipboard on the device into the given file on the desktop computer or into its standard output. In fact the function calls program returned by rapi cbexepath on the device with parameter copy or paste and a temporary file name and transfers the temporary file on the device into or from the given file on the desktop computer.

Example: pasting a path copied from the windows explorer on the device

stoinski@daniel:~> rapi cb paste -
\My Documents\Alouette.midstoinski@daniel:~>
Example: pasting text entered in MS Word on the device:
stoinski@daniel:~> rapi cb paste - | iconv -f UCS-2LE
Dobrze się stało, że źle się stało. Lech Wałęsa

rapi edit

rapi edit file
Edits a file on the device. In fact the functions retrieves the file from the device to a temporary file on the desktop computer using rapi get, then it opens the temporary file using a text editior on the desktop computer and finally, if the exit code of the editor is 0, then it transfers the temporary file from the desktop computer back to the named file on the device. The editor may be set using one of the environment variables RAPI_EDITOR or EDITOR, by default notepad.exe is used for Windows or vi else.

rapi tar

rapi tar file.tar|- directory
Creates a tar file in ustar format on the desktop computer from a directory structure on the device. Tariing may be also used for copying whole directory structures from the device to the desktop computer.

Example:

stoinski@daniel:/tmp> rapi tar file.tar Speicherkarte/temp
stoinski@daniel:/tmp> tar tf file.tar
Speicherkarte/temp/clipboard.exe
Speicherkarte/temp/sms.exe
stoinski@daniel:/tmp> rapi tar - Speicherkarte/temp | tar xf -
stoinski@daniel:/tmp> find Speicherkarte 
Speicherkarte
Speicherkarte/temp
Speicherkarte/temp/sms.exe
Speicherkarte/temp/clipboard.exe

Generated on Mon Jul 12 14:51:51 2010 for cetoys by  doxygen 1.5.6