Skip to content

Commit

Permalink
Bug 1152821: Share BluetoothCommon.h between Bluetooth v1 and v2, r=j…
Browse files Browse the repository at this point in the history
…oliu

This patch integrates changes from Bluetooth v1 into the shared file
BluetoothCommon.h, and makes it available to both versions.
  • Loading branch information
tdz committed Apr 10, 2015
1 parent 8aa8ba0 commit c4bc486
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 512 deletions.
2 changes: 1 addition & 1 deletion CLOBBER
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.

Bug 1146355: Run Bluetooth APIs v1 and v2 with same backend code
Bug 1152821: Merge BluetoothCommon.h variants into single file
47 changes: 38 additions & 9 deletions dom/bluetooth/BluetoothCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_bluetooth_bluetoothcommon_h__
#define mozilla_dom_bluetooth_bluetoothcommon_h__
#ifndef mozilla_dom_bluetooth_bluetoothcommon_h
#define mozilla_dom_bluetooth_bluetoothcommon_h

#include "mozilla/Compiler.h"
#include "mozilla/Observer.h"
#include "nsPrintfCString.h"
#include "nsString.h"
Expand Down Expand Up @@ -179,6 +180,21 @@ extern bool gBluetoothDebugFlag;
#define PAIRING_REQ_TYPE_CONFIRMATION "pairingconfirmationreq"
#define PAIRING_REQ_TYPE_CONSENT "pairingconsentreq"

/**
* When the pair status of a Bluetooth device is changed, we'll dispatch an
* event.
*
* TODO: remove with bluetooth1
*/
#define PAIRED_STATUS_CHANGED_ID "pairedstatuschanged"

/**
* This event would be fired when discovery procedure starts or stops.
*
* TODO: remove with bluetooth1
*/
#define DISCOVERY_STATE_CHANGED_ID "discoverystatechanged"

/**
* System message to launch bluetooth app if no pairing listener is ready to
* receive pairing requests.
Expand Down Expand Up @@ -503,13 +519,13 @@ enum {
};

enum BluetoothAvrcpMediaAttribute {
AVRCP_MEDIA_ATTRIBUTE_TITLE,
AVRCP_MEDIA_ATTRIBUTE_ARTIST,
AVRCP_MEDIA_ATTRIBUTE_ALBUM,
AVRCP_MEDIA_ATTRIBUTE_TRACK_NUM,
AVRCP_MEDIA_ATTRIBUTE_NUM_TRACKS,
AVRCP_MEDIA_ATTRIBUTE_GENRE,
AVRCP_MEDIA_ATTRIBUTE_PLAYING_TIME
AVRCP_MEDIA_ATTRIBUTE_TITLE = 0x01,
AVRCP_MEDIA_ATTRIBUTE_ARTIST = 0x02,
AVRCP_MEDIA_ATTRIBUTE_ALBUM = 0x03,
AVRCP_MEDIA_ATTRIBUTE_TRACK_NUM = 0x04,
AVRCP_MEDIA_ATTRIBUTE_NUM_TRACKS = 0x05,
AVRCP_MEDIA_ATTRIBUTE_GENRE = 0x06,
AVRCP_MEDIA_ATTRIBUTE_PLAYING_TIME = 0x07
};

enum BluetoothAvrcpPlayerAttribute {
Expand All @@ -519,6 +535,19 @@ enum BluetoothAvrcpPlayerAttribute {
AVRCP_PLAYER_ATTRIBUTE_SCAN
};

enum BluetoothAvrcpPlayerRepeatValue {
AVRCP_PLAYER_VAL_OFF_REPEAT = 0x01,
AVRCP_PLAYER_VAL_SINGLE_REPEAT = 0x02,
AVRCP_PLAYER_VAL_ALL_REPEAT = 0x03,
AVRCP_PLAYER_VAL_GROUP_REPEAT = 0x04
};

enum BluetoothAvrcpPlayerShuffleValue {
AVRCP_PLAYER_VAL_OFF_SHUFFLE = 0x01,
AVRCP_PLAYER_VAL_ALL_SHUFFLE = 0x02,
AVRCP_PLAYER_VAL_GROUP_SHUFFLE = 0x03
};

enum BluetoothAvrcpStatus {
AVRCP_STATUS_BAD_COMMAND,
AVRCP_STATUS_BAD_PARAMETER,
Expand Down
Loading

0 comments on commit c4bc486

Please sign in to comment.