472,344 Members | 1,246 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,344 software developers and data experts.

Communicating to a serial device using Dev-C++

I would like to play with an older GPS unit that has a serial interface. I am using XP and Dev-C++. I have some console based experience in C, but no windows experience to speak of. To remedy that, I would like to write a windows app that will simply monitor the output of the GPS, and send commands to the GPS interactively from a text box.

My questions:
Is Dev-C++ suitable to the task?
Is the "win32" library used, or is there a specific library to use to specify a com port?
In either case, is there a good reference (preferably free) for the proper library?

Thanks,
David
Mar 8 '08 #1
2 8022
Banfa
9,065 Expert Mod 8TB
Serial port access is part of the standard WIN32 API, you don't need any additional libraries and youcan findmost of what you need on MSDN.

Look up the functions

CloseHandle Closes an open object handle.
CreateFile Creates or opens a file, directory, physical disk, volume, console buffer, tape drive, communications resource, mailslot, or named pipe.
ReadFile Reads data from a file, starting at the position that is indicated by a file pointer. This function can operate synchronously and asynchronously.
WriteFile Writes data to a file at a position that a file pointer specifies. This function can operate synchronously and asynchronously.

And optionally
ReadFileEx Reads data from a file asynchronously.
ReadFileScatter Reads data from a file and stores it in an array of buffers.
WriteFileEx Writes data to a file. This function reports the completion status asynchronously by calling a specified completion routine when writing is completed or canceled and when the calling thread is in an alertable wait state.
WriteFileGather Retrieves data from an array of buffers, and then writes the data to a file.

from MSDN File Management functions, yes I know they are called file management functions and you want to use a serial port but in true MS fashion they are poorly named and in fact access any handle with a data stream type.

Additionally you will want to look up the specific com port functions available as Communication Functions.

And here is the overview URL Communications Resources
Mar 8 '08 #2
... MSDN File Management functions, yes I know they are called file management functions and you want to use a serial port but in true MS fashion they are poorly named and in fact access any handle with a data stream type.

Additionally you will want to look up the specific com port functions available as Communication Functions.

And here is the overview URL Communications Resources
Thanks, this is exactly the help I needed, I was not aware there were online Win32 API references. I have been in the embedded community for too long!

David
Mar 10 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Hema Malini Rajanthiran | last post by:
to whom may concern...im final year student doing a project using handphone to create wireless communication. im finding difficulties to get the...
6
by: dev | last post by:
hi i want to know about interfacing or accessing a serial port using c-program please help me with an example thanks for whom who reply me soon
0
by: mzaiady | last post by:
I need to know how to get the monitor, motherboard and other hardware information and serial number using C, i can do it with WMI in windows but it...
0
by: rsr | last post by:
Hi friends, The serial device with whích I am trying to communicate replies in two formats.. ASCII and Binary. And I have created a VC++...
1
by: kameswara | last post by:
Hi folks , Can anyone help me out the problem regarding writing and reading data to/from a serial device like ttyS0 in linux . Writing is being...
0
by: Shival | last post by:
Hi, I have a Device that will be used by dentist to take their paitient teaath pics. this Device is having a click button from which the...
2
by: rsr | last post by:
Hi friends, I have written a VC++ application that connects with a serial device via a COM port and I specify the port number(thru which the...
4
by: Eran.Yasso | last post by:
Hi all, I am trying to write application which runs on my PC that sends data to an application running on Windows mobile. The problem is that...
3
by: Mary Mah | last post by:
Hi, iam building a system which will send data from website to serial port using PHP, the problem that i want to send bits to the serial port not...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.