Bug 1054830 - Patch1: Define structures to represent bluedroid's gatt data structures. r=tzimmermann

This commit is contained in:
Jocelyn Liu 2014-09-26 11:16:32 +08:00
parent 1b794faf03
commit 50fa877cdb

View File

@ -188,6 +188,12 @@ extern bool gBluetoothDebugFlag;
// Bluetooth stack internal error, such as I/O error
#define ERR_INTERNAL_ERROR "InternalError"
/**
* BT specification v4.1 defines the maximum attribute length as 512 octets.
* Currently use 600 here to conform to bluedroid's BTGATT_MAX_ATTR_LEN.
*/
#define BLUETOOTH_GATT_MAX_ATTR_LEN 600
BEGIN_BLUETOOTH_NAMESPACE
enum BluetoothStatus {
@ -497,6 +503,46 @@ struct BluetoothAvrcpPlayerSettings {
uint8_t mValues[256];
};
struct BluetoothGattAdvData {
uint8_t mAdvData[62];
};
struct BluetoothGattId {
BluetoothUuid mUuid;
uint8_t mInstanceId;
};
struct BluetoothGattServiceId {
BluetoothGattId mId;
uint8_t mIsPrimary;
};
struct BluetoothGattReadParam {
BluetoothGattServiceId mServiceId;
BluetoothGattId mCharId;
BluetoothGattId mDescriptorId;
uint8_t mValue[BLUETOOTH_GATT_MAX_ATTR_LEN];
uint16_t mValueLength;
uint16_t mValueType;
uint8_t mStatus;
};
struct BluetoothGattWriteParam {
BluetoothGattServiceId mServiceId;
BluetoothGattId mCharId;
BluetoothGattId mDescriptorId;
uint8_t mStatus;
};
struct BluetoothGattNotifyParam {
uint8_t mValue[BLUETOOTH_GATT_MAX_ATTR_LEN];
nsString mBdAddr;
BluetoothGattServiceId mServiceId;
BluetoothGattId mCharId;
uint16_t mLength;
uint8_t mIsNotify;
};
END_BLUETOOTH_NAMESPACE
#endif // mozilla_dom_bluetooth_bluetoothcommon_h__