usb2.0 driver

Dear all,
I am using the hokuyo laser for my project and it has only a usb 2.0 interface. They say they can provide source code for communicating with linux. Will this work in QNX?
Also could anyone help me out on how to start programming the usb driver in QNX

Thanks
Aswin

qnx.org/developers/docs/6.3. … about.html

Thanks mario, I have gone through the USB DDK. I also downloaded the USB DDK shell file from qnx downloads and installed it.

I found the drivers for keyboard in it and am trying to do the same procedure for my USB sensor. However I dont know understand how my USB device is identified when it is plugged in. Ae the vendor id and product id fields important? I just placed WILD_CARD there.

My main purpose is to send over a few bytes to the sensor and receive what the sensor gives back. If you have a simple framework for this please let me know

Thanks in advance
Aswin

Aswin,

When you run a ‘usb -v’ command does the laser device report as a HID device?

If it does, you can communicate with it via the hid driver instead of writing your own driver like the keyboard/mouse/printer examples.

Tim

Dear Tim,
following is the output of the command. Please guide me through the process.

usb -v

USB 0 (UHCI) v1.10, v1.01 DDK, v1.01 HCD
Control, Interrupt, Bulk, Isoch, Low speed, Full speed

USB 1 (UHCI) v1.10, v1.01 DDK, v1.01 HCD
Control, Interrupt, Bulk, Isoch, Low speed, Full speed

USB 2 (UHCI) v1.10, v1.01 DDK, v1.01 HCD
Control, Interrupt, Bulk, Isoch, Low speed, Full speed

Device Address : 1
Upstream Host Controller : 2
Upstream Device Address : 0
Upstream Port : 1
Upstream Port Speed : Full
Vendor : 0x15d1 (Hokuyo Data Flex for USB)
Product : 0x0000 (URG-X002 USB Driver)
Device Release : r1.00
Class : 0x02 (Communication)
Subclass : 0x00
Protocol : 0x00
Max PacketSize0 : 64
Configurations : 1
Configuration : 1
Attributes : 0xc0 (Self-powered)
Max Power : 100 mA

USB 3 (EHCI) v1.10, v1.01 DDK, v1.01 HCD
Control, Interrupt, Bulk, Full speed, High speed

Aswin

Aswin,

This line:

Class : 0x02 (Communication)

says the USB device is a Communication device.

It needed to say:

Class : 0x03 (HID)

to be able to use the HID driver.

So unfortunately, you will have to write your own driver like the keyboard/mouse/printer examples. The vendor and product fields are:

Vendor : 0x15d1 (Hokuyo Data Flex for USB)
Product : 0x0000 (URG-X002 USB Driver)

so you can use those values directly instead of wildcards (which would mean you would attempt to connect to any USB device which you definitely don’t want to do).

If there is two way communication with this device the printer example is the one you will want to use as your template. If the communication is one way (from the Laser device) you can use the keyboard or mouse example.

The first step I would take is to put in the vendor/product id. Then add some printf’s to the code to print out device insertion/removal and make sure your code is being called when the device is inserted/removed.

Tim

Dear all,

I am using the Voyager GS Scaner for my project and like Aswin’s laser, it has only a usb 2.0 interface. The QNX reports it like a HID device, and after usb -vvv:

USB 0 (UHCI) v1.10, v1.01 DDK, v1.01 HCD
Control, Interrupt, Bulk, Isoch, Low speed, Full speed

Device Address : 1
Upstream Host Controller : 0
Upstream Device Address : 0
Upstream Port : 1
Upstream Port Speed : Full
Vendor : 0x0c2e (Honeywell Scanning and Mobility)
Product : 0x0206 (Honeywell Scanning and Mobility Scanner)
Device Release : r4.14
USB Spec Release : v1.10
Serial Number : N/A
Class : 0x00 (Independant per interface)
Max PacketSize0 : 16
Languages : 0x0409 (English)
Current Frame : 150 (1024 bytes)
Configurations : 1
Configuration : 1 (HID Keyboard)
Attributes : 0x80 (Bus-powered)
Max Power : 450 mA
Interfaces : 2
Interface : 0 / 0
Class : 0x03 (HID)
Subclass : 0x01 (Boot interface)
Protocol : 0x01 (Keyboard)
Endpoints : Control + 1
Endpoint : 0
Attributes : Control
Max Packet Size: 16
Endpoint : 1
Attributes : Interrupt/IN
Max Packet Size: 16
Interval : 1 ms
Interface : 1 / 0
Class : 0x03 (HID)
Subclass : 0x00
Protocol : 0x00
Endpoints : Control + 1
Endpoint : 0
Attributes : Control
Max Packet Size: 16
Endpoint : 3
Attributes : Interrupt/IN
Max Packet Size: 8
Interval : 10 ms

