473,395 Members | 1,584 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,395 software developers and data experts.

USB Programming

Hi,

Where would be a good place to go to find resources on programming USB
device drivers, or programs that just reads data from USB devices.
(Example: reading signals from USB GPS receiver).

I just need a starting place to research it.

Thanks,
Martin
Nov 13 '05 #1
4 16624


Martin Lui wrote:
Hi,

Where would be a good place to go to find resources on programming USB
device drivers, or programs that just reads data from USB devices.
(Example: reading signals from USB GPS receiver).

I just need a starting place to research it.

Thanks,
Martin


Google?

Nov 13 '05 #2
"Martin Lui" <cs******@pentagon.CS.Berkeley.EDU> wrote in message
news:Pi*******************************@pentagon.CS .Berkeley.EDU...
Hi,

Where would be a good place to go to find resources on programming USB
device drivers, or programs that just reads data from USB devices.
(Example: reading signals from USB GPS receiver).


Seriously, start with Google and then move on to a newsgroup pertaining to
your intended platform. There is a lot involved with writing USB drivers
and none of it have anything directly to do with the C language.
Nov 13 '05 #3
>Where would be a good place to go to find resources on programming USB
device drivers, or programs that just reads data from USB devices.
(Example: reading signals from USB GPS receiver).

I just need a starting place to research it.


This is largely off-topic for comp.lang.c, but there is some
relevance in my answer.

Your system might provide a file name you can use fopen() on to
read the data stream for the USB device. (On my laptop it's
"/dev/ugen0.1"). You don't seem to have to ask for the data, it
just arrives continually. You can then use fgets() to read in NMEA
sentences. strtok() is generally unsuitable for parsing it (a GPS
receiver may leave a blank field with two consecutive commas, which
strtok() considers to be a single field separator. strsep() as
found in BSD Unix, while not standard, works better for this purpose).

My GPS daemon could almost be written in ANSI C, with command-line
supplied system-specific filename, except for the part about stuffing
the current position information into a shared memory segment where
other programs can look at it. I suppose I could have kept re-writing
the data into a file, but I thought that wasn't real-time enough.

The line *might* end in a \r\n combination even on systems where
normal files have lines that end in just \n as they are stored, so
you might want to intentionally ignore a \r character if one shows
up. Other than this, NMEA sentences are in plain text (ASCII on
all GPS receivers I have heard of).

$GPRMC,011518,A,3240.1036,N,09727.3581,W,0.023,324 .2,181003,5.6,E*63
^^^^^^^^^^^
32 degrees, 40.1036 minutes north latitude

$GPRMC,011518,A,3240.1036,N,09727.3581,W,0.023,324 .2,181003,5.6,E*63
^^^^^^^^^^^^
97 degrees 27.3581 minutes west longitude

$GPRMC,011518,A,3240.1036,N,09727.3581,W,0.023,324 .2,181003,5.6,E*63
^^^^^^ ^^^^^^
01:15:18 UTC October 18, 2003

There's also speed in knots, compass direction, magnetic variation
from true north, and a checksum in there. And there are other
sentences with other information.

Gordon L. Burditt
Nov 13 '05 #4
Max M
3
If you want to read from USB GPS receiver .. use Python...
You're program will be less than 10 lines...

I just did one...
Jul 19 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Martin | last post by:
When was inheritance intruduced into object oriented programming? More generally, does anyone know or have any sources on when the different features were introduced into object oriented...
12
by: G. | last post by:
Hi all, During my degree, BEng (Hons) Electronics and Communications Engineering, we did C programming every year, but I never kept it up, as I had no interest and didn't see the point. But now...
3
by: user | last post by:
Hi all, At the outset, I regret having to post this slightly OT post here. However, I strongly feel that people in this group would be the best to advise me on my predicament. I am working as...
134
by: evolnet.regular | last post by:
I've been utilising C for lots of small and a few medium-sized personal projects over the course of the past decade, and I've realised lately just how little progress it's made since then. I've...
7
by: Robert Seacord | last post by:
The CERT/CC has just deployed a new web site dedicated to developing secure coding standards for the C programming language, C++, and eventually other programming language. We have already...
30
by: Jakle | last post by:
I have been googling, but can seem to find out about C GUI libraries. My main platform is Windows, but it would be nice to find a cross platform library. I've been programming with php, which...
47
by: Thierry Chappuis | last post by:
Hi, I'm interested in techniques used to program in an object-oriented way using the C ANSI language. I'm studying the GObject library and Laurent Deniau's OOPC framework published on his web...
111
by: Enteng | last post by:
Hi I'm thinking about learning C as my first programming language. Would you recommend it? Also how do you suggest that I learn it?What books/tutorials should I read for someone like me? Thanks...
14
by: deko | last post by:
For building Windows desktop apps, the clear favorite is C#. But my clients can't afford to buy Microsoft products. So I need to develop software for Linux users and web applications. In the...
17
by: CoreyWhite | last post by:
I bought this book years ago, when I was just learning C++. Since then I've gone through every math course offered at my college, taken courses on coding C & thinking in terms how how to make the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...

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.