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

Unified Diff: Source/modules/bluetooth/BluetoothUUID.cpp

Issue 1315443007: bluetooth: Explain why standard names aren't recognized in error message. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: merge TOT Created 5 years, 4 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
« no previous file with comments | « LayoutTests/bluetooth/getPrimaryService.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/bluetooth/BluetoothUUID.cpp
diff --git a/Source/modules/bluetooth/BluetoothUUID.cpp b/Source/modules/bluetooth/BluetoothUUID.cpp
index 7c744667692b6b3503260f9891c826b16115c331..06f2ab8623f75b78978cbc8ce18d9aa17655caf0 100644
--- a/Source/modules/bluetooth/BluetoothUUID.cpp
+++ b/Source/modules/bluetooth/BluetoothUUID.cpp
@@ -311,7 +311,23 @@ String getUUIDForGATTAttribute(GATTAttribute attribute, StringOrUnsignedLong nam
errorMessage.append(attributeType);
errorMessage.append(" name: '");
errorMessage.append(nameStr);
- errorMessage.append("'.");
+ errorMessage.append("'. It must be a valid UUID alias (e.g. 0x1234), "
+ "UUID (lowercase hex characters e.g. '00001234-0000-1000-8000-00805f9b34fb'), "
+ "or recognized standard name from ");
+ switch (attribute) {
+ case GATTAttribute::Service:
+ errorMessage.append("https://developer.bluetooth.org/gatt/services/Pages/ServicesHome.aspx"
+ " e.g. 'alert_notification'.");
+ break;
+ case GATTAttribute::Characteristic:
+ errorMessage.append("https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicsHome.aspx"
+ " e.g. 'aerobic_heart_rate_lower_limit'.");
+ break;
+ case GATTAttribute::Descriptor:
+ errorMessage.append("https://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorsHomePage.aspx"
+ " e.g. 'gatt.characteristic_presentation_format'.");
+ break;
+ }
// Otherwise, throw a SyntaxError.
exceptionState.throwDOMException(SyntaxError, errorMessage.toString());
return String();
« no previous file with comments | « LayoutTests/bluetooth/getPrimaryService.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698