flat assembler
Message board for the users of flat assembler.

Index > Windows > Connect to USB device

Author
Thread Post new topic Reply to topic
FrozenKnight



Joined: 24 Jun 2005
Posts: 128
FrozenKnight
How would i connect to a USB device? i've tried Google and MSDN . i just cant find anything that explains it well enough for asm.
Post 10 Aug 2007, 10:19
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
What exactly do you mean by "connect to USB device"?

If you mean coding a driver, well, grab a copy of the USB specification and start sweating Wink
Post 10 Aug 2007, 10:55
View user's profile Send private message Visit poster's website Reply with quote
FrozenKnight



Joined: 24 Jun 2005
Posts: 128
FrozenKnight
the driver is already in the computer i just want to know how to identify if the device i want is connected and how to communicate with it.
Post 11 Aug 2007, 09:53
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
That will depend entirely on the kind of device... could you be a bit more specific?
Post 12 Aug 2007, 20:40
View user's profile Send private message Visit poster's website Reply with quote
FrozenKnight



Joined: 24 Jun 2005
Posts: 128
FrozenKnight
I'm trying to receive serial data from a GPS device that is NMEA 0183 complient. so i think the data should be similar to getting serial data or using a pipe.
Post 13 Aug 2007, 11:06
View user's profile Send private message Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2141
Location: Estonia
Madis731
I don't remember where I saw it, but some article enumerated USB-devices easily - I'll try to find them. I can't find the right one, but I remember it was a good one Very Happy I've studied it some myself because of MenuetOS, but not that much under Windows.
EDIT:
Saw something here: http://board.flatassembler.net/topic.php?t=4915
Under Windows: http://www.codeproject.com/system/EnumDeviceProperties.asp
Better if you use ASM: http://www.masm32.com/board/index.php?topic=2083.new
Maybe MSDN can help you: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=717715&SiteID=1

I don't know if there's source code for the http://support.microsoft.com/kb/838100 but this can help also.

Some chit-chat Very Happy
http://www.lvr.com/usbcenum.htm
Post 13 Aug 2007, 11:26
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
TheRaven



Joined: 22 Apr 2008
Posts: 89
Location: U.S.A.
TheRaven
In a generic approach you would have to create a process that hooks your USB driver process not the device driver specifically.

When the device is connected the USB driver is instantiated and this is when your process can access your system's registered device list and search for the desired device. This is the best way to handle this problem as it will be far more memory friendly across the boards.

NOTE:
There are freeware and open source utilities that minimize to the system tray and monitor for USB thumb drives in this fashion. Get one and if possible dis-assemble it into assembly and translate. There are other tools that dis-assemble into hex as well. It is all a matter of taste.

Sidebar:
This might seem a bit rediculous, but you must be aware that when you create systems and especially systems that deal with services that you compensate for lag in the services and systems that you wish to interact with. Programs in assembly are much faster than many other HLL programs for allot of reasons and thus may shoot ahead before the system and/or service is actually available for access. This type of error would be classified as a logical error and is among the hardest to debug.

_________________
Nothing so sought and avoided more than the truth.
I'm not insane, I know the voices in my head aren't real!
Post 25 Apr 2008, 01:59
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.