Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: device/bluetooth/bluetooth_gatt_characteristic.h

Issue 1947353002: //device/bluetooth support for attribute properties and permissions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@properties
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_GATT_CHARACTERISTIC_H_ 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_GATT_CHARACTERISTIC_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_GATT_CHARACTERISTIC_H_ 6 #define DEVICE_BLUETOOTH_BLUETOOTH_GATT_CHARACTERISTIC_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string> 9 #include <string>
10 10
(...skipping 28 matching lines...) Expand all
39 PROPERTY_NONE = 0, 39 PROPERTY_NONE = 0,
40 PROPERTY_BROADCAST = 1 << 0, 40 PROPERTY_BROADCAST = 1 << 0,
41 PROPERTY_READ = 1 << 1, 41 PROPERTY_READ = 1 << 1,
42 PROPERTY_WRITE_WITHOUT_RESPONSE = 1 << 2, 42 PROPERTY_WRITE_WITHOUT_RESPONSE = 1 << 2,
43 PROPERTY_WRITE = 1 << 3, 43 PROPERTY_WRITE = 1 << 3,
44 PROPERTY_NOTIFY = 1 << 4, 44 PROPERTY_NOTIFY = 1 << 4,
45 PROPERTY_INDICATE = 1 << 5, 45 PROPERTY_INDICATE = 1 << 5,
46 PROPERTY_AUTHENTICATED_SIGNED_WRITES = 1 << 6, 46 PROPERTY_AUTHENTICATED_SIGNED_WRITES = 1 << 6,
47 PROPERTY_EXTENDED_PROPERTIES = 1 << 7, 47 PROPERTY_EXTENDED_PROPERTIES = 1 << 7,
48 PROPERTY_RELIABLE_WRITE = 1 << 8, 48 PROPERTY_RELIABLE_WRITE = 1 << 8,
49 PROPERTY_WRITABLE_AUXILIARIES = 1 << 9 49 PROPERTY_WRITABLE_AUXILIARIES = 1 << 9,
50 PROPERTY_READ_ENCRYPTED = 1 << 10,
51 PROPERTY_WRITE_ENCRYPTED = 1 << 11,
52 PROPERTY_READ_ENCRYPTED_AUTHENTICATED = 1 << 12,
53 PROPERTY_WRITE_ENCRYPTED_AUTHENTICATED = 1 << 13,
50 }; 54 };
51 typedef uint32_t Properties; 55 typedef uint32_t Properties;
52 56
53 // Values representing read, write, and encryption permissions for a 57 // Values representing read, write, and encryption permissions for a
54 // characteristic's value. While attribute permissions for all GATT 58 // characteristic's value. While attribute permissions for all GATT
55 // definitions have been set by the Bluetooth specification, characteristic 59 // definitions have been set by the Bluetooth specification, characteristic
56 // value permissions are left up to the higher-level profile. 60 // value permissions are left up to the higher-level profile.
57 // 61 //
58 // Attribute permissions are distinct from the characteristic properties. For 62 // Attribute permissions are distinct from the characteristic properties. For
59 // example, a characteristic may have the property |PROPERTY_READ| to make 63 // example, a characteristic may have the property |PROPERTY_READ| to make
60 // clients know that it is possible to read the characteristic value and have 64 // clients know that it is possible to read the characteristic value and have
61 // the permission |PERMISSION_READ_ENCRYPTED| to require a secure connection. 65 // the permission |PERMISSION_READ_ENCRYPTED| to require a secure connection.
62 // It is up to the application to properly specify the permissions and 66 // It is up to the application to properly specify the permissions and
63 // properties for a local characteristic. 67 // properties for a local characteristic.
68 // TODO(rkc): Currently BlueZ infers permissions for characteristics from
69 // the properties. Once this is fixed, we will start sending the permissions
70 // for characteristics to BlueZ. Till then permissions for characteristics
71 // are unimplemented.
64 enum Permission { 72 enum Permission {
65 PERMISSION_NONE = 0, 73 PERMISSION_NONE = 0,
66 PERMISSION_READ = 1 << 0, 74 PERMISSION_READ = 1 << 0,
67 PERMISSION_WRITE = 1 << 1, 75 PERMISSION_WRITE = 1 << 1,
68 PERMISSION_READ_ENCRYPTED = 1 << 2, 76 PERMISSION_READ_ENCRYPTED = 1 << 2,
69 PERMISSION_WRITE_ENCRYPTED = 1 << 3 77 PERMISSION_WRITE_ENCRYPTED = 1 << 3,
78 PERMISSION_READ_ENCRYPTED_AUTHENTICATED = 1 << 4,
79 PERMISSION_WRITE_ENCRYPTED_AUTHENTICATED = 1 << 5
70 }; 80 };
71 typedef uint32_t Permissions; 81 typedef uint32_t Permissions;
72 82
73 // The ErrorCallback is used by methods to asynchronously report errors. 83 // The ErrorCallback is used by methods to asynchronously report errors.
74 typedef base::Callback<void(BluetoothGattService::GattErrorCode)> 84 typedef base::Callback<void(BluetoothGattService::GattErrorCode)>
75 ErrorCallback; 85 ErrorCallback;
76 86
77 // Identifier used to uniquely identify a GATT characteristic object. This is 87 // Identifier used to uniquely identify a GATT characteristic object. This is
78 // different from the characteristic UUID: while multiple characteristics with 88 // different from the characteristic UUID: while multiple characteristics with
79 // the same UUID can exist on a Bluetooth device, the identifier returned from 89 // the same UUID can exist on a Bluetooth device, the identifier returned from
(...skipping 14 matching lines...) Expand all
94 BluetoothGattCharacteristic(); 104 BluetoothGattCharacteristic();
95 virtual ~BluetoothGattCharacteristic(); 105 virtual ~BluetoothGattCharacteristic();
96 106
97 private: 107 private:
98 DISALLOW_COPY_AND_ASSIGN(BluetoothGattCharacteristic); 108 DISALLOW_COPY_AND_ASSIGN(BluetoothGattCharacteristic);
99 }; 109 };
100 110
101 } // namespace device 111 } // namespace device
102 112
103 #endif // DEVICE_BLUETOOTH_BLUETOOTH_GATT_CHARACTERISTIC_H_ 113 #endif // DEVICE_BLUETOOTH_BLUETOOTH_GATT_CHARACTERISTIC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698