473,320 Members | 2,162 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 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 8114
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 codes to connect to serial port using c#(visual...
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 giveme just what installed and defalut, i need...
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++ project to read the ASCII data from the device, with...
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 done but unable to read from it . could u plea...
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 device takes pics. The Device is configured to my OS...
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 system has to connect) in an INI file or in an edit...
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 the tcp over activesync doesn't work. The device is...
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 only data. i wrote a php code to do so but it still...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
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 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.