Re: IOBluetoothLocalDeviceReadName
Re: IOBluetoothLocalDeviceReadName
- Subject: Re: IOBluetoothLocalDeviceReadName
- From: Paul Davis <email@hidden>
- Date: Tue, 14 Jan 2003 19:08:36 -0500
Garth,
I had to dive into IOKit already in order to detect the USB device
attach/detach. I will look into IOServiceWaitQuiet() and see if this
provides a means to solve the problem.
Thanks,
Paul Davis
On 1/14/03 6:50 PM, "Garth Cummings" <email@hidden> wrote:
>
Hi Paul,
>
>
As a speculation, would IOServiceWaitQuiet() in IOKit/IOKitLib.h work?
>
This would required diving down into the I/O Kit layer briefly, though.
>
>
--gc
>
>
On Tuesday, January 14, 2003, at 11:22 AM, Eric Brown wrote:
>
>
> On Tuesday, January 14, 2003, at 06:36 AM, Paul Davis wrote:
>
>
>
>> I have a question about the IOBluetoothLocalDeviceReadName function.
>
>> When
>
>> the Bluetooth USB dongle is plugged in and I start my application this
>
>> function returns the machine name. However, if I unplug/plug the USB
>
>> when my
>
>> application is active, the IOBluetoothLocalDeviceReadName callback
>
>> always
>
>> returns what appears to be the USB device default name (i.e. Broadcom
>
>> BCM2033) instead of the machine name. Is their any notification that
>
>> can
>
>> tell me when the firmware download to the USB dongle is complete so
>
>> that I
>
>> don't request the local device name prematurely? Or, can the callback
>
>> from
>
>> IOBluetoothLocalDeviceReadName be changed to only return when the
>
>> firmware
>
>> download to the Bluetooth USB dongle is complete?
>
>>
>
>
>
> As you've found, there is a race between the device appearing to an
>
> application and begin fully initialized by the system. In this case,
>
> I don't think the problem is the firmware download so much as the
>
> difference in time between the device first appearing in the
>
> IORegistry (which is what our API uses to find the device), and the
>
> daemon getting the same notification and configuring the device with
>
> the proper name, scan modes etc...
>
>
>
>> I also tried using while(!(IOBluetoothLocalDeviceAvailable()) as the
>
>> delay
>
>> before requesting the local name and this was unsuccessful as well.
>
>>
>
>> I ended up using a time delay as a workaround. I was hoping to get
>
>> around
>
>> this since the time delay required may be different depending on
>
>> machine
>
>> speed.
>
>>
>
>>
>
>
>
> For now, the delay is probably your best bet. We are working on
>
> fixing the problem so that applications won't know about a device
>
> until the daemon has fully configured it.
>
>
>
> - Eric
_______________________________________________
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.