|
|
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Serial.cpp for 64bit
Serial.cpp for 64bit [message #36978] |
Fri, 03 August 2012 14:53  |
nlneilson
Messages: 644 Registered: January 2010 Location: U.S. California. Mojave &...
|
Contributor |
|
|
I have been using the serial.h and .cpp that was referenced in the forum which works good on 32bit but not 64bit.
Serial.cpp has
#ifdef PLATFORM_WIN32
Has someone used Serial files that work on 64bit in upp and preferably that the .exe will work on 32bit AND 64bit.
|
|
|
|
|
|
Re: Serial.cpp for 64bit [message #37001 is a reply to message #36997] |
Tue, 07 August 2012 06:04   |
nlneilson
Messages: 644 Registered: January 2010 Location: U.S. California. Mojave &...
|
Contributor |
|
|
Hi Jerson
I replaced the Serial.h and Serial.cpp in my app and tried it.
The data passed needs to be a string rather than int.
That is what was done in Python, Java and a previous C++ app.
I will make the changes to my app.
I fired up an older laptop and found a C++ project using the Eclipse C++.
Here is a .zip that includes the src and the SerialCom.h and .cpp.
It also has a compiled COMcheck1.exe which works on 32bit and 64bit. I am not sure if that was made with the same project.
Note that this is probably only for Windows.
http://www.nlneilson.com/apps/GPS4.zip
The serial code may be easier than the code you have and you may be able to get ideas from. I like to stay away from pointers.
But since your code works with Linux I will try that.
[Updated on: Tue, 07 August 2012 06:53] Report message to a moderator
|
|
|
|
Re: Serial.cpp for 64bit [message #37115 is a reply to message #37113] |
Sat, 25 August 2012 16:42   |
nlneilson
Messages: 644 Registered: January 2010 Location: U.S. California. Mojave &...
|
Contributor |
|
|
That would be great if it was incorporated in upp.
M$VC has good serial code, it may be tied in with their managed CL or whatever. Python has a good PySerial.
The code I am tinkering with works on WinXP but not Win7 32bit or 64bit. I am just getting a last error dwWord 6 which I have no idea what that is. A M$VC app just to check the ports works as well as the Sirfdemo, Python, ....
I am having the same problem with Jerson's code.
[Updated on: Wed, 29 August 2012 19:33] Report message to a moderator
|
|
|
Re: Serial.cpp for 64bit [message #37137 is a reply to message #37115] |
Tue, 28 August 2012 21:51   |
nlneilson
Messages: 644 Registered: January 2010 Location: U.S. California. Mojave &...
|
Contributor |
|
|
As previously mentioned:
http://www.nlneilson.com/apps/GPS4.zip
COMcheck1.exe dated 2008
This works on WinXP and Win7 32bit and 64bit.
It checks the ports that can be opened and then the baud rate.
It then parses the GPGGA NMEA sentence and prints it out.
Checking COM: 1 2 3 4 5 6 7 8 9 10 11 COM 11: opened
12 COM 12: opened
13 14 15 16 17 18 19 20
COM 11: check baud rate
9600 ▬Imk▬x 19200 ♀↔??? 38400 ???▲?♂ 57600 $GPGGA->OK
COM 12: check baud rate
4800 ?=▬??? 9600 ▬I? ?? 19200 ♀↔??? 38400 ???▲?♂ 57600 $GPGGA->OK
COM 11 at 57600
$GPGGA,223705.631,3412.7486,N,11911.6111,W,1,06,1.0,-24.5,M,-33.8,M,0.0,0000*5E
Lat 34.21248 Lon -119.19352 Alt 30ft GPS fix, # of Sat. 6
COM 12 at 57600
$GPGGA,223706.395,3412.7444,N,11911.6102,W,1,06,2.6,-14.3,M,-33.8,M,0.0,0000*5A
Lat 34.21241 Lon -119.19350 Alt 63ft GPS fix, # of Sat. 6
11.408 sec
N.L. Neilson (c)
It will check as many GPS receivers that are plugged in.
This may have been made with M$VC as the code in the GPS4 folder is from 2010 and doesn't seem to relate to the COMcheck1.exe
From the Serial.cpp from Jerson and nixnixnix this fails in Win7 but works OK with WinXP
if( !SetCommState( m_hIDComDev, &dcb ) ||
!SetupComm( m_hIDComDev, 10000, 10000 ) ||
If someone works on a project for bazaar I would be glad to help with parsing or whatever.
edit: fixed link for GPS4.zip
[Updated on: Wed, 29 August 2012 19:36] Report message to a moderator
|
|
|
Re: Serial.cpp for 64bit [message #37138 is a reply to message #37137] |
Tue, 28 August 2012 22:59   |
nlneilson
Messages: 644 Registered: January 2010 Location: U.S. California. Mojave &...
|
Contributor |
|
|
I found the folder the COMcheck code is in. It also has COMcheck2 that fixed a few glitches in COMcheck1.
http://www.nlneilson.com/wwposts/COMcheck.zip
Windows has:
using namespace System::IO::Ports;
If upp had something similar or could access that it would help.
edit: I just built the app again with the above code on Win7 64bit with M$VC 10 with the /clr option. I would like to connect to serial port in U++.
[Updated on: Wed, 29 August 2012 19:40] Report message to a moderator
|
|
|
|
|
Goto Forum:
Current Time: Sun May 11 11:51:47 CEST 2025
Total time taken to generate the page: 0.02704 seconds
|
|
|