[PythonCE] Bluetooth

Ruben Miguelez Garcia xrubenx.es at gmail.com
Tue Feb 13 17:30:13 CET 2007

> I have extracted the libraries and files that I think contain the core of
> the Bluetooth stack for Windows CE.

	They are:


	They can not contain absolutely everything, but the core for BT.

	I obtain this list joining all the files used by the BT library 
	And the ones used by wmconsole


> [1] Use SWIG and compile files for PocketPC in order to use them from
> Python.

	I tried to use SWIG and compile without success. No way to eliminate too many 
errors on SWIG parser output.

	Now I am thinking on compile them as a .dll and use it with ctypes. Any 
comment, hint, suggestion, help would be welcome.


	By the way, I could receive Bluetooth information on the PocketPC/PDA without 
use bluetooth.
	One BT device connect to the PDA using the Serial Port Profile, so the 
connection is mapped on a COM: port. Then using the module provided by 
Benjamin McBride  -- ceserial.py --, you open the port and read. That's all.

	Here I'll let a small code, because on my way I found a lot of help just 
reading a few lines that got me out of where I was stuck.

# Program to read and print the info received on COM6:  
# by Ruben  }:o)

import ceserial


   while port.isOpen(): # Need to modify this, because the port can be opened 
but the BT connection closed.
      take= comming * (comming >= MAX) or MAX * (MAX > comming)
      print data
except KeyboardInterrupt:  # If you press Ctrl+C
      print "Ending program..."

except ceserial.SerialException:
      print "Problem with COM6. Closing and ending"



 Kind regards / Cumprimentos / Atentamente, Ruben.

Começar já é metade de toda ação. 

Provérbio grego

More information about the PythonCE mailing list