Hi all,
I'm writing a PocketPC / CE application which communicates with a
Bluetooth GPS reciever that is paired to a serial port but I'm
experiencing odd behaviour from the CF 2.0 SerialPort class.
Everything is fine first time around, but if I quit my application and
restart a few times, pretty soon (usuaully the second or third
restart) the DataReceived event stops firing on the SerialPort object.
I'm connecting with this code:-
_comPort = new SerialPort(comPortName, comBaud, comParity,
comDataBits, comStopBits);
_comPort.Encoding = Encoding.ASCII;
_comPort.Handshake = comHandshake;
_comPort.ReceivedBytesThreshold = 1;
_comPort.DataReceived += new
SerialDataReceivedEventHandler(DataReceived);
_comPort.Open();
My DataReceived handler contains the following code:-
string newData = _comPort.ReadExisting();
When the app exits, I'm disconnecting / closing with:-
if (_comPort != null)
{
if (_comPort.IsOpen) _comPort.Close();
_comPort.Dispose();
_comPort = null;
}
Everything works fine on the first run, but after a couple of restarts
DataReceived stops firing. Any ideas?
Many TIA,
Simon 7 3925
hi Simon,
sorry. it is not about the topic but do you have any gps data parser
written in c#?
There's a free one here: http://www.opennetcf.com/sharedsource/serial.ocf
--
Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World www.OpenNETCF.com
"Hakan Fatih YILDIRIM" <hf*********@gmail.comwrote in message
news:11**********************@e65g2000hsc.googlegr oups.com...
hi Simon,
sorry. it is not about the topic but do you have any gps data parser
written in c#?
Hi,
I also have one written in C# in my book (see below) -- it isn't quite free,
but there is other code that you might find to be useful, too.
Dick
--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
"Dick Grier" <dick_grierNOSPAM@.msn.comschrieb im Newsbeitrag
news:ef**************@TK2MSFTNGP03.phx.gbl...
Hi,
I also have one written in C# in my book (see below) -- it isn't quite
free,
but there is other code that you might find to be useful, too.
Dick
Hi Dick,
did in your book are some code for Compactframwork ?
bye
Rainer
In this business I'd say the price of a book is free or even net positive,
as you gain way more than $50 if you learn much of anything from it.
--
Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World www.OpenNETCF.com
"Dick Grier" <dick_grierNOSPAM@.msn.comwrote in message
news:ef**************@TK2MSFTNGP03.phx.gbl...
Hi,
I also have one written in C# in my book (see below) -- it isn't quite
free, but there is other code that you might find to be useful, too.
Dick
--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
Hi,
Yes, Chapter 9 covers serial communications using the Compact Framework.
Dick
--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
On Jun 8, 10:49 pm, Hakan Fatih YILDIRIM <hfysilis...@gmail.com>
wrote:
hi Simon,
sorry. it is not about the topic but do you have any gps data parser
written in c#?
I do, yes, but parsing the NMEA data is the interesting bit. Unless
you're *really* pushed for time, forget copy/paste development and
roll your own. There's pretty much everything you need on the
following page:- http://www.kh-gps.de/nmea-faq.htm This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: LordHog |
last post by:
Hello all,
I would like to use the new SerialPort class in Visual C++ 2005
Express edition, but I am having problems adding my event handler to
the DataReceived event. In the header file I have...
|
by: Andrea Judge |
last post by:
Hi there,
I'm developing an application to catch OBD sensors' data from my car.
I connect it via a RS232 interface.
Now.
with HyperTerminal I can connect and send/receive data, but I'd like to...
|
by: no-one |
last post by:
Hi Guys,
I am fairly new to Dot Net and I am trying to write a program that
listens to the serial port and displays the string in a text box or
listbox. I am using VS 2005 and framework 2.0
...
|
by: Tony Kwong |
last post by:
I am using my mobile phone as modem to send some SMS using modem AT commands
and have the SerialPort.DataReceived to get the "reply" from the Port using
"m_SerialPort.ReadExisting();"
private...
|
by: herbert |
last post by:
back in 1978 (!) the VAX/VMS serial line driver offered everything a
developer needs to develop protocols of all kinds:
- read x bytes
- read to end of line
- read to special character
- read...
|
by: Jamie Risk |
last post by:
I'm trying to implement a protocol that has a concept of a GAP
timer in the serial stream; if two properly framed characters
are spaced in time by so many milliseconds or longer, there is
an...
|
by: Jamie Risk |
last post by:
What thread does the DataReceived event run on?
I'm preparing a design that uses the DataReceived event to
stimulate a protocol state machine (PSM). The ambition is to
have the serial process...
|
by: =?Utf-8?B?TGVuIFdlbHRtYW4=?= |
last post by:
I've created MySerialPort, which inherits from SerialPort, and want to set an
internal flag when DataReceived is signalled. If I were firing the event
myself, it would be a simple matter of
flag...
|
by: cronusf |
last post by:
I set up two virtual COM ports 3 and 4 using com0com. I tried to test
it with the following program. However, the DataReceived event
handlers never get called. Can anyone with SerialPort class...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |