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

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: arc: bluetooth: Add SDP host side support Created 4 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
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..f1897e5834c7fa7e0a04bc31bdf38a7c2dc9dde1 100644
--- a/components/arc/bluetooth/bluetooth_struct_traits.h
+++ b/components/arc/bluetooth/bluetooth_struct_traits.h
@@ -5,8 +5,15 @@
#ifndef COMPONENTS_ARC_BLUETOOTH_BLUETOOTH_STRUCT_TRAITS_H_
#define COMPONENTS_ARC_BLUETOOTH_BLUETOOTH_STRUCT_TRAITS_H_
+#include <map>
+#include <utility>
+#include <vector>
+
#include "components/arc/common/bluetooth.mojom.h"
#include "device/bluetooth/bluetooth_common.h"
+#include "device/bluetooth/bluez/bluetooth_service_attribute_value_bluez.h"
+#include "device/bluetooth/bluez/bluetooth_service_record_bluez.h"
+#include "ipc/ipc_message_utils.h"
namespace mojo {
@@ -49,6 +56,105 @@ struct EnumTraits<arc::mojom::BluetoothDeviceType,
}
};
+template <>
+struct EnumTraits<arc::mojom::BluetoothSdpAttributeType,
+ bluez::BluetoothServiceAttributeValueBlueZ::Type> {
+ static arc::mojom::BluetoothSdpAttributeType ToMojom(
+ bluez::BluetoothServiceAttributeValueBlueZ::Type input);
+ static bool FromMojom(
+ arc::mojom::BluetoothSdpAttributeType input,
+ bluez::BluetoothServiceAttributeValueBlueZ::Type* output);
+};
+
+template <>
+struct StructTraits<arc::mojom::BluetoothSdpAttributeLayer2,
puthik_chromium 2016/08/25 18:44:54 Add data view to template type here and else where
+ bluez::BluetoothServiceAttributeValueBlueZ> {
+ static void* SetUpContext(
+ const bluez::BluetoothServiceAttributeValueBlueZ& value);
+ static void TearDownContext(
+ const bluez::BluetoothServiceAttributeValueBlueZ& value,
+ void* context);
+
+ static bluez::BluetoothServiceAttributeValueBlueZ::Type type(
+ const bluez::BluetoothServiceAttributeValueBlueZ& value,
+ void* context);
+ static uint32_t type_size(
+ const bluez::BluetoothServiceAttributeValueBlueZ& value,
+ void* context);
+ static const base::ListValue& value(
+ const bluez::BluetoothServiceAttributeValueBlueZ& value,
+ void* context);
+
+ static bool Read(arc::mojom::BluetoothSdpAttributeLayer2DataView data,
+ bluez::BluetoothServiceAttributeValueBlueZ* output);
+};
+
+template <>
+struct StructTraits<arc::mojom::BluetoothSdpAttributeLayer1,
+ bluez::BluetoothServiceAttributeValueBlueZ> {
+ static void* SetUpContext(
+ const bluez::BluetoothServiceAttributeValueBlueZ& value);
+ static void TearDownContext(
+ const bluez::BluetoothServiceAttributeValueBlueZ& value,
+ void* context);
+
+ static bluez::BluetoothServiceAttributeValueBlueZ::Type type(
+ const bluez::BluetoothServiceAttributeValueBlueZ& value,
+ void* context);
+ static uint32_t type_size(
+ const bluez::BluetoothServiceAttributeValueBlueZ& value,
+ void* context);
+ static const base::ListValue& value(
+ const bluez::BluetoothServiceAttributeValueBlueZ& value,
+ void* context);
+ static const bluez::BluetoothServiceAttributeValueBlueZ::Sequence& sequence(
+ const bluez::BluetoothServiceAttributeValueBlueZ& value,
+ void* context);
+
+ static bool Read(arc::mojom::BluetoothSdpAttributeLayer1DataView data,
+ bluez::BluetoothServiceAttributeValueBlueZ* output);
+};
+
+template <>
+struct StructTraits<arc::mojom::BluetoothSdpAttribute,
+ bluez::BluetoothServiceAttributeValueBlueZ> {
+ static void* SetUpContext(
+ const bluez::BluetoothServiceAttributeValueBlueZ& value);
+ static void TearDownContext(
+ const bluez::BluetoothServiceAttributeValueBlueZ& value,
+ void* context);
+
+ static bluez::BluetoothServiceAttributeValueBlueZ::Type type(
+ const bluez::BluetoothServiceAttributeValueBlueZ& value,
+ void* context);
+ static uint32_t type_size(
+ const bluez::BluetoothServiceAttributeValueBlueZ& value,
+ void* context);
+ static const base::ListValue& value(
+ const bluez::BluetoothServiceAttributeValueBlueZ& value,
+ void* context);
+ static const bluez::BluetoothServiceAttributeValueBlueZ::Sequence& sequence(
+ const bluez::BluetoothServiceAttributeValueBlueZ& value,
+ void* context);
+
+ static bool Read(arc::mojom::BluetoothSdpAttributeDataView data,
+ bluez::BluetoothServiceAttributeValueBlueZ* output);
+};
+
+template <>
+struct StructTraits<arc::mojom::BluetoothSdpRecord,
+ bluez::BluetoothServiceRecordBlueZ> {
+ static void* SetUpContext(const bluez::BluetoothServiceRecordBlueZ& value);
+ static void TearDownContext(const bluez::BluetoothServiceRecordBlueZ& value,
+ void* context);
+
+ static const std::map<uint16_t, bluez::BluetoothServiceAttributeValueBlueZ>&
+ attrs(const bluez::BluetoothServiceRecordBlueZ& value, void* context);
+
+ static bool Read(arc::mojom::BluetoothSdpRecordDataView data,
+ bluez::BluetoothServiceRecordBlueZ* output);
+};
+
} // namespace mojo
#endif // COMPONENTS_ARC_BLUETOOTH_BLUETOOTH_STRUCT_TRAITS_H_
« no previous file with comments | « components/arc/bluetooth/arc_bluetooth_bridge.cc ('k') | components/arc/bluetooth/bluetooth_struct_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698