Merge inbound to m-c on a CLOSED TREE.
[gecko.git] / dom / bluetooth / BluetoothUuid.h
bloba2017e15f90d004dd8e448e5135ccd120d74cd5d
1 /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
2 /* vim: set ts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_bluetooth_bluetoothuuid_h__
8 #define mozilla_dom_bluetooth_bluetoothuuid_h__
10 #include "BluetoothCommon.h"
12 BEGIN_BLUETOOTH_NAMESPACE
14 class BluetoothProfileManagerBase;
17 * Service classes and Profile Identifiers
19 * Supported Bluetooth services for v1 are listed as below.
21 * The value of each service class is defined in "AssignedNumbers/Service
22 * Discovery Protocol (SDP)/Service classes and Profile Identifiers" in the
23 * Bluetooth Core Specification.
25 enum BluetoothServiceClass
27 A2DP = 0x110D,
28 HANDSFREE = 0x111E,
29 HANDSFREE_AG = 0x111F,
30 HEADSET = 0x1108,
31 HEADSET_AG = 0x1112,
32 HID = 0x1124,
33 OBJECT_PUSH = 0x1105,
34 UNKNOWN = 0x0000
37 class BluetoothUuidHelper
39 public:
40 /**
41 * Get a 128-bit uuid string calculated from a 16-bit service class UUID and
42 * BASE_UUID
44 * @param aServiceClassUuid 16-bit service class UUID
45 * @param aRetUuidStr out parameter, 128-bit uuid string
47 static void
48 GetString(BluetoothServiceClass aServiceClassUuid, nsAString& aRetUuidStr);
50 /**
51 * Convert a 128-bit uuid string to a value of BluetoothServiceClass
53 * @param aUuidStr 128-bit uuid string
54 * @return a value of BluetoothServiceClass
56 static BluetoothServiceClass
57 GetBluetoothServiceClass(const nsAString& aUuidStr);
59 static BluetoothServiceClass
60 GetBluetoothServiceClass(uint16_t aServiceUuid);
62 static BluetoothProfileManagerBase*
63 GetBluetoothProfileManager(uint16_t aServiceUuid);
66 // TODO/qdot: Move these back into gonk and make the service handler deal with
67 // it there.
69 // Gotten from reading the "u8" values in B2G/external/bluez/src/adapter.c
70 // These were hardcoded into android
71 enum BluetoothReservedChannels {
72 CHANNEL_DIALUP_NETWORK = 1,
73 CHANNEL_HANDSFREE_AG = 10,
74 CHANNEL_HEADSET_AG = 11,
75 CHANNEL_OPUSH = 12,
76 CHANNEL_SIM_ACCESS = 15,
77 CHANNEL_PBAP_PSE = 19,
78 CHANNEL_FTP = 20,
79 CHANNEL_OPUSH_L2CAP = 5255
82 END_BLUETOOTH_NAMESPACE
84 #endif