Benjamin (Gonzalo, Luke, Quentin),<br><br>Did you post the serial port code you mentioned? I'd really appreciate it. My goal is to work with GPS hardware attached through a serial port. My hope was that the pygarmin module could be "easily" adapted to work with a Trimble GPS on the PocketPC (but it uses win32file/win32com which both appear to be unavailable on PythonCE). In my search, I also noticed that in Mobile
5.0, Microsoft has released the GPS Intermediate Driver (but I don't think this helps on the PPC 4). PocketGPSLib also holds some promise for use with ctypes, but it's severly un-documented. I'm not at all versed in building so the '.cpp' files that were offered up in this thread don't make any sense to me. Further complicating matters, the Trimble protocol seems to be mostly non-existent, publicly anyway.
<br><br>Up the creek without a paddle, does anyone have a paddle?<br><br>Thanks,<br>Matt<br><br><div><span class="gmail_quote">On 6/23/06, <b class="gmail_sendername">Benjamin McBride</b> <<a href="mailto:benjamin.mcbride@gmail.com">
benjamin.mcbride@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Thanks all for your help!<br><br>The final key was to use the wide-character variant of CreateFile. As
<br>soon as I have the code cleaned up I will post the code (should be in the<br>next day or so). It will have a similar interface as pySerial.<br><br>Thanks,<br><br>Ben McBride<br><br>On 6/21/06, Luke Dunstan <<a href="mailto:coder_infidel@hotmail.com">
coder_infidel@hotmail.com</a>> wrote:<br>><br>> You need to use the wide-character variants of Windows APIs, i.e.<br>> CreateFileW<br>><br>> Luke<br>><br>> ----- Original Message -----<br>> From: "Benjamin McBride" <
<a href="mailto:benjamin.mcbride@gmail.com">benjamin.mcbride@gmail.com</a>><br>> To: <<a href="mailto:pythonce@python.org">pythonce@python.org</a>><br>> Sent: Wednesday, June 21, 2006 4:54 AM<br>> Subject: Re: [PythonCE] serial port access
<br>><br>><br>> Thanks Gonzalo for your help. I have read both the ctypes and<br>> microsoft documentation. My understanding is that I need to use the<br>> CreateFile API function from the coredll to get a handle to the comm
<br>> port. When I use ctypes:<br>><br>> >>> windll.coredll.CreateFile<br>><br>> I get an AttributeError saying the CreateFile function is not found.<br>> Ironically, the ReadFile, WriteFile, and CloseHandle functions are all
<br>> found.<br>><br>> Am I just missing something simple here?<br>><br>> Ben<br>><br>> On 6/20/06, Gonzalo Monzón <<a href="mailto:gmc@serveisw3.net">gmc@serveisw3.net</a>> wrote:<br>> > Have you read the ctypes docs?
<br>> ><br>> > <a href="http://starship.python.net/crew/theller/ctypes/tutorial.html">http://starship.python.net/crew/theller/ctypes/tutorial.html</a><br>> ><br>> > You have to read the Microsoft docs too, search what dynamic libraries
<br>> > to use and what functions to call. Study the example I posted, you have<br>> > to call these functions using ctypes:<br>> ><br>> > (openfile, readfile, writefile...)<br>> ><br>> > Don't know if somebody has implemented serial access using ctypes as to
<br>> > post an example, read the docs, first you need to understand how ctypes<br>> > work -for that you should know or learn what C variable types are and<br>> > understand it almost a little bit, then the codeproject example will
<br>> > come in handy- otherwise could be hard to code... Though any ctypes<br>> > example handling file or stream data may help you. Though pyserial uses<br>> > ctypes too, so you could have a look to the sources. The differences are
<br>> > you have to use straight windows api calls, and pyserial calls a helper<br>> > library wich should use windows api's for windows platform.<br>> ><br>> > I have to code serial access too in the next weeks, but don't have the
<br>> > time now to get my hands in it. If you are not in hurry I could post an<br>> > example when done.<br>> ><br>> > Gonzalo.<br>> ><br>> ><br>> > Benjamin McBride escribió:<br>
> ><br>> > >I've got ctypes installed. However, I have not been able to find any<br>> > >examples of how I might use ctypes for serial port access. Any<br>> > >suggestions would be appreciated.
<br>> > ><br>> > >Thanks,<br>> > ><br>> > >Ben<br>> > ><br>> > >On 6/20/06, Gonzalo Monzón <<a href="mailto:gmc@serveisw3.net">gmc@serveisw3.net</a>> wrote:<br>> > >
<br>> > ><br>> > >>Hi Benjamin,<br>> > >><br>> > >>You can use ctypes for direct access to serial ports via windows apis<br>> > >>(openfile, readfile, writefile...)
<br>> > >><br>> > >>Note that manufacturers can have specific implementations, even they<br>> > >>must agree to PPC implementation, but you can found small differences.<br>> > >>
<br>> > >><a href="http://www.codeproject.com/system/simpleserialcomm.asp">http://www.codeproject.com/system/simpleserialcomm.asp</a><br>> > >><br>> > >>Regards,<br>> > >>Gonzalo
<br>> > >><br>> > >><br>> > >>Benjamin McBride escribió:<br>> > >><br>> > >><br>> > >><br>> > >>> Hi All,<br>> > >>>
<br>> > >>> I need to access the serial port for my PPC application. I have<br>> > >>> been<br>> > >>> unable to locate information on this. I'm using Python 2.4.3 and<br>
> > >>> PPC<br>> > >>> 2003. Previously I've used pyserial, but it appears that pyserial<br>> > >>> does<br>> > >>> not work on Windows CE.<br>> > >>>
<br>> > >>> Thanks for any suggestions,<br>> > >>><br>> > >>> Ben McBride<br>> > >>> <a href="mailto:bdm7935@ksu.edu">bdm7935@ksu.edu</a><br>> > >>>_______________________________________________
<br>> > >>>PythonCE mailing list<br>> > >>><a href="mailto:PythonCE@python.org">PythonCE@python.org</a><br>> > >>><a href="http://mail.python.org/mailman/listinfo/pythonce">http://mail.python.org/mailman/listinfo/pythonce
</a><br>> > >>><br>> > >>><br>> > >>><br>> > >>><br>> > >>><br>> > >><br>> > >><br>> > >_______________________________________________
<br>> > >PythonCE mailing list<br>> > ><a href="mailto:PythonCE@python.org">PythonCE@python.org</a><br>> > ><a href="http://mail.python.org/mailman/listinfo/pythonce">http://mail.python.org/mailman/listinfo/pythonce
</a><br>> > ><br>> > ><br>> > ><br>> ><br>> ><br>> _______________________________________________<br>> PythonCE mailing list<br>> <a href="mailto:PythonCE@python.org">PythonCE@python.org
</a><br>> <a href="http://mail.python.org/mailman/listinfo/pythonce">http://mail.python.org/mailman/listinfo/pythonce</a><br>> _______________________________________________<br>> PythonCE mailing list<br>> <a href="mailto:PythonCE@python.org">
PythonCE@python.org</a><br>> <a href="http://mail.python.org/mailman/listinfo/pythonce">http://mail.python.org/mailman/listinfo/pythonce</a><br>><br>_______________________________________________<br>PythonCE mailing list
<br><a href="mailto:PythonCE@python.org">PythonCE@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/pythonce">http://mail.python.org/mailman/listinfo/pythonce</a><br></blockquote></div><br>