OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 COMPONENTS_ARC_BLUETOOTH_BLUETOOTH_STRUCT_TRAITS_H_ | 5 #ifndef COMPONENTS_ARC_BLUETOOTH_BLUETOOTH_STRUCT_TRAITS_H_ |
6 #define COMPONENTS_ARC_BLUETOOTH_BLUETOOTH_STRUCT_TRAITS_H_ | 6 #define COMPONENTS_ARC_BLUETOOTH_BLUETOOTH_STRUCT_TRAITS_H_ |
7 | 7 |
8 #include "components/arc/common/bluetooth.mojom.h" | 8 #include "components/arc/common/bluetooth.mojom.h" |
| 9 #include "device/bluetooth/bluetooth_advertisement.h" |
9 #include "device/bluetooth/bluetooth_common.h" | 10 #include "device/bluetooth/bluetooth_common.h" |
| 11 #include "device/bluetooth/bluetooth_uuid.h" |
10 #include "device/bluetooth/bluez/bluetooth_service_attribute_value_bluez.h" | 12 #include "device/bluetooth/bluez/bluetooth_service_attribute_value_bluez.h" |
11 | 13 |
12 namespace mojo { | 14 namespace mojo { |
13 | 15 |
14 template <> | 16 template <> |
15 struct EnumTraits<arc::mojom::BluetoothDeviceType, | 17 struct EnumTraits<arc::mojom::BluetoothDeviceType, |
16 device::BluetoothTransport> { | 18 device::BluetoothTransport> { |
17 static arc::mojom::BluetoothDeviceType ToMojom( | 19 static arc::mojom::BluetoothDeviceType ToMojom( |
18 device::BluetoothTransport type) { | 20 device::BluetoothTransport type) { |
19 switch (type) { | 21 switch (type) { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 } | 95 } |
94 }; | 96 }; |
95 | 97 |
96 template <> | 98 template <> |
97 struct StructTraits<arc::mojom::BluetoothUUIDDataView, device::BluetoothUUID> { | 99 struct StructTraits<arc::mojom::BluetoothUUIDDataView, device::BluetoothUUID> { |
98 static std::vector<uint8_t> uuid(const device::BluetoothUUID& input); | 100 static std::vector<uint8_t> uuid(const device::BluetoothUUID& input); |
99 static bool Read(arc::mojom::BluetoothUUIDDataView data, | 101 static bool Read(arc::mojom::BluetoothUUIDDataView data, |
100 device::BluetoothUUID* output); | 102 device::BluetoothUUID* output); |
101 }; | 103 }; |
102 | 104 |
| 105 template <> |
| 106 struct StructTraits<arc::mojom::BluetoothAdvertisementDataView, |
| 107 std::unique_ptr<device::BluetoothAdvertisement::Data>> { |
| 108 static bool Read( |
| 109 arc::mojom::BluetoothAdvertisementDataView advertisement, |
| 110 std::unique_ptr<device::BluetoothAdvertisement::Data>* output); |
| 111 |
| 112 // Dummy methods. |
| 113 static arc::mojom::BluetoothAdvertisementType type( |
| 114 std::unique_ptr<device::BluetoothAdvertisement::Data>& input) { |
| 115 NOTREACHED(); |
| 116 return arc::mojom::BluetoothAdvertisementType::ADV_TYPE_NON_CONNECTABLE; |
| 117 } |
| 118 |
| 119 static bool include_tx_power( |
| 120 std::unique_ptr<device::BluetoothAdvertisement::Data>& input) { |
| 121 NOTREACHED(); |
| 122 return false; |
| 123 } |
| 124 |
| 125 static mojo::Array<arc::mojom::BluetoothAdvertisingDataPtr> data( |
| 126 std::unique_ptr<device::BluetoothAdvertisement::Data>& input) { |
| 127 NOTREACHED(); |
| 128 return mojo::Array<arc::mojom::BluetoothAdvertisingDataPtr>(); |
| 129 } |
| 130 }; |
| 131 |
103 } // namespace mojo | 132 } // namespace mojo |
104 | 133 |
105 #endif // COMPONENTS_ARC_BLUETOOTH_BLUETOOTH_STRUCT_TRAITS_H_ | 134 #endif // COMPONENTS_ARC_BLUETOOTH_BLUETOOTH_STRUCT_TRAITS_H_ |
OLD | NEW |