473,466 Members | 1,462 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Help needed in C

1 New Member
I am a starter in C. I am doing a Project to on GPS. I have to connect GPS to my Laptop but the Laptop doesnot have serial port and hence i have to use USB-Serial adapter to connect to GPS. The connection gives COM12 port in device manager. The problem is how to get the GPS string in C. I tried certain to codes to open the port in C but they dont work. Also guide me whether it is possible to copy part of char string to int string using strncpy(). Thanks
Jul 3 '07 #1
4 1326
mac11
256 Contributor
I am a starter in C. I am doing a Project to on GPS. I have to connect GPS to my Laptop but the Laptop doesnot have serial port and hence i have to use USB-Serial adapter to connect to GPS. The connection gives COM12 port in device manager. The problem is how to get the GPS string in C. I tried certain to codes to open the port in C but they dont work. Also guide me whether it is possible to copy part of char string to int string using strncpy(). Thanks
This looks like it might be complicated to sort out, and probably impossible unless you can post more details. Can you show what code you have tried, or give more detail about what exactly you are trying when you say "code to open the port but they don't work"?

Do you have some documentation about your gps device that tells you how to communicate with it? Maybe it needs some magic dance before it will talk back.

Also, It is possible to convert chars to ints using atoi() (among other methods).
Jul 3 '07 #2
sicarie
4,677 Recognized Expert Moderator Specialist
Have you tried looking on Google for this? I found this on the first page of "c serial port programming" results, so you might try that, or if it's not completely helpful, some version of that...
Jul 3 '07 #3
RedSon
5,000 Recognized Expert Expert
Also, look on the website for the GPS manufacturer of your device. They might have resources for developers to use. API documentation or additional documentation. If the GPS driver assumes that it will be a serial com port in the range of COM1-4 then it might not be possible to tell the driver to look at COM12. It depends on the way the driver is implemented.
Jul 3 '07 #4
cnobile
6 New Member
Also it would be nice to know on what platform you wish to do this. Windows, Mac, Linux? You mention that it uses a COM port, this would be Windows, but are you trying to use it with Windows?

On Linux you can write code to the libusb package which will do most of the work for you. Then all you would need to do is convert the data coming and going from your device to the format needed in this library. What you are really doing here is writing a device driver regardless of the platform.

Another thing to think about is how will you connect the device to your computer. You mentioned that there is no serial port on your computer, is there also a USB port on your device?
Jul 4 '07 #5

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

Similar topics

28
by: stu_gots | last post by:
I have been losing sleep over this puzzle, and I'm convinced my train of thought is heading in the wrong direction. It is difficult to explain my circumstances, so I will present an identical...
7
by: ChadDiesel | last post by:
Hello everyone, I'm having a problem with Access that I need some help with. The short version is, I want to print a list of parts and part quantities that belong to a certain part group---One...
7
by: Tina | last post by:
I have an asp project that has 144 aspx/ascx pages, most with large code-behind files. Recently my dev box has been straining and taking long times to reneder the pages in the dev environment. ...
10
by: Mae Lim | last post by:
Dear all, I'm new to C# WebServices. I compile the WebService project it return no errors "Build: 1 succeeded, 0 failed, 0 skipped". Basically I have 2 WebMethod, when I try to invoke the...
2
by: trihanhcie | last post by:
I m currently working on a Unix server with a fedora 3 as an os My current version of mysql is 3.23.58. I'd like to upgrade the version to 5.0.18. After downloading from MYSQL.COM the package on...
2
by: Steve K | last post by:
I got a bit of a problem I like some help on. I'm designing an online training module for people that work in food processing plants. This is my target audience. These workers have little or no...
3
by: Kitana907 | last post by:
Hi- I'm attempting to write a module that uses and updates info from two tables and does the following: Opens the recordset of a table called "tblstoreinv" If the Needed Field in the...
9
by: smartbei | last post by:
Hello, I am a newbie with python, though I am having a lot of fun using it. Here is one of the excersizes I am trying to complete: the program is supposed to find the coin combination so that with...
2
by: rookiejavadude | last post by:
I'm have most of my java script done but can not figure out how to add a few buttons. I need to add a delete and add buttong to my existing java program. Not sure were to add it on how. Can anyone...
32
by: =?Utf-8?B?U2l2?= | last post by:
I have a form that I programmatically generate some check boxes and labels on. Later on when I want to draw the form with different data I want to clear the previously created items and then put...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.