Toon posts:

[Alg] USB poort ID

Pagina: 1
Acties:
  • 32 views sinds 30-01-2008

Verwijderd

Topicstarter
Ik ben bezig met een schoolprojectje waarbij ik gebruik maak van een usb-hub en memory sticks. Het idee is dat ik straks moet weten welke stick in welke poort van de usb-hub zit (dit is relevant voor een spelletje dat ik wil maken).

Ik heb wat research gedaan online, maar aangezien ik zelf geen programmeur ben kwam ik hier niet helemaal uit.

Mijn vraag is, is het uberhaubt mogelijk en zo ja, hoe pak ik dit het beste aan?

Ik werk voornamelijk op mac maar heb ook beschikking tot pc.

tnx!

  • igmar
  • Registratie: April 2000
  • Laatst online: 20-04 22:06

igmar

ISO20022

Dat is sterk OS afhankelijk, en aangezien je die info niet geeft is het gokwerk :)

  • NMe
  • Registratie: Februari 2004
  • Laatst online: 15-04 22:07

NMe

Quia Ego Sic Dico.

Met [google="usb protocol" port] kom ik al heel snel op deze site uit, waar ik nogal veelbelovende tutorials vind. Heb je daar niets aan?

Lees trouwens ook P&W FAQ - De "quickstart" even door; je topicstart is wat mager. Ik kan me niet voorstellen dat je helemaal niets gevonden hebt, en die dingen die je wel gevonden hebt zien we hier graag terug in je topicstart. Pas je topicstart dus even aan. :)

[ Voor 4% gewijzigd door NMe op 09-06-2005 13:56 ]

'E's fighting in there!' he stuttered, grabbing the captain's arm.
'All by himself?' said the captain.
'No, with everyone!' shouted Nobby, hopping from one foot to the other.


Verwijderd

Topicstarter
ik werk zelf op mac os X, maar ik heb ook beschikking tot een windows 2000 bak.

Het spelletje zelf wordt gemaakt in flash, de flash checkt een xml bestandje waarin staat welke stick in welke poort zit.

Ik heb nu dus iets nodig dat de poorten scanned en een xml bestandje uitpoept met de betreffende content.

  • NMe
  • Registratie: Februari 2004
  • Laatst online: 15-04 22:07

NMe

Quia Ego Sic Dico.

En je had niets aan de link die ik geef?

'E's fighting in there!' he stuttered, grabbing the captain's arm.
'All by himself?' said the captain.
'No, with everyone!' shouted Nobby, hopping from one foot to the other.


Verwijderd

Topicstarter
de link was zeer behulpzaam. iig weet ik nu dat het mogelijk is.

ik moet in C++ een programma'tje schrijven met de volgende referenties:


To retrieve the driver key name for a device, call SetupDiGetClassDevs and SetupDiEnumDeviceInfo, then use SetupDiGetDeviceRegistryPropertyA with Property set to SPDRP_DRIVER.

To retrieve the driver key name for a hub port, first find the hubs with SetupDi_ functions and GUID_DEVINTERFACE_USB_HUB.

Obtain a handle to a hub with CreateFile.

Get the number of ports on the hub with IOCTL_USB_GET_NODE_INFORMATION (undocumented IO control code in usbioctl.h).

Find out if a device is attached to a port with IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX.

For each attached device, get the driver key name with IOCTL_USB_GET_NODE_CONNECTION_DRIVERKEY_NAME (undocumented IO control code in usbioctl.h).



Nu heb ik helemaal geen ervaring met C++ dus dat gaat nog een flinke kluif worden. Ik heb iig weer iets om verder te kunnen. Bedankt!

trouwens, als iemand zich verveeld en me wil helpen, graag! :p

  • NMe
  • Registratie: Februari 2004
  • Laatst online: 15-04 22:07

NMe

Quia Ego Sic Dico.

Nouja, zo te zien kun je nu wel vooruit. :) Creepy geeft nog de tip om libusb (of libusb-win32) te gebruiken, al heb ik geen idee waarom hij dat zelf niet post. :P
Verwijderd schreef op donderdag 09 juni 2005 @ 16:35:
trouwens, als iemand zich verveeld en me wil helpen, graag! :p
Sorry, maar werving staan we hier op GoT niet toe. :)
[q=http://gathering.tweakers.net/forum/faq/policy#spam]• Wervingsacties van welke aard dan ook.
[..]
Bovenstaande wordt nadrukkelijk niet gewaardeerd op Gathering of Tweakers en zal minimaal een slotje opleveren.

Succes met je project in ieder geval. :)

'E's fighting in there!' he stuttered, grabbing the captain's arm.
'All by himself?' said the captain.
'No, with everyone!' shouted Nobby, hopping from one foot to the other.

Pagina: 1

Dit topic is gesloten.