joystick driver... revisited...

bridged with qnx.development_tools
Post Reply
Miguel Simon

joystick driver... revisited...

Post by Miguel Simon » Mon Mar 21, 2005 5:56 pm

Hi...

I am about to dwell on this issue once again, and I wonder if we have a
joystick driver available for every one's good use? I have some basic
code from which to start, but I wonder if there would be an open source
project related to joystick of which I should be aware? Target OS is QNX
6.3.0 - SP1. Thanks.

Lacking the above, I wonder if we have a "how-to" or "know-what-not-do"
somewhere? Any useful pointers? Does QNX provide a USB interface that
may be joystick friendly? Thanks.

Regards...

Miguel.

Miguel Simon

Re: joystick driver... revisited...

Post by Miguel Simon » Mon Mar 21, 2005 11:36 pm

Hi...

[QNX 6.3.0 - SP1 - PE]

1. After starting the appropriate USB drivers, the system detects and
knows about the joystick. Very good, but the usb keyboard that was
running up to now stops working, and the Phindows windows exits when I
issue a 'sin' command. Any ideas?

2. When I run the following (joystick is device #2):

hidview -R -d2

I see columns of numbers (with 2 numbers or sometimes 3 num.) on the
left, and on the right I see what amounts to some documentation on the
joystick. I wonder what is the relation between the numbers on the
right and the words on the left?

3. the command

hidview -a -d2

works like a charm. This is encouraging. Is the source for this utility
in the appropriate USB DDK?

Thanks for your help.

Regards...

Miguel.


Miguel Simon wrote:
Hi...

I am about to dwell on this issue once again, and I wonder if we have a
joystick driver available for every one's good use? I have some basic
code from which to start, but I wonder if there would be an open source
project related to joystick of which I should be aware? Target OS is QNX
6.3.0 - SP1. Thanks.

Lacking the above, I wonder if we have a "how-to" or "know-what-not-do"
somewhere? Any useful pointers? Does QNX provide a USB interface that
may be joystick friendly? Thanks.

Regards...

Miguel.

Miguel Simon

Re: joystick driver... revisited...

Post by Miguel Simon » Tue Mar 22, 2005 3:34 am

Hi...

Ok, the numbers and data reported by hidview -R are an implementation of
the HID standard found on the web at www.usb.org. I suppose that the
HID driver is an implementation of the standard.

Also found the .h files where 'hidd_connect' and friends are declared.
But I found no documentation regarding these functions. Is there any
documentation of the sort (other than the .h file itself )?

Miguel Simon wrote:
Hi...

[QNX 6.3.0 - SP1 - PE]

1. After starting the appropriate USB drivers, the system detects and
knows about the joystick. Very good, but the usb keyboard that was
running up to now stops working, and the Phindows windows exits when I
issue a 'sin' command. Any ideas?

2. When I run the following (joystick is device #2):

hidview -R -d2

I see columns of numbers (with 2 numbers or sometimes 3 num.) on the
left, and on the right I see what amounts to some documentation on the
joystick. I wonder what is the relation between the numbers on the
right and the words on the left?

3. the command

hidview -a -d2

works like a charm. This is encouraging. Is the source for this utility
in the appropriate USB DDK?

Thanks for your help.

Regards...

Miguel.


Miguel Simon wrote:

Hi...

I am about to dwell on this issue once again, and I wonder if we have
a joystick driver available for every one's good use? I have some
basic code from which to start, but I wonder if there would be an open
source project related to joystick of which I should be aware? Target
OS is QNX 6.3.0 - SP1. Thanks.

Lacking the above, I wonder if we have a "how-to" or
"know-what-not-do" somewhere? Any useful pointers? Does QNX provide a
USB interface that may be joystick friendly? Thanks.

Regards...

Miguel.

John Nagle

Re: joystick driver... revisited...

Post by John Nagle » Tue Mar 22, 2005 5:56 am

Miguel Simon wrote:
Hi...

I am about to dwell on this issue once again, and I wonder if we have a
joystick driver available for every one's good use?
I've sent Simon our joystick C++ interface class, and
a sample program. This is what we drive the Overbot around
with, using a Logitech MOMO wheel and pedals.

The QNX interface is similar to the Microsoft HID interface,
with lots of callbacks. So you, in turn, have to provide a
fair amount of code to manage all the callbacks.

(Amusingly, it's a library that calls a resource manager.
It would probably be easier to deal with it at the resource manager
level, but the documented interface is the Microsoft-like one.)

John Nagle
Team Overbot

Miguel Simon

Re: joystick driver... revisited...

Post by Miguel Simon » Tue Mar 22, 2005 8:10 am

Hi John...

Thanks for the code. I appreciate your generous nature.

I have not yet taken a look at the code; I wanted to see if I could
understand the USB-HID interface first. Your suggestions and pointer to
MS-link have proven useful. I will do some research first, perhaps ask
some questions, and then if it is not obvious how to proceed, then I
will take a look at your code and use it.

Perhaps you and the Team Overbot would like to make a contribution to
openQNX and make this source code an open source effort? Perhaps there
are license issues... I am sure that very many would be very
appreciative of your contribution.

Thanks again, I appreciate your help very much.

Regards...

Miguel.


John Nagle wrote:
Miguel Simon wrote:

Hi...

I am about to dwell on this issue once again, and I wonder if we have
a joystick driver available for every one's good use?


I've sent Simon our joystick C++ interface class, and
a sample program. This is what we drive the Overbot around
with, using a Logitech MOMO wheel and pedals.

The QNX interface is similar to the Microsoft HID interface,
with lots of callbacks. So you, in turn, have to provide a
fair amount of code to manage all the callbacks.

(Amusingly, it's a library that calls a resource manager.
It would probably be easier to deal with it at the resource manager
level, but the documented interface is the Microsoft-like one.)

John Nagle
Team Overbot

Miguel Simon

questions to QSSL..., please educate me... Thx.

Post by Miguel Simon » Tue Mar 22, 2005 8:24 am

Hi...

I wonder the following:

1. is there any documentation to the HID* family of function calls? If
not, why not?

2. the utility 'hidview' works very well indeed. Would it be possible to
have snippets of code on how to search for USB devices, attach to them,
etc?

3. I have setup the USB hidd_connect_parm_t and the and hidd_funcs_t
structures via a call to 'hidd_connect()', but I do not receive any
insertion or removal events in the callback functions. How could I set
out to discover the USB equipment that is out there?

4. do I need to attach to the usb driver somehow? (in PCI development,
you have to attach and get a handle. Is there something similar to this
mechanism here?).

5. it is not clear to me how to discover a USB-HID device if I start the
HID application with the joystick connected. Since there is no
'insertion' event, I wonder how to go about doing this?


I am not too sure what questions to ask yet, but pointers are most
appreciated. Thanks so much.

Regards...

Miguel.




Miguel Simon wrote:
Hi...

[QNX 6.3.0 - SP1 - PE]

1. After starting the appropriate USB drivers, the system detects and
knows about the joystick. Very good, but the usb keyboard that was
running up to now stops working, and the Phindows windows exits when I
issue a 'sin' command. Any ideas?

2. When I run the following (joystick is device #2):

hidview -R -d2

I see columns of numbers (with 2 numbers or sometimes 3 num.) on the
left, and on the right I see what amounts to some documentation on the
joystick. I wonder what is the relation between the numbers on the
right and the words on the left?

3. the command

hidview -a -d2

works like a charm. This is encouraging. Is the source for this utility
in the appropriate USB DDK?

Thanks for your help.

Regards...

Miguel.


Miguel Simon wrote:

Hi...

I am about to dwell on this issue once again, and I wonder if we have
a joystick driver available for every one's good use? I have some
basic code from which to start, but I wonder if there would be an open
source project related to joystick of which I should be aware? Target
OS is QNX 6.3.0 - SP1. Thanks.

Lacking the above, I wonder if we have a "how-to" or
"know-what-not-do" somewhere? Any useful pointers? Does QNX provide a
USB interface that may be joystick friendly? Thanks.

Regards...

Miguel.

Henry VanDyke

Re: joystick driver... revisited...

Post by Henry VanDyke » Tue Mar 22, 2005 2:15 pm

Miguel Simon <simon@ou.edu> wrote in message
news:d1nljs$2ge$1@inn.qnx.com...
Hi...

[QNX 6.3.0 - SP1 - PE]

1. After starting the appropriate USB drivers, the system detects and
knows about the joystick. Very good, but the usb keyboard that was
running up to now stops working, and the Phindows windows exits when I
issue a 'sin' command. Any ideas?
Without the USB stack running your USB keyboard is working in Legacy
mode(PS2). When you start the USB stack it takes control of the USB chip
and the keyboard will stop working. You will need to start the USB driver
and input drivers to work with USB keyboard and Photon. ( setup an
inputtrap file) You should be able to find other postings on this.

Henry
2. When I run the following (joystick is device #2):

hidview -R -d2

I see columns of numbers (with 2 numbers or sometimes 3 num.) on the
left, and on the right I see what amounts to some documentation on the
joystick. I wonder what is the relation between the numbers on the
right and the words on the left?

3. the command

hidview -a -d2

works like a charm. This is encouraging. Is the source for this utility
in the appropriate USB DDK?

Thanks for your help.

Regards...

Miguel.


Miguel Simon wrote:
Hi...

I am about to dwell on this issue once again, and I wonder if we have a
joystick driver available for every one's good use? I have some basic
code from which to start, but I wonder if there would be an open source
project related to joystick of which I should be aware? Target OS is QNX
6.3.0 - SP1. Thanks.

Lacking the above, I wonder if we have a "how-to" or "know-what-not-do"
somewhere? Any useful pointers? Does QNX provide a USB interface that
may be joystick friendly? Thanks.

Regards...

Miguel.

John Nagle

Re: joystick driver... revisited...

Post by John Nagle » Tue Mar 22, 2005 4:36 pm

Miguel Simon wrote:
Hi John...

Thanks for the code. I appreciate your generous nature.

I have not yet taken a look at the code; I wanted to see if I could
understand the USB-HID interface first. Your suggestions and pointer to
MS-link have proven useful. I will do some research first, perhaps ask
some questions, and then if it is not obvious how to proceed, then I
will take a look at your code and use it.
The interface is reasonably complicated, because you have to
support hot-plugging of USB devices. Also, Microsoft's encapsulation
has some ill-chosen design issues, which were replicated in the
QNX version.

There are some things that don't work in the USB-HID system,
such as getting a device to send updates continuously. Also,
our experience with the QNX 6.21 version of the USB-HID system was
that, after hours of idle time, the device stops responding and
has to be unplugged and plugged in again.
Perhaps you and the Team Overbot would like to make a contribution to
openQNX and make this source code an open source effort? Perhaps there
are license issues... I am sure that very many would be very
appreciative of your contribution.
Is OpenQNX still alive? I thought that effort had been
killed off. Only one QNX project on SourceForge has been updated
in the last year. 2002 and 2003 were the good years of open source
for QNX. Once the NC version of QNX went away, so did open source
contributions.

John Nagle
Team Overbot

Miguel Simon

Re: joystick driver... revisited...

Post by Miguel Simon » Tue Mar 22, 2005 8:09 pm

Hi Henry...

Thanks for your suggestions. I think that I am ok on this regard.

I wonder if you have some words of wisdom regarding how to interface
with the HID driver? I suppose that my main point is that 'hidview'
utility works, which means that you obviously know how to make this
work. Also, any words on missing documentation? Thanks. I appreciate
your help.

Regards.

Miguel.



Henry VanDyke wrote:
Miguel Simon <simon@ou.edu> wrote in message
news:d1nljs$2ge$1@inn.qnx.com...

Hi...

[QNX 6.3.0 - SP1 - PE]

1. After starting the appropriate USB drivers, the system detects and
knows about the joystick. Very good, but the usb keyboard that was
running up to now stops working, and the Phindows windows exits when I
issue a 'sin' command. Any ideas?


Without the USB stack running your USB keyboard is working in Legacy
mode(PS2). When you start the USB stack it takes control of the USB chip
and the keyboard will stop working. You will need to start the USB driver
and input drivers to work with USB keyboard and Photon. ( setup an
inputtrap file) You should be able to find other postings on this.

Henry

Miguel Simon

Re: joystick driver... revisited...

Post by Miguel Simon » Tue Mar 22, 2005 8:19 pm

Hi John...

I hope that all is well. I am trying to educate myself on these matters.
Your experience has already helped me a lot, and I am pursuing your
links and pointers.

I am not sure if there is the utility 'hidview' in 6.2.1? When I run
this utility in 6.3.0, I can see that it sends information when there
are new events available from the stick (i.e. some movement and such).
I am actually considering opening a pipe to this utility
(programatically ofcourse), and just buffer and parse the output stream.
This is a brain dead way to go about it, but I cannot find
documentation on HID from QNX.

When I have wasted enough time, then I will give up I am sure, since I
do not have all the time to (reinvent the wheel) sink on this thing.

Thanks again. I appreciate your help.

Regards...

Miguel.


John Nagle wrote:
Miguel Simon wrote:

Hi John...

Thanks for the code. I appreciate your generous nature.

I have not yet taken a look at the code; I wanted to see if I could
understand the USB-HID interface first. Your suggestions and pointer
to MS-link have proven useful. I will do some research first, perhaps
ask some questions, and then if it is not obvious how to proceed, then
I will take a look at your code and use it.


The interface is reasonably complicated, because you have to
support hot-plugging of USB devices. Also, Microsoft's encapsulation
has some ill-chosen design issues, which were replicated in the
QNX version.

There are some things that don't work in the USB-HID system,
such as getting a device to send updates continuously. Also,
our experience with the QNX 6.21 version of the USB-HID system was
that, after hours of idle time, the device stops responding and
has to be unplugged and plugged in again.

Perhaps you and the Team Overbot would like to make a contribution to
openQNX and make this source code an open source effort? Perhaps
there are license issues... I am sure that very many would be very
appreciative of your contribution.


Is OpenQNX still alive? I thought that effort had been
killed off. Only one QNX project on SourceForge has been updated
in the last year. 2002 and 2003 were the good years of open source
for QNX. Once the NC version of QNX went away, so did open source
contributions.

John Nagle
Team Overbot

Post Reply

Return to “qnx.development_tools”