USB 1 (UHCI) v1.10, v1.01 DDK, v1.01 HCD
Control, Interrupt, Bulk, Isoch, Low speed, Full speed

USB 2 (UHCI) v1.10, v1.01 DDK, v1.01 HCD
Control, Interrupt, Bulk, Isoch, Low speed, Full speed

USB 3 (UHCI) v1.10, v1.01 DDK, v1.01 HCD
Control, Interrupt, Bulk, Isoch, Low speed, Full speed

USB 4 (EHCI) v1.10, v1.01 DDK, v1.01 HCD
Control, Interrupt, Bulk, Full speed, High speed .

Also hidview -a, after scanning returns:

HIDD v1.00, v1.00 DDK

Device Address : 0
Vendor : 0xffffffff (Legacy PS2 Keyboard)
Product : 0xffffffff (Keyboard)
Version : r1.00
Usage : Keyboard

Device Address : 1
Vendor : 0xffffffff (Legacy PS2/Serial Mouse)
Product : 0xffffffff (Mouse)
Version : r1.00
Usage : Mouse

Device Address : 2
Vendor : 0x0c2e (Honeywell Scanning and Mobility)
Product : 0x0206 (Honeywell Scanning and Mobility Scanner)
Version : r1.10
Usage : Keyboard

Device Address : 3
Vendor : 0x0c2e (Honeywell Scanning and Mobility)
Product : 0x0206 (Honeywell Scanning and Mobility Scanner)
Version : r1.10
Usage : Undefined

Report Data :
00 : 00 00 00 00 00 00 00 00
02 : 00 00 1e 00 00 00 00 00
02 : 00 00 00 00 00 00 00 00
02 : 00 00 1f 00 00 00 00 00
02 : 00 00 00 00 00 00 00 00
02 : 00 00 20 00 00 00 00 00
02 : 00 00 00 00 00 00 00 00
02 : 00 00 21 00 00 00 00 00
02 : 00 00 00 00 00 00 00 00
02 : 00 00 22 00 00 00 00 00
02 : 00 00 00 00 00 00 00 00
02 : 00 00 23 00 00 00 00 00
02 : 00 00 00 00 00 00 00 00
02 : 00 00 24 00 00 00 00 00
02 : 00 00 00 00 00 00 00 00
02 : 00 00 25 00 00 00 00 00
02 : 00 00 00 00 00 00 00 00
02 : 00 00 26 00 00 00 00 00
02 : 00 00 00 00 00 00 00 00
02 : 00 00 27 00 00 00 00 00
02 : 00 00 00 00 00 00 00 00
02 : 00 00 28 00 00 00 00 00
02 : 00 00 00 00 00 00 00 00
00 : 01 00 00 00 00 00 00 00
00 : 01 00 00 00 00 00 00 00
00 : 01 00 00 00 00 00 00 00
00 : 01 00 00 00 00 00 00 00
00 : 01 00 00 00 00 00 00 00
00 : 01 00 00 00 00 00 00 00
00 : 01 00 00 00 00 00 00 00
00 : 01 00 00 00 00 00 00 00
00 : 01 00 06 00 00 00 00 00

This is a simple 1234567890 bar code.

I am interested how can I use these data, somethig like in usual rs232 communication protocol, where is a /dev/ser1, etc… or like /dev/serusb1, and communicating with those ports… It’s about using hid drivers and io-hid I think, and looking there for appropriate devices. Generaly it’s a problem with a communication with usb devices, opening ports, sending and receiving data on QNX…

Thanks,
Sturmus

Hi Sturmus, you may refer to the post openqnx.com/index.php?name=P … 0085#50085. Now i am also suffering from realizing the bi-direction communication with the usb laser scanner.

Thanks Ericxx,
meanwhile I found necessary data in the /dev/console . You can see them using cat, and that was enough for me to write some appropriate program for handling them. But fortunately, I didn’t need to write data to laser.
Now it looks like that i would have to deal with usb device with communication class instead of HID soon, that would be “interesting”…
Only hoping it would be something that will devc-serusb support, but hardly because it is for usb-serial uart only…