LED Problem

Post questions, comments and feedback to our 3Dconnexion UNIX/Linux Development Team.

Moderator: Moderators

LED Problem

Postby joggl » Fri Jun 13, 2008 6:03 am

I try to switch on the LED from the SpaceNavigator with sending following hex-string:
Code: Select all
0000 0000 0000 0000 1100 0800 0100 0000

switching off nearly the same:
Code: Select all
0000 0000 0000 0000 1100 0800 0000 0000

My problem is, that this string just puts on/off the LED "sometimes"
Could someone help or explain me how to switch on/off the LED by sending strings to the HID-Device (for example /dev/input/event3)
joggl
 
Posts: 3
Joined: Fri Jun 13, 2008 5:56 am

Postby crobl » Fri Jun 13, 2008 6:16 am

Hi joggl,

sorry I don't know how and what you're sending off to our device. Which ioctl() are you using?

From the device node you posted I think you want to use the event interface. A good starting point will be this website.
Example 4 shows you what event types are supported by the SpaceNavigator. The other examples will help you setting those events and dealing with the event interface.
Note: The LEDs may not show explicitly up in the list as LEDs but maybe as misc, unknown, etc. event types.

Regards,

Christian
3Dconnexion
crobl
Moderator
Moderator
 
Posts: 119
Joined: Mon Feb 26, 2007 8:34 am
Location: Freiham, Germany

Postby Absum » Tue Jun 17, 2008 5:01 am

You aren't making it easy for yourself :P
Absum
 
Posts: 53
Joined: Tue Apr 24, 2007 4:00 am
Location: Sweden

Postby crobl » Wed Jun 18, 2008 3:06 am

Who do you mean? Me, him or us? :shock: :?: :D
crobl
Moderator
Moderator
 
Posts: 119
Joined: Mon Feb 26, 2007 8:34 am
Location: Freiham, Germany

Postby joggl » Thu Jun 19, 2008 8:26 am

[SOLVED]

Ok, i hope i solved the problem with crobels help.

It seems to be a kernel-driver-problem from linux. I tried to switch the LED on kernel 2.6.20 (ok i know, kinda old) with following code:

Code: Select all
struct input_event ev;

fd = open ("/dev/input/event3", O_WRONLY);

ev.code = EV_LED; // = 0x11
ev.code = LED_MISC; // = 0x08
ev.value = 1;// 1=an, 0=aus
write(fd, &ev, sizeof(struct input_event));

close(fd);


and it did NOT (or sometimes, depends on weather, time, position of mars, ...) work.

after updating the kernel to 2.6.25 the same code works fine without the "random-effect"

therefore it seems to be something in the HID-drivers from older kernels.

greez
/joggl
joggl
 
Posts: 3
Joined: Fri Jun 13, 2008 5:56 am


Return to Developer's Forum for UNIX/Linux

Who is online

Users browsing this forum: No registered users and 1 guest