Added connect message to wireless driver

This commit is contained in:
Ingo Ruhnke 2008-05-01 12:46:46 +02:00
parent 2e05c11edc
commit f53acbef13
3 changed files with 13 additions and 6 deletions

View file

@ -302,5 +302,11 @@ len: 28 data: 0x00 0x01 0xff 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0
# Request power-off?
len: 29 data: 0x00 0xf8 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
len: 29 data: 0x00 0xf8 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
29 data: 0x00 0x0f 0x00 0xf0 0xf0 0xcc 0xfd 0x55 0x40 0xf0 0x48 0xe4 0x5d 0x10 0x00 0x05 0x13 0xa7 0x20 0x1d 0x30 0x03 0x40 0x01 0x50 0x01 0xff 0xff 0xff
29 data: 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
29 data: 0x00 0x00 0x00 0x40 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
29 data: 0x00 0x00 0x00 0xf0 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
# EOF #

View file

@ -74,10 +74,11 @@ cat_usb_device(struct usb_device* dev, int ep)
}
else
{
// FIXME: ep-1 is hack for Xbox360 wireless
if (usb_claim_interface(handle, ep-1) != 0) // FIXME: bInterfaceNumber shouldn't be hardcoded
{
std::cout << "Error claiming the interface: " << usb_strerror() << std::endl;
if (usb_detach_kernel_driver_np(handle, 0) < 0)
if (usb_detach_kernel_driver_np(handle, ep-1) < 0)
{
std::cout << "Failure to kick kernel driver: " << usb_strerror() << std::endl;
exit(EXIT_FAILURE);

View file

@ -91,23 +91,23 @@ Xbox360WirelessController::read(XboxGenericMsg& msg)
{ // Connection Status Message
if (data[1] == 0x00)
{
// nothing connected
std::cout << "Connection status: nothing" << std::endl;
}
else if (data[1] == 0x80)
{
// controller connected
std::cout << "Connection status: controller connected" << std::endl;
}
else if (data[1] == 0x40)
{
// headset connected
std::cout << "Connection status: headset connected" << std::endl;
}
else if (data[1] == 0xc0)
{
// headset and controller connected
std::cout << "Connection status: controller and headset connected" << std::endl;
}
else
{
// unknown
std::cout << "Connection status: unknown" << std::endl;
}
}
else if (ret == 29) // Event Message