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

Unified Diff: device/bluetooth/public/interfaces/device.mojom

Issue 2627243002: bluetooth: Add control for reading/writing of characteristics to internals page. (Closed)
Patch Set: Remove TypeConverter, add EnumTraits for GattResult Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/public/interfaces/device.mojom
diff --git a/device/bluetooth/public/interfaces/device.mojom b/device/bluetooth/public/interfaces/device.mojom
index 5448f342e424ba9cd95daceadb01f197c09b00db..baa361150d058cc8660554e3e7fbda3fbe9ee7ab 100644
--- a/device/bluetooth/public/interfaces/device.mojom
+++ b/device/bluetooth/public/interfaces/device.mojom
@@ -15,6 +15,7 @@ import "device/bluetooth/public/interfaces/uuid.mojom";
// contains additional properties pertaining to the characteristic.
// The properties |RELIABLE_WRITE| and |WRITABLE_AUXILIARIES| are retrieved from
// that characteristic.
+// TODO(crbug.com/684168): Remove assignment of values when this is automated.
enum Property {
NONE = 0,
BROADCAST = 1,
@@ -33,6 +34,20 @@ enum Property {
WRITE_ENCRYPTED_AUTHENTICATED = 8192
};
+enum GattResult {
+ SUCCESS,
+ UNKNOWN,
+ FAILED,
+ IN_PROGRESS,
+ INVALID_LENGTH,
+ NOT_PERMITTED,
+ NOT_AUTHORIZED,
+ NOT_PAIRED,
+ NOT_SUPPORTED,
+ SERVICE_NOT_FOUND,
+ CHARACTERISTIC_NOT_FOUND
+};
+
// TODO(crbug.com/657632): Remove when numerical values can be optional.
struct RSSIWrapper {
int8 value;
@@ -56,6 +71,12 @@ struct CharacteristicInfo {
string id;
UUID uuid;
uint32 properties;
+ array<uint8> last_known_value;
+};
+
+struct DescriptorInfo {
+ string id;
+ UUID uuid;
};
interface Device {
@@ -75,4 +96,22 @@ interface Device {
// means that no characteristics were found.
GetCharacteristics(string service_id) =>
(array<CharacteristicInfo>? characteristics);
+
+ // Reads the value for the GATT Characteristic with |characteristic_id| in
+ // the GATT Service with |service_id|.
+ ReadValueForCharacteristic(string service_id, string characteristic_id) =>
+ (GattResult result, array<uint8>? value);
+
+ // Writes the |value| to the GATT Characteristic with |characteristic_id| in
+ // the GATT Service with |service_id|.
+ WriteValueForCharacteristic(string service_id, string characteristic_id,
+ array<uint8> value) => (GattResult result);
+
+ // Gets the GATT Descriptors of the GATT Characteristic with matching
+ // |characteristic_id| in the GATT Service with matching |service_id|.
+ // If |descriptors| is null, an error occured while attempting to retrieve
+ // the array of descriptors. If |descriptors| is empty, this simply
+ // means that no descriptors were found.
+ GetDescriptors(string service_id, string characteristic_id) =>
+ (array<DescriptorInfo>? descriptors);
};

Powered by Google App Engine
This is Rietveld 408576698