Re: IOBluetoothGetVersion: Bug?
site_archiver@lists.apple.com Delivered-To: bluetooth-dev@lists.apple.com First: why don't you just do it this way: BluetoothHCIVersionInfo hciVersionStructure; ... Marco On Oct 11, 2005, at 4:13 AM, Alexander Traud wrote: 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 Can anyone confirm this please? _______________________________________________ Do not post admin requests to the list. They will be ignored. Bluetooth-dev mailing list (Bluetooth-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/bluetooth-dev/site_archiver%40lists.a... 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). 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. 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. 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 (Bluetooth-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/bluetooth-dev/mpontil% 40apple.com This email sent to mpontil@apple.com This email sent to site_archiver@lists.apple.com
participants (1)
-
Marco Pontil