[PythonCE] remote-console

Jan Ischebeck mail at jan-ischebeck.de
Thu Feb 22 18:08:34 CET 2007


Hi Thomas,

Your script works well for me on Ubuntu Feisty.

The only issue I have is, that it doesn't detect the "//Program Files/" 
folder correctly for non-US Pocket PCs. (E.g. German WinCE uses 
"//Programme/").

I've tried to get this directory via CeGetSpecialFolder, but was not 
successful. Below my additions to rapi.py to make use CeGetSpecialFolder.

Jan

#####################################################################
# getSpecialFolderPath

rapi.CeGetSpecialFolderPath.errcheck = errcheck
rapi.CeGetSpecialFolderPath.argtypes = (ctypes.c_int, DWORD, 
ctypes.c_void_p);

def GetSpecialFolderPath(folderid):
    length=128
    buf = ctypes.create_string_buffer('\000' * length)
    rapi.CeGetSpecialFolderPath(folderid, length, buf)
    value = ctypes.string_at(buf, length).decode('utf-16')
    return value[0:value.index('\x00')]

CSIDL_PROGRAMS=           0x0002
CSIDL_PERSONAL=           0x0005
CSIDL_FAVORITES_GRYPHON=  0x0006
CSIDL_STARTUP=            0x0007
CSIDL_RECENT=             0x0008
CSIDL_STARTMENU  =        0x000b
CSIDL_DESKTOPDIRECTORY=   0x0010
CSIDL_FONTS=              0x0014
CSIDL_FAVORITES=          0x0016

################################################################
# Error codes from Synce project (librapi2/src/rapi_types.h)

ERROR_SUCCESS = 0
ERROR_FILE_NOT_FOUND = 2
ERROR_NOT_ENOUGH_MEMORY = 8
ERROR_SEEK = 25
ERROR_INVALID_PARAMETER = 87
ERROR_INSUFFICIENT_BUFFER    = 122
ERROR_NO_DATA = 232
ERROR_NO_MORE_ITEMS = 259
ERROR_KEY_DELETED    = 1018

Thomas Heller schrieb:
> Ruben Miguelez Garcia schrieb:
>   
>>> Ah, great.  Yes, the current version only works on Windows, it requires
>>> that the device is connected via ActiveSync.  The CeRemoteAPI is used to
>>> transfer the client script to the device, and start the interpreter there. 
>>> Sorry for this limitation.  
>>>       
>>> Is there something on Linux that allows to 
>>> transfer files and start processes on the PDA?
>>>       
>> I really don't know because I didn't have time to investigate it and my 
>> application is already finished, so I won't work more with the PDA for some 
>> time.
>>
>> But I think It should be possible. I just connected the usb cable from the 
>> cradle to my laptop and this is the output from the kernel:
>>
>> --------------------
>> # dmesg
>> usb 2-1: new full speed USB device using uhci_hcd and address 2
>> drivers/usb/serial/usb-serial.c: USB Serial support registered for Generic
>> usbcore: registered new driver usbserial_generic
>> usbcore: registered new driver usbserial
>> drivers/usb/serial/usb-serial.c: USB Serial Driver core v2.0
>> drivers/usb/serial/usb-serial.c: USB Serial support registered for PocketPC 
>> PDA
>> drivers/usb/serial/ipaq.c: USB PocketPC PDA driver v0.5
>> ipaq 2-1:1.0: PocketPC PDA converter detected
>> usb 2-1: PocketPC PDA converter now attached to ttyUSB0
>> usbcore: registered new driver ipaq
>> ---------------------
>>
>>     
>
> I found the synce project on sourceforge.  This contains a rapi library that
> emulates the rapi.dll on Windows.
>
> I have adapted the remote console sources so that it also works on linux
> (tested on Ubuntu).
>
> I'm not a Linux expert, but here is (in short) what I did:
>
> - Installed the synce-serial, synce-dccm, libsynce0, librapi packages.
> - Cradled the CE device into the USB connector (I use a Dell X50 PDA,
>   with Windows Mobile 2003)
> - Run these commands (some or all of them with sudo):
>   modprobe ipaq
>   synce-serial-config ttyUSB0
>   synce-serial-start
>
> Now the device connects to the PC, and I can run console.py.
> Note that there should be no need to adjust anything in the console.py
> or the client.py sources (at least if you use the default IP address that
> synce suggests: 192.168.131.102).
>
> console.py accepts some command line switches that the python interpreter
> also understands.  Useful are probably "-c <statements>" and "-m <module>".
>
> Thomas
>
> _______________________________________________
> PythonCE mailing list
> PythonCE at python.org
> http://mail.python.org/mailman/listinfo/pythonce
>   



More information about the PythonCE mailing list