summaryrefslogtreecommitdiffstats
path: root/device/bluetooth/bluetooth_device.h
diff options
context:
space:
mode:
Diffstat (limited to 'device/bluetooth/bluetooth_device.h')
-rw-r--r--device/bluetooth/bluetooth_device.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/device/bluetooth/bluetooth_device.h b/device/bluetooth/bluetooth_device.h
index 3c00e44..c9aa1ee 100644
--- a/device/bluetooth/bluetooth_device.h
+++ b/device/bluetooth/bluetooth_device.h
@@ -17,6 +17,10 @@
#include "device/bluetooth/bluetooth_uuid.h"
#include "net/base/net_log.h"
+namespace base {
+class BinaryValue;
+}
+
namespace device {
class BluetoothGattConnection;
@@ -185,6 +189,9 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDevice {
// and metrics logging,
virtual uint32 GetBluetoothClass() const = 0;
+ // Returns the identifier of the bluetooth device.
+ virtual std::string GetIdentifier() const;
+
// Returns the Bluetooth of address the device. This should be used as
// a unique key to identify the device and copied where needed.
virtual std::string GetAddress() const = 0;
@@ -398,6 +405,12 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDevice {
virtual BluetoothGattService* GetGattService(
const std::string& identifier) const;
+ // Returns service data of a service given its UUID.
+ virtual base::BinaryValue* GetServiceData(BluetoothUUID serviceUUID) const;
+
+ // Returns the list UUIDs of services that have service data.
+ virtual UUIDList GetServiceDataUUIDs() const;
+
// Returns the |address| in the canonical format: XX:XX:XX:XX:XX:XX, where
// each 'X' is a hex digit. If the input |address| is invalid, returns an
// empty string.
@@ -409,11 +422,23 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDevice {
// Returns the internal name of the Bluetooth device, used by GetName().
virtual std::string GetDeviceName() const = 0;
+ // Clears the list of service data.
+ void ClearServiceData();
+
+ // Set the data of a given service designated by its UUID.
+ void SetServiceData(BluetoothUUID serviceUUID, const char* buffer,
+ size_t size);
+
// Mapping from the platform-specific GATT service identifiers to
// BluetoothGattService objects.
typedef std::map<std::string, BluetoothGattService*> GattServiceMap;
GattServiceMap gatt_services_;
+ // Mapping from service UUID represented as a std::string of a bluetooth
+ // service to
+ // the specific data. The data is stored as BinaryValue.
+ scoped_ptr<base::DictionaryValue> services_data_;
+
private:
// Returns a localized string containing the device's bluetooth address and
// a device type for display when |name_| is empty.