managing serial port interrupt
-
Hi to all, I made a deep search in this and other sites about serial communications management in Win32 (Win9X,2000,XP) All the results leads to using ReadFile and the other file-style functions But is any way to use interrupts (int of received char) on Windows?Must I create a device drivers? Thanks to all Cristian
-
Hi to all, I made a deep search in this and other sites about serial communications management in Win32 (Win9X,2000,XP) All the results leads to using ReadFile and the other file-style functions But is any way to use interrupts (int of received char) on Windows?Must I create a device drivers? Thanks to all Cristian
-
Hi to all, I made a deep search in this and other sites about serial communications management in Win32 (Win9X,2000,XP) All the results leads to using ReadFile and the other file-style functions But is any way to use interrupts (int of received char) on Windows?Must I create a device drivers? Thanks to all Cristian
-
Ever considered using this: http://www.codeproject.com/system/cserialport.asp[^] ~RaGE();
I use Visual C++ 6.0 and I studied the article "Serial Communications in Win32" of msdn My question is a question my boss made me I know it's not very easy to interact with hardware at low level on Windows and all the articles I found uses overlapped operation and ReadFile/WriteFile to read/write COM ports Now in Italy is 6 p.m., so I have to leave office ;P Sorry if I don't reply immediately Thanks in advance ;)
-
I use Visual C++ 6.0 and I studied the article "Serial Communications in Win32" of msdn My question is a question my boss made me I know it's not very easy to interact with hardware at low level on Windows and all the articles I found uses overlapped operation and ReadFile/WriteFile to read/write COM ports Now in Italy is 6 p.m., so I have to leave office ;P Sorry if I don't reply immediately Thanks in advance ;)
misturas wrote:
Now in Italy is 6 p.m
:doh: Really ? I am sitting in Germany, and it is still 5 p.m. Did not know that Germany had a different time than Italy. As for serial communication, there are lots of wrappers that consider the serial port as a file with read/write operation. This is very handy for serial communication, but not for your purposes. I think what you are looking for is a way to get the hand when a serial interrupt is called (as we used to do under DOS or on microcontrollers). I think this should be feasible with the API I have provided you with, in this case you must get a Windows message as soon as something lands on the serial buffer. ~RaGE();
-
misturas wrote:
ReadFile
Mmmh .. .really ? What are you trying to achieve exactely ? ~RaGE();
Yes, sure. What is the problem with that ? Reading and writing data on the serial port is done with ReadFile and WriteFile.
-
Hi to all, I made a deep search in this and other sites about serial communications management in Win32 (Win9X,2000,XP) All the results leads to using ReadFile and the other file-style functions But is any way to use interrupts (int of received char) on Windows?Must I create a device drivers? Thanks to all Cristian
Maybe it would help a lot if you describe exactly what you want to achieve. In general, reading and writing to a serial port can be done by several ways (specifically for reading). You can use a loop with timeouts (in a separate thread for example), ... But if you want to really respond when there is an interuption, then you'll need to go for a device driver (and I suppose it must be tricky to do). Anyway, even inside your driver, you will still have the problems of the real-time behavior, which is that Windows is not a real time operating system, so everything you want to achieve under the resolution of 10 msec (it can vary) is unfeasible.
-
Yes, sure. What is the problem with that ? Reading and writing data on the serial port is done with ReadFile and WriteFile.
-
Hi to all, I made a deep search in this and other sites about serial communications management in Win32 (Win9X,2000,XP) All the results leads to using ReadFile and the other file-style functions But is any way to use interrupts (int of received char) on Windows?Must I create a device drivers? Thanks to all Cristian
If you want to be notified on receipt of a char, you can use overlapped I/O with your read. That way an Event will be signalled any time you receive a character. You could put a receive loop in a separate thread, anf then post each characted received with a resgistered window message. The choices may not be endless, but they are several! Iain.
-
If you want to be notified on receipt of a char, you can use overlapped I/O with your read. That way an Event will be signalled any time you receive a character. You could put a receive loop in a separate thread, anf then post each characted received with a resgistered window message. The choices may not be endless, but they are several! Iain.
Ok, for rage, yes it was 5 p.m. I know the way ReadFile Overlapped IO etc. I was asking myself if there was a way of control interrupt the way dos/microcontroller do I think the only suitable way is creating a device driver It's better if re-study behavior of ReadFile,Events and Overlapped IO Thanks to all:)