Re: return value of getDeviceClassMajor
Re: return value of getDeviceClassMajor
- Subject: Re: return value of getDeviceClassMajor
- From: Elliotte Rusty Harold <email@hidden>
- Date: Wed, 01 Feb 2006 12:26:37 -0500
Christian Klein wrote:
Am 31.01.2006 um 17:33 schrieb Elliotte Harold:
What is the legal range for values returned by getDeviceClassMajor in
IOBluetoothDevice? Is it 1-31 or 0 to 7968 or something else? In other
words, is it an unsigned 5-bit int or unsigned 13-bit int, or
something else? I've seen both used in practice in other APIs for
working with Bluetooth.
// +---------------+---------------+---------------+
// | octet 3 | octet 2 | octet 1 | <- Octet
Transmission Order
// +---------------+---------------+---------------+
// <------ 11 bits ----->< 5 bits ><- 6 bits ->
// +---------------------+---------+-----------+-+-+
// | Service Classes | Major | Minor | | |
// +-+-+-+-+-+-+-+-+-+-+-+ Device | Device |0|0|
// | | | | | | | |*|*|*| | Class | Class | | |
// +-+-+-+-+-+-+-+-+-+-+-+---------+-----------+-+-+
// | | | | | | | | |
Yes, but there's more than one way to interpret that layout. The 5 bits
of the major device class could be represented as a simple 5 bit number
or the whole class ID could be masked off and the entire thing treated
as a 32-bit number of which only the major class part can be non-zero.
I've seen both done elsewhere. Which does Apple's Bluetooth API do? (Or
does it do something completely different?)
--
Elliotte Rusty Harold email@hidden
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim
_______________________________________________
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