HCI over USB with D-Link adapter
HCI over USB with D-Link adapter
- Subject: HCI over USB with D-Link adapter
- From: Dmitri Moukhine <email@hidden>
- Date: Tue, 9 Jul 2002 18:17:40 -0700
Hi,
I was asking about how to send HCI commands over USB to the Bluetooth
adapter in yesterday post "D-Link bluetooth usb adapter".
It looks like I'm initializing IOUSBDevRequest wrong.
The best I can came up with is the code below. It still doesn't work.
After I issue HCI_Read_Buffer_Size command there is no any data on event
pipe.
I think my bRequestType or/and bRequest wrong and data is not get
interpreted as an HCI command.
HCI_Read_Buffer_Size is the first command I send to the adapter.
Could somebody give me a hand on that?
Thank you,
Dmitri.
bool write_command(void* data, int size)
{
bool ok = false;
IOUSBDevRequestTO req;
IOReturn err = 0;
memset(&req, 0, sizeof(req));
// initialize request structure
req.bmRequestType = USBmakebmRequestType(kUSBOut, kUSBClass,
kUSBEndpoint);
req.bRequest = BLUETOOTH_CONTROL_REQUEST_TYPE; //0x20
req.wValue = 0;
req.wIndex = 0;
req.wLength = size;
req.pData = data;
req.noDataTimeout = NO_DATA_TIMEOUT; // 5000
req.completionTimeout = NO_COMPLETION_TIMEOUT; // 5000
err = (*gIntf)->ControlRequestTO(gIntf, 0, &req);
if (kIOReturnSuccess == err)
{
ok = true;
printf("write_command: %d bytes written.\n", req.wLenDone);
dump(req.pData, req.wLenDone); // for HCI_Read_Buffer_Size it is
05 04 00 - bin : 01010000. 00 (ocf 0x05) 000100 (ogf 0x04) 00000000
(param size 0)
}
else
printf("write_command: failed with System: x, subSystem x,
code: x.\n", err_get_system(err), err_get_sub(err),
err_get_code(err));
return ok;
}
_______________________________________________
bluetooth-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/bluetooth-dev
Do not post admin requests to the list. They will be ignored.