LED control via HID
Moderator: Moderators
LED control via HID
Hi,
I am able to get the rotation and translation values from the SpaceNavigator via HID and to rezero it with the 7-0 packet, but i am wondering which HID-packet is turning on the LED?
Thanks in advance !!
I am able to get the rotation and translation values from the SpaceNavigator via HID and to rezero it with the 7-0 packet, but i am wondering which HID-packet is turning on the LED?
Thanks in advance !!
Hi,
i changed in the HIDRezero example
to
to switch of the LED, but i get the error
SendRezeroCommand: error from HidD_SetFeature (0x17)
(wrong CRC)
and i am wondering what i have done wrong. Any suggestions?
i changed in the HIDRezero example
Code: Select all
pFeatureBuf[0] = RPTID_FEAT_REZERO_DEVICE,
pFeatureBuf[1] = 0x00;
Code: Select all
pFeatureBuf[0] = 0x04,
pFeatureBuf[1] = 0x00;
SendRezeroCommand: error from HidD_SetFeature (0x17)
(wrong CRC)
and i am wondering what i have done wrong. Any suggestions?
Yes, i have a SpaceNavigator, and i successfully created a library to query the hid device.
I can rezero the device with this source without problem an i have only changed this singe byte in the code.
I also tried to send 4,0 and 4,1 with DeviceIoControl (IOCTL_HID_SET_FEATURE), same error ...
and same error on other computers (Windows XP and Windows 7 64Bit).
The Spacenavigator has no problems with other Software/Drivers.
For example the driver from RBC9 is able to control the LED.
Any idea?
I can rezero the device with this source without problem an i have only changed this singe byte in the code.
I also tried to send 4,0 and 4,1 with DeviceIoControl (IOCTL_HID_SET_FEATURE), same error ...
and same error on other computers (Windows XP and Windows 7 64Bit).
The Spacenavigator has no problems with other Software/Drivers.
For example the driver from RBC9 is able to control the LED.
Any idea?
Hi Tiwen, I had the same problem. HidD_SetFeature didn't work for me either (except for the callibration). I used WriteFile instead:
Code: Select all
HidDevice *pDev = waitListItems[index];
//turn LED on
pDev->buf[0] = 0x04;
pDev->buf[1] = 0x01;
WriteFile(pDev->handle, pDev->buf, pDev->capabilities.OutputReportByteLength, &nwrite, FALSE);
//turn LED off
pDev->buf[0] = 0x04;
pDev->buf[1] = 0x00;
WriteFile(pDev->handle, pDev->buf, pDev->capabilities.OutputReportByteLength, &nwrite, FALSE);
Re: LED control via HID
I have a SpaceNavigator, and i successfully created a library to query the hid device.
I can re zero the device with this source without problem an i have only changed this singe byte in the code.
I also tried to send 4,0 and 4,1 with DeviceIoControl (IOCTL_HID_SET_FEATURE), same error ..
and same error on other computers (Windows XP and Windows 7 64Bit).
I can re zero the device with this source without problem an i have only changed this singe byte in the code.
I also tried to send 4,0 and 4,1 with DeviceIoControl (IOCTL_HID_SET_FEATURE), same error ..
and same error on other computers (Windows XP and Windows 7 64Bit).
Re: LED control via HID
It's not a feature report. Just write it to the device.romani wrote:I have a SpaceNavigator, and i successfully created a library to query the hid device.
I can re zero the device with this source without problem an i have only changed this singe byte in the code.
I also tried to send 4,0 and 4,1 with DeviceIoControl (IOCTL_HID_SET_FEATURE), same error ..
and same error on other computers (Windows XP and Windows 7 64Bit).
Re: LED control via HID
I am planning to use SiSetLED function to turn off/on LED on space navigator. with the following defines
#define LED_ON 0x00010001
#define LED_OFF 0x00010000
How do i find out the current LED state on space navigator? Is it the return value of SiSetLED function?
#define LED_ON 0x00010001
#define LED_OFF 0x00010000
How do i find out the current LED state on space navigator? Is it the return value of SiSetLED function?
Re: LED control via HID
The return value of SiSetLEDs is just success or failure. We don't provide a way to get the state of the device LEDs. You can look into the user's configuration to see if they have turned them on/off. It's best not to mess with their preferences though.sayala wrote:I am planning to use SiSetLED function to turn off/on LED on space navigator. with the following defines
#define LED_ON 0x00010001
#define LED_OFF 0x00010000
How do i find out the current LED state on space navigator? Is it the return value of SiSetLED function?
Re: LED control via HID
what should be the input values for SiSetLED function? The following values not working
#define LED_ON 0x00010001
#define LED_OFF 0x00010000
SiSetLEDs(m_pscs->devHdl, LED_ON);
#define LED_ON 0x00010001
#define LED_OFF 0x00010000
SiSetLEDs(m_pscs->devHdl, LED_ON);