2012-02-20 19:15:19 +04:00
|
|
|
/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
|
2012-08-21 07:21:24 +04:00
|
|
|
/* vim: set ts=2 et sw=2 tw=80: */
|
2012-02-20 19:15:19 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* 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__
|
|
|
|
|
2012-06-02 22:23:16 +04:00
|
|
|
#include "mozilla/Observer.h"
|
2013-09-14 02:51:00 +04:00
|
|
|
#include "nsPrintfCString.h"
|
2013-09-23 21:25:00 +04:00
|
|
|
#include "nsString.h"
|
2012-09-13 20:37:14 +04:00
|
|
|
#include "nsTArray.h"
|
2012-06-02 22:23:16 +04:00
|
|
|
|
2013-01-29 14:37:51 +04:00
|
|
|
extern bool gBluetoothDebugFlag;
|
|
|
|
|
|
|
|
#define SWITCH_BT_DEBUG(V) (gBluetoothDebugFlag = V)
|
|
|
|
|
|
|
|
#undef BT_LOG
|
|
|
|
#if defined(MOZ_WIDGET_GONK)
|
|
|
|
#include <android/log.h>
|
2013-12-02 14:50:23 +04:00
|
|
|
|
2013-09-14 02:51:00 +04:00
|
|
|
/**
|
|
|
|
* Prints 'D'EBUG build logs, which show in DEBUG build only when
|
|
|
|
* developer setting 'Bluetooth output in adb' is enabled.
|
|
|
|
*/
|
2013-12-02 14:50:23 +04:00
|
|
|
#define BT_LOGD(msg, ...) \
|
2013-01-29 14:37:51 +04:00
|
|
|
do { \
|
|
|
|
if (gBluetoothDebugFlag) { \
|
2013-12-02 14:50:23 +04:00
|
|
|
__android_log_print(ANDROID_LOG_INFO, "GeckoBluetooth", \
|
|
|
|
"%s: " msg, __FUNCTION__, ##__VA_ARGS__); \
|
2013-01-29 14:37:51 +04:00
|
|
|
} \
|
|
|
|
} while(0)
|
2013-01-29 14:37:51 +04:00
|
|
|
|
2013-09-14 02:51:00 +04:00
|
|
|
/**
|
|
|
|
* Prints 'R'ELEASE build logs, which show in both RELEASE and DEBUG builds.
|
|
|
|
*/
|
2013-12-02 14:50:23 +04:00
|
|
|
#define BT_LOGR(msg, ...) \
|
|
|
|
__android_log_print(ANDROID_LOG_INFO, "GeckoBluetooth", \
|
|
|
|
"%s: " msg, __FUNCTION__, ##__VA_ARGS__) \
|
2013-09-14 02:51:00 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Prints DEBUG build warnings, which show in DEBUG build only.
|
|
|
|
*/
|
2013-01-29 14:37:51 +04:00
|
|
|
#define BT_WARNING(args...) \
|
2013-09-14 02:51:00 +04:00
|
|
|
NS_WARNING(nsPrintfCString(args).get()) \
|
2013-01-29 14:37:51 +04:00
|
|
|
|
2013-01-29 14:37:51 +04:00
|
|
|
#else
|
2013-12-02 14:50:23 +04:00
|
|
|
#define BT_LOGD(msg, ...) \
|
2013-01-29 14:37:51 +04:00
|
|
|
do { \
|
|
|
|
if (gBluetoothDebugFlag) { \
|
2013-12-02 14:50:23 +04:00
|
|
|
printf("%s: " msg, __FUNCTION__, ##__VA_ARGS__); \
|
2013-01-29 14:37:51 +04:00
|
|
|
} \
|
|
|
|
} while(0)
|
2013-01-29 14:37:51 +04:00
|
|
|
|
2015-01-20 06:12:43 +03:00
|
|
|
#define BT_LOGR(msg, ...) printf("%s: " msg, __FUNCTION__, ##__VA_ARGS__)
|
|
|
|
#define BT_WARNING(msg, ...) printf("%s: " msg, __FUNCTION__, ##__VA_ARGS__)
|
2013-01-29 14:37:51 +04:00
|
|
|
#endif
|
|
|
|
|
2014-04-11 07:52:44 +04:00
|
|
|
/**
|
|
|
|
* Wrap literal name and value into a BluetoothNamedValue
|
|
|
|
* and append it to the array.
|
|
|
|
*/
|
|
|
|
#define BT_APPEND_NAMED_VALUE(array, name, value) \
|
|
|
|
array.AppendElement(BluetoothNamedValue(NS_LITERAL_STRING(name), value))
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Ensure success of system message broadcast with void return.
|
|
|
|
*/
|
|
|
|
#define BT_ENSURE_TRUE_VOID_BROADCAST_SYSMSG(type, parameters) \
|
|
|
|
do { \
|
|
|
|
if (!BroadcastSystemMessage(type, parameters)) { \
|
|
|
|
BT_WARNING("Failed to broadcast [%s]", \
|
|
|
|
NS_ConvertUTF16toUTF8(type).get()); \
|
|
|
|
return; \
|
|
|
|
} \
|
|
|
|
} while(0)
|
|
|
|
|
2012-02-20 19:15:19 +04:00
|
|
|
#define BEGIN_BLUETOOTH_NAMESPACE \
|
|
|
|
namespace mozilla { namespace dom { namespace bluetooth {
|
|
|
|
#define END_BLUETOOTH_NAMESPACE \
|
|
|
|
} /* namespace bluetooth */ } /* namespace dom */ } /* namespace mozilla */
|
|
|
|
#define USING_BLUETOOTH_NAMESPACE \
|
|
|
|
using namespace mozilla::dom::bluetooth;
|
|
|
|
|
2013-03-15 11:15:47 +04:00
|
|
|
#define KEY_LOCAL_AGENT "/B2G/bluetooth/agent"
|
|
|
|
#define KEY_REMOTE_AGENT "/B2G/bluetooth/remote_device_agent"
|
|
|
|
#define KEY_MANAGER "/B2G/bluetooth/manager"
|
|
|
|
#define KEY_ADAPTER "/B2G/bluetooth/adapter"
|
2012-08-17 14:35:59 +04:00
|
|
|
|
2013-06-08 19:26:28 +04:00
|
|
|
/**
|
2013-08-02 14:32:57 +04:00
|
|
|
* When the connection status of a Bluetooth profile is changed, we'll notify
|
|
|
|
* observers which register the following topics.
|
2013-06-08 19:26:28 +04:00
|
|
|
*/
|
2013-08-02 14:32:57 +04:00
|
|
|
#define BLUETOOTH_A2DP_STATUS_CHANGED_ID "bluetooth-a2dp-status-changed"
|
|
|
|
#define BLUETOOTH_HFP_STATUS_CHANGED_ID "bluetooth-hfp-status-changed"
|
2013-08-12 13:32:25 +04:00
|
|
|
#define BLUETOOTH_HID_STATUS_CHANGED_ID "bluetooth-hid-status-changed"
|
2013-08-02 14:32:57 +04:00
|
|
|
#define BLUETOOTH_SCO_STATUS_CHANGED_ID "bluetooth-sco-status-changed"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* When the connection status of a Bluetooth profile is changed, we'll
|
2013-09-04 06:40:01 +04:00
|
|
|
* dispatch one of the following events.
|
2013-08-02 14:32:57 +04:00
|
|
|
*/
|
|
|
|
#define A2DP_STATUS_CHANGED_ID "a2dpstatuschanged"
|
|
|
|
#define HFP_STATUS_CHANGED_ID "hfpstatuschanged"
|
|
|
|
#define SCO_STATUS_CHANGED_ID "scostatuschanged"
|
|
|
|
|
|
|
|
/**
|
2013-09-04 06:40:01 +04:00
|
|
|
* When the pair status of a Bluetooth device is changed, we'll dispatch an
|
2013-08-02 14:32:57 +04:00
|
|
|
* event.
|
|
|
|
*/
|
|
|
|
#define PAIRED_STATUS_CHANGED_ID "pairedstatuschanged"
|
2013-06-08 19:26:28 +04:00
|
|
|
|
2014-05-23 10:00:14 +04:00
|
|
|
/**
|
|
|
|
* This event would be fired when discovery procedure starts or stops.
|
|
|
|
*/
|
|
|
|
#define DISCOVERY_STATE_CHANGED_ID "discoverystatechanged"
|
|
|
|
|
2013-09-04 06:40:01 +04:00
|
|
|
/**
|
|
|
|
* When receiving a query about current play status from remote device, we'll
|
|
|
|
* dispatch an event.
|
|
|
|
*/
|
|
|
|
#define REQUEST_MEDIA_PLAYSTATUS_ID "requestmediaplaystatus"
|
|
|
|
|
2012-08-17 14:35:59 +04:00
|
|
|
// Bluetooth address format: xx:xx:xx:xx:xx:xx (or xx_xx_xx_xx_xx_xx)
|
|
|
|
#define BLUETOOTH_ADDRESS_LENGTH 17
|
2013-04-05 04:52:12 +04:00
|
|
|
#define BLUETOOTH_ADDRESS_NONE "00:00:00:00:00:00"
|
2013-11-08 19:25:20 +04:00
|
|
|
#define BLUETOOTH_ADDRESS_BYTES 6
|
2012-08-17 14:35:59 +04:00
|
|
|
|
2013-12-12 15:37:42 +04:00
|
|
|
// Bluetooth stack internal error, such as I/O error
|
|
|
|
#define ERR_INTERNAL_ERROR "InternalError"
|
|
|
|
|
2012-06-02 22:23:16 +04:00
|
|
|
BEGIN_BLUETOOTH_NAMESPACE
|
|
|
|
|
2014-08-06 13:45:32 +04:00
|
|
|
enum BluetoothStatus {
|
|
|
|
STATUS_SUCCESS,
|
|
|
|
STATUS_FAIL,
|
|
|
|
STATUS_NOT_READY,
|
|
|
|
STATUS_NOMEM,
|
|
|
|
STATUS_BUSY,
|
|
|
|
STATUS_DONE,
|
|
|
|
STATUS_UNSUPPORTED,
|
|
|
|
STATUS_PARM_INVALID,
|
|
|
|
STATUS_UNHANDLED,
|
|
|
|
STATUS_AUTH_FAILURE,
|
|
|
|
STATUS_RMT_DEV_DOWN
|
|
|
|
};
|
|
|
|
|
2014-08-14 20:12:51 +04:00
|
|
|
enum BluetoothBondState {
|
|
|
|
BOND_STATE_NONE,
|
|
|
|
BOND_STATE_BONDING,
|
|
|
|
BOND_STATE_BONDED
|
|
|
|
};
|
|
|
|
|
|
|
|
enum BluetoothDeviceType {
|
|
|
|
DEVICE_TYPE_BREDR,
|
|
|
|
DEVICE_TYPE_BLE,
|
|
|
|
DEVICE_TYPE_DUAL
|
|
|
|
};
|
|
|
|
|
|
|
|
enum BluetoothPropertyType {
|
2014-09-29 13:41:02 +04:00
|
|
|
PROPERTY_UNKNOWN,
|
2014-08-14 20:12:51 +04:00
|
|
|
PROPERTY_BDNAME,
|
|
|
|
PROPERTY_BDADDR,
|
|
|
|
PROPERTY_UUIDS,
|
|
|
|
PROPERTY_CLASS_OF_DEVICE,
|
|
|
|
PROPERTY_TYPE_OF_DEVICE,
|
|
|
|
PROPERTY_SERVICE_RECORD,
|
|
|
|
PROPERTY_ADAPTER_SCAN_MODE,
|
|
|
|
PROPERTY_ADAPTER_BONDED_DEVICES,
|
|
|
|
PROPERTY_ADAPTER_DISCOVERY_TIMEOUT,
|
|
|
|
PROPERTY_REMOTE_FRIENDLY_NAME,
|
|
|
|
PROPERTY_REMOTE_RSSI,
|
|
|
|
PROPERTY_REMOTE_VERSION_INFO,
|
|
|
|
PROPERTY_REMOTE_DEVICE_TIMESTAMP
|
|
|
|
};
|
|
|
|
|
|
|
|
enum BluetoothScanMode {
|
|
|
|
SCAN_MODE_NONE,
|
|
|
|
SCAN_MODE_CONNECTABLE,
|
|
|
|
SCAN_MODE_CONNECTABLE_DISCOVERABLE
|
|
|
|
};
|
|
|
|
|
|
|
|
struct BluetoothUuid {
|
|
|
|
uint8_t mUuid[16];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct BluetoothServiceRecord {
|
|
|
|
BluetoothUuid mUuid;
|
|
|
|
uint16_t mChannel;
|
|
|
|
char mName[256];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct BluetoothRemoteInfo {
|
|
|
|
int mVerMajor;
|
|
|
|
int mVerMinor;
|
|
|
|
int mManufacturer;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct BluetoothProperty {
|
|
|
|
/* Type */
|
|
|
|
BluetoothPropertyType mType;
|
|
|
|
|
|
|
|
/* Value
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* PROPERTY_BDNAME
|
|
|
|
PROPERTY_BDADDR
|
|
|
|
PROPERTY_REMOTE_FRIENDLY_NAME */
|
|
|
|
nsString mString;
|
|
|
|
|
|
|
|
/* PROPERTY_UUIDS */
|
|
|
|
nsTArray<BluetoothUuid> mUuidArray;
|
|
|
|
|
|
|
|
/* PROPERTY_ADAPTER_BONDED_DEVICES */
|
|
|
|
nsTArray<nsString> mStringArray;
|
|
|
|
|
|
|
|
/* PROPERTY_CLASS_OF_DEVICE
|
|
|
|
PROPERTY_ADAPTER_DISCOVERY_TIMEOUT */
|
|
|
|
uint32_t mUint32;
|
|
|
|
|
|
|
|
/* PROPERTY_RSSI_VALUE */
|
|
|
|
int32_t mInt32;
|
|
|
|
|
|
|
|
/* PROPERTY_DEVICE_TYPE */
|
|
|
|
BluetoothDeviceType mDeviceType;
|
|
|
|
|
|
|
|
/* PROPERTY_SERVICE_RECORD */
|
|
|
|
BluetoothServiceRecord mServiceRecord;
|
|
|
|
|
|
|
|
/* PROPERTY_SCAN_MODE */
|
|
|
|
BluetoothScanMode mScanMode;
|
|
|
|
|
|
|
|
/* PROPERTY_REMOTE_VERSION_INFO */
|
|
|
|
BluetoothRemoteInfo mRemoteInfo;
|
|
|
|
};
|
|
|
|
|
2015-01-09 08:33:53 +03:00
|
|
|
/* Physical transport for GATT connections to remote dual-mode devices */
|
|
|
|
enum BluetoothTransport {
|
|
|
|
TRANSPORT_AUTO, /* No preference of physical transport */
|
|
|
|
TRANSPORT_BREDR, /* Prefer BR/EDR transport */
|
|
|
|
TRANSPORT_LE /* Prefer LE transport */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct BluetoothActivityEnergyInfo {
|
|
|
|
uint8_t mStatus;
|
|
|
|
uint8_t mStackState; /* stack reported state */
|
|
|
|
uint64_t mTxTime; /* in ms */
|
|
|
|
uint64_t mRxTime; /* in ms */
|
|
|
|
uint64_t mIdleTime; /* in ms */
|
|
|
|
uint64_t mEnergyUsed; /* a product of mA, V and ms */
|
|
|
|
};
|
|
|
|
|
2012-09-06 07:06:20 +04:00
|
|
|
enum BluetoothSocketType {
|
|
|
|
RFCOMM = 1,
|
2013-04-12 14:45:37 +04:00
|
|
|
SCO = 2,
|
|
|
|
L2CAP = 3,
|
|
|
|
EL2CAP = 4
|
2012-09-06 07:06:20 +04:00
|
|
|
};
|
|
|
|
|
2014-08-06 13:45:05 +04:00
|
|
|
enum BluetoothHandsfreeAtResponse {
|
|
|
|
HFP_AT_RESPONSE_ERROR,
|
|
|
|
HFP_AT_RESPONSE_OK
|
|
|
|
};
|
|
|
|
|
2014-08-21 12:10:37 +04:00
|
|
|
enum BluetoothHandsfreeAudioState {
|
|
|
|
HFP_AUDIO_STATE_DISCONNECTED,
|
|
|
|
HFP_AUDIO_STATE_CONNECTING,
|
|
|
|
HFP_AUDIO_STATE_CONNECTED,
|
|
|
|
HFP_AUDIO_STATE_DISCONNECTING,
|
|
|
|
};
|
|
|
|
|
2014-08-06 13:45:05 +04:00
|
|
|
enum BluetoothHandsfreeCallAddressType {
|
|
|
|
HFP_CALL_ADDRESS_TYPE_UNKNOWN,
|
|
|
|
HFP_CALL_ADDRESS_TYPE_INTERNATIONAL
|
|
|
|
};
|
|
|
|
|
|
|
|
enum BluetoothHandsfreeCallDirection {
|
|
|
|
HFP_CALL_DIRECTION_OUTGOING,
|
|
|
|
HFP_CALL_DIRECTION_INCOMING
|
|
|
|
};
|
|
|
|
|
2014-08-21 12:10:37 +04:00
|
|
|
enum BluetoothHandsfreeCallHoldType {
|
|
|
|
HFP_CALL_HOLD_RELEASEHELD,
|
|
|
|
HFP_CALL_HOLD_RELEASEACTIVE_ACCEPTHELD,
|
|
|
|
HFP_CALL_HOLD_HOLDACTIVE_ACCEPTHELD,
|
|
|
|
HFP_CALL_HOLD_ADDHELDTOCONF
|
|
|
|
};
|
|
|
|
|
2014-08-06 13:45:05 +04:00
|
|
|
enum BluetoothHandsfreeCallMode {
|
|
|
|
HFP_CALL_MODE_VOICE,
|
|
|
|
HFP_CALL_MODE_DATA,
|
|
|
|
HFP_CALL_MODE_FAX
|
|
|
|
};
|
|
|
|
|
|
|
|
enum BluetoothHandsfreeCallMptyType {
|
|
|
|
HFP_CALL_MPTY_TYPE_SINGLE,
|
|
|
|
HFP_CALL_MPTY_TYPE_MULTI
|
|
|
|
};
|
|
|
|
|
|
|
|
enum BluetoothHandsfreeCallState {
|
|
|
|
HFP_CALL_STATE_ACTIVE,
|
|
|
|
HFP_CALL_STATE_HELD,
|
|
|
|
HFP_CALL_STATE_DIALING,
|
|
|
|
HFP_CALL_STATE_ALERTING,
|
|
|
|
HFP_CALL_STATE_INCOMING,
|
|
|
|
HFP_CALL_STATE_WAITING,
|
|
|
|
HFP_CALL_STATE_IDLE
|
|
|
|
};
|
|
|
|
|
2014-08-21 12:10:37 +04:00
|
|
|
enum BluetoothHandsfreeConnectionState
|
|
|
|
{
|
|
|
|
HFP_CONNECTION_STATE_DISCONNECTED,
|
|
|
|
HFP_CONNECTION_STATE_CONNECTING,
|
|
|
|
HFP_CONNECTION_STATE_CONNECTED,
|
|
|
|
HFP_CONNECTION_STATE_SLC_CONNECTED,
|
|
|
|
HFP_CONNECTION_STATE_DISCONNECTING
|
|
|
|
};
|
|
|
|
|
2014-08-06 13:45:05 +04:00
|
|
|
enum BluetoothHandsfreeNetworkState {
|
|
|
|
HFP_NETWORK_STATE_NOT_AVAILABLE,
|
|
|
|
HFP_NETWORK_STATE_AVAILABLE
|
|
|
|
};
|
|
|
|
|
2015-01-09 08:35:01 +03:00
|
|
|
enum BluetoothHandsfreeWbsConfig {
|
|
|
|
HFP_WBS_NONE, /* Neither CVSD nor mSBC codec, but other optional codec.*/
|
|
|
|
HFP_WBS_NO, /* CVSD */
|
|
|
|
HFP_WBS_YES /* mSBC */
|
|
|
|
};
|
|
|
|
|
2014-08-21 12:10:37 +04:00
|
|
|
enum BluetoothHandsfreeNRECState {
|
|
|
|
HFP_NREC_STOPPED,
|
|
|
|
HFP_NREC_STARTED
|
|
|
|
};
|
|
|
|
|
2014-08-06 13:45:05 +04:00
|
|
|
enum BluetoothHandsfreeServiceType {
|
|
|
|
HFP_SERVICE_TYPE_HOME,
|
|
|
|
HFP_SERVICE_TYPE_ROAMING
|
|
|
|
};
|
|
|
|
|
2014-08-21 12:10:37 +04:00
|
|
|
enum BluetoothHandsfreeVoiceRecognitionState {
|
|
|
|
HFP_VOICE_RECOGNITION_STOPPED,
|
|
|
|
HFP_VOICE_RECOGNITION_STARTED
|
|
|
|
};
|
|
|
|
|
2014-08-06 13:45:05 +04:00
|
|
|
enum BluetoothHandsfreeVolumeType {
|
|
|
|
HFP_VOLUME_TYPE_SPEAKER,
|
|
|
|
HFP_VOLUME_TYPE_MICROPHONE
|
|
|
|
};
|
|
|
|
|
2012-07-18 07:41:54 +04:00
|
|
|
class BluetoothSignal;
|
|
|
|
typedef mozilla::Observer<BluetoothSignal> BluetoothSignalObserver;
|
2012-06-02 22:23:16 +04:00
|
|
|
|
2012-08-01 08:49:59 +04:00
|
|
|
// Enums for object types, currently used for shared function lookups
|
|
|
|
// (get/setproperty, etc...). Possibly discernable via dbus paths, but this
|
|
|
|
// method is future-proofed for platform independence.
|
|
|
|
enum BluetoothObjectType {
|
|
|
|
TYPE_MANAGER = 0,
|
|
|
|
TYPE_ADAPTER = 1,
|
2012-09-13 20:37:14 +04:00
|
|
|
TYPE_DEVICE = 2,
|
|
|
|
|
|
|
|
TYPE_INVALID
|
2012-08-01 08:49:59 +04:00
|
|
|
};
|
|
|
|
|
2014-09-01 12:11:53 +04:00
|
|
|
enum BluetoothA2dpAudioState {
|
|
|
|
A2DP_AUDIO_STATE_REMOTE_SUSPEND,
|
|
|
|
A2DP_AUDIO_STATE_STOPPED,
|
|
|
|
A2DP_AUDIO_STATE_STARTED,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum BluetoothA2dpConnectionState {
|
|
|
|
A2DP_CONNECTION_STATE_DISCONNECTED,
|
|
|
|
A2DP_CONNECTION_STATE_CONNECTING,
|
|
|
|
A2DP_CONNECTION_STATE_CONNECTED,
|
|
|
|
A2DP_CONNECTION_STATE_DISCONNECTING
|
|
|
|
};
|
|
|
|
|
2013-07-29 13:32:34 +04:00
|
|
|
enum ControlPlayStatus {
|
|
|
|
PLAYSTATUS_STOPPED = 0x00,
|
|
|
|
PLAYSTATUS_PLAYING = 0x01,
|
|
|
|
PLAYSTATUS_PAUSED = 0x02,
|
|
|
|
PLAYSTATUS_FWD_SEEK = 0x03,
|
|
|
|
PLAYSTATUS_REV_SEEK = 0x04,
|
|
|
|
PLAYSTATUS_UNKNOWN,
|
|
|
|
PLAYSTATUS_ERROR = 0xFF,
|
|
|
|
};
|
|
|
|
|
2014-09-02 14:46:07 +04:00
|
|
|
enum {
|
|
|
|
AVRCP_UID_SIZE = 8
|
|
|
|
};
|
|
|
|
|
2014-09-01 12:11:53 +04:00
|
|
|
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
|
|
|
|
};
|
|
|
|
|
2014-08-06 13:45:22 +04:00
|
|
|
enum BluetoothAvrcpPlayerAttribute {
|
|
|
|
AVRCP_PLAYER_ATTRIBUTE_EQUALIZER,
|
|
|
|
AVRCP_PLAYER_ATTRIBUTE_REPEAT,
|
|
|
|
AVRCP_PLAYER_ATTRIBUTE_SHUFFLE,
|
|
|
|
AVRCP_PLAYER_ATTRIBUTE_SCAN
|
|
|
|
};
|
|
|
|
|
|
|
|
enum BluetoothAvrcpStatus {
|
|
|
|
AVRCP_STATUS_BAD_COMMAND,
|
|
|
|
AVRCP_STATUS_BAD_PARAMETER,
|
|
|
|
AVRCP_STATUS_NOT_FOUND,
|
|
|
|
AVRCP_STATUS_INTERNAL_ERROR,
|
|
|
|
AVRCP_STATUS_SUCCESS
|
|
|
|
};
|
|
|
|
|
|
|
|
enum BluetoothAvrcpEvent {
|
|
|
|
AVRCP_EVENT_PLAY_STATUS_CHANGED,
|
|
|
|
AVRCP_EVENT_TRACK_CHANGE,
|
|
|
|
AVRCP_EVENT_TRACK_REACHED_END,
|
|
|
|
AVRCP_EVENT_TRACK_REACHED_START,
|
|
|
|
AVRCP_EVENT_PLAY_POS_CHANGED,
|
|
|
|
AVRCP_EVENT_APP_SETTINGS_CHANGED
|
|
|
|
};
|
|
|
|
|
|
|
|
enum BluetoothAvrcpNotification {
|
|
|
|
AVRCP_NTF_INTERIM,
|
|
|
|
AVRCP_NTF_CHANGED
|
|
|
|
};
|
|
|
|
|
2014-09-01 12:11:53 +04:00
|
|
|
enum BluetoothAvrcpRemoteFeature {
|
|
|
|
AVRCP_REMOTE_FEATURE_NONE,
|
|
|
|
AVRCP_REMOTE_FEATURE_METADATA,
|
|
|
|
AVRCP_REMOTE_FEATURE_ABSOLUTE_VOLUME,
|
|
|
|
AVRCP_REMOTE_FEATURE_BROWSE
|
|
|
|
};
|
|
|
|
|
2014-08-06 13:45:22 +04:00
|
|
|
struct BluetoothAvrcpElementAttribute {
|
|
|
|
uint32_t mId;
|
|
|
|
nsString mValue;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct BluetoothAvrcpNotificationParam {
|
|
|
|
ControlPlayStatus mPlayStatus;
|
|
|
|
uint8_t mTrack[8];
|
|
|
|
uint32_t mSongPos;
|
|
|
|
uint8_t mNumAttr;
|
|
|
|
uint8_t mIds[256];
|
|
|
|
uint8_t mValues[256];
|
|
|
|
};
|
|
|
|
|
2014-09-01 12:11:53 +04:00
|
|
|
struct BluetoothAvrcpPlayerSettings {
|
|
|
|
uint8_t mNumAttr;
|
|
|
|
uint8_t mIds[256];
|
|
|
|
uint8_t mValues[256];
|
|
|
|
};
|
|
|
|
|
2012-06-02 22:23:16 +04:00
|
|
|
END_BLUETOOTH_NAMESPACE
|
2012-02-20 19:15:19 +04:00
|
|
|
|
|
|
|
#endif // mozilla_dom_bluetooth_bluetoothcommon_h__
|