B2G/Bluetooth/WebBluetooth-v2/BluetoothClassOfDevice: Difference between revisions
< B2G | Bluetooth | WebBluetooth-v2
Jump to navigation
Jump to search
(Init the page) |
|||
| (32 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
== Overview == | == Overview == | ||
BluetoothClassOfDevice | '''BluetoothClassOfDevice''' is named after the Class of Device(CoD) field which is defined in [https://www.bluetooth.org/en-us/specification/assigned-numbers/baseband Assign Numbers] of Bluetooth Spec. Every single Bluetooth device should have its CoD and is able to be retrieved at discovering stage. | ||
== Interface == | == Interface == | ||
[CheckPermissions="bluetooth"] | |||
interface BluetoothClassOfDevice | interface BluetoothClassOfDevice | ||
{ | { | ||
/** | |||
* The following constants are defined in Assigned Numbers of bluetooth General Access Profile (GAP) spec. | |||
* See https://www.bluetooth.org/en-us/specification/assigned-numbers/baseband for more information. | |||
*/ | |||
// Major service class | |||
const unsigned short LIMITED_DISCOVERABILITY = 0x0001; | const unsigned short LIMITED_DISCOVERABILITY = 0x0001; | ||
const unsigned short POSITIONING = 0x0008; | const unsigned short POSITIONING = 0x0008; | ||
const unsigned short NETWORKING = 0x0010; | const unsigned short NETWORKING = 0x0010; | ||
const unsigned short RENDERING = 0x0020; | const unsigned short RENDERING = 0x0020; | ||
const unsigned short CAPTURING = 0x0040; | const unsigned short CAPTURING = 0x0040; | ||
const unsigned short OBJECT_TRANSFER = 0x0080; | const unsigned short OBJECT_TRANSFER = 0x0080; | ||
const unsigned short AUDIO = 0x0100; | const unsigned short AUDIO = 0x0100; | ||
const unsigned short TELEPHONY = 0x0200; | const unsigned short TELEPHONY = 0x0200; | ||
const unsigned short INFORMATION = 0x0400; | const unsigned short INFORMATION = 0x0400; | ||
// Major device class | |||
const octet MISC = 0x00; | |||
const octet COMPUTER = 0x01; | |||
const octet MISC = 0x00; | const octet PHONE = 0x02; | ||
const octet COMPUTER = 0x01; | const octet NETWORK = 0x03; | ||
const octet PHONE = 0x02; | const octet AUDIO_VIDEO = 0x04; | ||
const octet NETWORK = 0x03; | const octet PERIPHERAL = 0x05; | ||
const octet AUDIO_VIDEO = 0x04; | const octet IMAGING = 0x06; | ||
const octet PERIPHERAL = 0x05; | const octet WEARABLE = 0x07; | ||
const octet IMAGING = 0x06; | const octet TOY = 0x08; | ||
const octet WEARABLE = 0x07; | const octet HEALTH = 0x09; | ||
const octet TOY = 0x08; | |||
const octet HEALTH = 0x09; | |||
const octet UNCATEGORIZED = 0x1F; | const octet UNCATEGORIZED = 0x1F; | ||
readonly attribute unsigned short [[B2G/Bluetooth/WebBluetooth-v2/BluetoothClassOfDevice#majorServiceClass|majorServiceClass]]; | |||
readonly attribute octet [[B2G/Bluetooth/WebBluetooth-v2/BluetoothClassOfDevice#majorDeviceClass|majorDeviceClass]]; | |||
readonly attribute octet [[B2G/Bluetooth/WebBluetooth-v2/BluetoothClassOfDevice#minorDeviceClass|minorDeviceClass]]; | |||
}; | }; | ||
== | == Properties == | ||
* [ | * [[B2G/Bluetooth/WebBluetooth-v2/BluetoothClassOfDevice#majorServiceClass|BluetoothClassOfDevice.majorServiceClass]] | ||
* [ | * [[B2G/Bluetooth/WebBluetooth-v2/BluetoothClassOfDevice#majorDeviceClass|BluetoothClassOfDevice.majorDeviceClass]] | ||
* [ | * [[B2G/Bluetooth/WebBluetooth-v2/BluetoothClassOfDevice#minorDeviceClass|BluetoothClassOfDevice.minorDeviceClass]] | ||
=== majorServiceClass === | === majorServiceClass === | ||
; Description | ; Description | ||
: majorServiceClass represents the Major Service Class of the CoD field of a Bluetooth Device. majorServiceClass "defines the general families of devices with which Bluetooth SIG members want their applications to be associated"[1]. | : majorServiceClass represents the Major Service Class of the CoD field of a Bluetooth Device. majorServiceClass "defines the general families of devices with which Bluetooth SIG members want their applications to be associated" [[B2G/Bluetooth/WebBluetooth-v2/BluetoothClassOfDevice#Reference|[1]]]. | ||
; Value type | |||
: unsigned short | |||
; Default value | ; Default value | ||
: | : 0x0 | ||
=== majorDeviceClass === | === majorDeviceClass === | ||
; Description | ; Description | ||
: majorDeviceClass represents the Major Device Class of the CoD field of a Bluetooth Device. majorDeviceClass "is the highest level of granularity for defining a Bluetooth device"[1]. | : majorDeviceClass represents the Major Device Class of the CoD field of a Bluetooth Device. majorDeviceClass "is the highest level of granularity for defining a Bluetooth device" [[B2G/Bluetooth/WebBluetooth-v2/BluetoothClassOfDevice#Reference|[1]]]. | ||
; Value type | |||
: octet | |||
; Default value | ; Default value | ||
| Line 59: | Line 67: | ||
=== minorDeviceClass === | === minorDeviceClass === | ||
; Description | ; Description | ||
: minorDeviceClass represents the Minor Device Class of the CoD field of a Bluetooth Device. minorDeviceClass "is interpreted only in the context of the Major Device Class (but independently of the Service Class field)"[1]. | : minorDeviceClass represents the Minor Device Class of the CoD field of a Bluetooth Device. minorDeviceClass "is interpreted only in the context of the Major Device Class (but independently of the Service Class field)" [[B2G/Bluetooth/WebBluetooth-v2/BluetoothClassOfDevice#Reference|[1]]]. | ||
; Value type | |||
: octet | |||
; Default value | ; Default value | ||
: | : 0x0 | ||
== Reference == | == Reference == | ||
[1] https://www.bluetooth.org/en-us/specification/assigned-numbers/baseband | [1] https://www.bluetooth.org/en-us/specification/assigned-numbers/baseband | ||
Latest revision as of 12:57, 22 October 2015
Overview
BluetoothClassOfDevice is named after the Class of Device(CoD) field which is defined in Assign Numbers of Bluetooth Spec. Every single Bluetooth device should have its CoD and is able to be retrieved at discovering stage.
Interface
[CheckPermissions="bluetooth"]
interface BluetoothClassOfDevice
{
/**
* The following constants are defined in Assigned Numbers of bluetooth General Access Profile (GAP) spec.
* See https://www.bluetooth.org/en-us/specification/assigned-numbers/baseband for more information.
*/
// Major service class
const unsigned short LIMITED_DISCOVERABILITY = 0x0001;
const unsigned short POSITIONING = 0x0008;
const unsigned short NETWORKING = 0x0010;
const unsigned short RENDERING = 0x0020;
const unsigned short CAPTURING = 0x0040;
const unsigned short OBJECT_TRANSFER = 0x0080;
const unsigned short AUDIO = 0x0100;
const unsigned short TELEPHONY = 0x0200;
const unsigned short INFORMATION = 0x0400;
// Major device class
const octet MISC = 0x00;
const octet COMPUTER = 0x01;
const octet PHONE = 0x02;
const octet NETWORK = 0x03;
const octet AUDIO_VIDEO = 0x04;
const octet PERIPHERAL = 0x05;
const octet IMAGING = 0x06;
const octet WEARABLE = 0x07;
const octet TOY = 0x08;
const octet HEALTH = 0x09;
const octet UNCATEGORIZED = 0x1F;
readonly attribute unsigned short majorServiceClass;
readonly attribute octet majorDeviceClass;
readonly attribute octet minorDeviceClass;
};
Properties
- BluetoothClassOfDevice.majorServiceClass
- BluetoothClassOfDevice.majorDeviceClass
- BluetoothClassOfDevice.minorDeviceClass
majorServiceClass
- Description
- majorServiceClass represents the Major Service Class of the CoD field of a Bluetooth Device. majorServiceClass "defines the general families of devices with which Bluetooth SIG members want their applications to be associated" [1].
- Value type
- unsigned short
- Default value
- 0x0
majorDeviceClass
- Description
- majorDeviceClass represents the Major Device Class of the CoD field of a Bluetooth Device. majorDeviceClass "is the highest level of granularity for defining a Bluetooth device" [1].
- Value type
- octet
- Default value
- UNCATEGORIZED(0x1F)
minorDeviceClass
- Description
- minorDeviceClass represents the Minor Device Class of the CoD field of a Bluetooth Device. minorDeviceClass "is interpreted only in the context of the Major Device Class (but independently of the Service Class field)" [1].
- Value type
- octet
- Default value
- 0x0
Reference
[1] https://www.bluetooth.org/en-us/specification/assigned-numbers/baseband