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

Unified Diff: components/arc/bluetooth/bluetooth_struct_traits.h

Issue 2149713002: arc: bluetooth: Add SDP host side support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase on ToT. Created 4 years, 3 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: components/arc/bluetooth/bluetooth_struct_traits.h
diff --git a/components/arc/bluetooth/bluetooth_struct_traits.h b/components/arc/bluetooth/bluetooth_struct_traits.h
index 2178fc1365103a6822c674453ac619a97ee65449..e47d551cc728b6d267c07b371979c1810eca059c 100644
--- a/components/arc/bluetooth/bluetooth_struct_traits.h
+++ b/components/arc/bluetooth/bluetooth_struct_traits.h
@@ -7,6 +7,7 @@
#include "components/arc/common/bluetooth.mojom.h"
#include "device/bluetooth/bluetooth_common.h"
+#include "device/bluetooth/bluez/bluetooth_service_attribute_value_bluez.h"
namespace mojo {
@@ -49,6 +50,49 @@ struct EnumTraits<arc::mojom::BluetoothDeviceType,
}
};
+template <>
+struct EnumTraits<arc::mojom::BluetoothSdpAttributeType,
+ bluez::BluetoothServiceAttributeValueBlueZ::Type> {
+ static arc::mojom::BluetoothSdpAttributeType ToMojom(
+ bluez::BluetoothServiceAttributeValueBlueZ::Type input) {
+ switch (input) {
+ case bluez::BluetoothServiceAttributeValueBlueZ::NULLTYPE:
+ case bluez::BluetoothServiceAttributeValueBlueZ::UINT:
+ case bluez::BluetoothServiceAttributeValueBlueZ::INT:
+ case bluez::BluetoothServiceAttributeValueBlueZ::UUID:
+ case bluez::BluetoothServiceAttributeValueBlueZ::STRING:
+ case bluez::BluetoothServiceAttributeValueBlueZ::BOOL:
+ case bluez::BluetoothServiceAttributeValueBlueZ::SEQUENCE:
+ case bluez::BluetoothServiceAttributeValueBlueZ::URL:
+ return static_cast<arc::mojom::BluetoothSdpAttributeType>(input);
+ default:
+ NOTREACHED() << "Invalid type: " << static_cast<uint32_t>(input);
+ return arc::mojom::BluetoothSdpAttributeType::NULLTYPE;
+ }
+ }
+
+ static bool FromMojom(
+ arc::mojom::BluetoothSdpAttributeType input,
+ bluez::BluetoothServiceAttributeValueBlueZ::Type* output) {
+ switch (input) {
+ case arc::mojom::BluetoothSdpAttributeType::NULLTYPE:
+ case arc::mojom::BluetoothSdpAttributeType::UINT:
+ case arc::mojom::BluetoothSdpAttributeType::INT:
+ case arc::mojom::BluetoothSdpAttributeType::UUID:
+ case arc::mojom::BluetoothSdpAttributeType::STRING:
+ case arc::mojom::BluetoothSdpAttributeType::BOOL:
+ case arc::mojom::BluetoothSdpAttributeType::SEQUENCE:
+ case arc::mojom::BluetoothSdpAttributeType::URL:
+ *output = static_cast<bluez::BluetoothServiceAttributeValueBlueZ::Type>(
+ input);
+ return true;
+ default:
+ NOTREACHED() << "Invalid type: " << static_cast<uint32_t>(input);
+ return false;
+ }
+ }
+};
+
} // namespace mojo
#endif // COMPONENTS_ARC_BLUETOOTH_BLUETOOTH_STRUCT_TRAITS_H_

Powered by Google App Engine
This is Rietveld 408576698