Re: IOBluetoothGetVersion: Bug?
Re: IOBluetoothGetVersion: Bug?
- Subject: Re: IOBluetoothGetVersion: Bug?
- From: Marco Pontil <email@hidden>
- Date: Tue, 11 Oct 2005 10:21:05 -0700
First: why don't you just do it this way:
BluetoothHCIVersionInfo hciVersionStructure;
if ( IOBluetoothGetVersion( &numVersion, &hciVersionStructure )
== kIOReturnSuccess )
{
// do something
}
about the extra bytes, they are probably padding put by the compiler
(the size of hciVersionStructure is indeed 10 bytes).
... Marco
On Oct 11, 2005, at 4:13 AM, Alexander Traud wrote:
I am using the C API of IOBluetooth in Mac OS X v10.3.9 (Apple
Bluetooth
1.5.4) and Mac OS X v10.4.2 (Apple Bluetooth 1.6.0). If I pass a
pointer for
10 byte long memory to IOBluetoothGetVersion's hardware attribute,
all 10
bytes are used. According to the struct BluetoothHCIVersionInfo in
Bluetooth.h only 8 byte should be used.
UInt16 BluetoothManufacturerName
UInt8 BluetoothLMPVersion
UInt8 wired byte; with each call increases by one
UInt16 BluetoothLMPSubversion
UInt8 hciVersion
UInt8 wired byte; 0x00 all time
UInt16 hciRevision
The data fields return correct values for all of my Bluetooth
modules but in
between there are two wired bytes which are not listed in the struct.
Can anyone confirm this please?
I know I should rather report a bug but because I am in a quite
esoteric IDE
and I do not write C but use a bridge at the moment (long story), I
would
rather check this first here on the list.
Workaround:
If you do not need the hardware information, pass NULL to this
optional
parameter and it works. In this case you get the software version,
double
check if you rather need weak linking. If you need hardware
information,
first check if IOBluetoothLocalDeviceAvailable is not enough. If
you really,
really need the hardware information, use 10 byte memory (patch the
struct
in Bluetooth.h or better overwrite in code).
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden