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

Side by Side Diff: device/bluetooth/public/interfaces/gatt_result_enum_traits.cc

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, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "device/bluetooth/public/interfaces/gatt_result_enum_traits.h"
6
7 namespace mojo {
8
9 // static
10 bluetooth::mojom::GattResult
11 EnumTraits<bluetooth::mojom::GattResult,
12 device::BluetoothGattService::GattErrorCode>::
13 ToMojom(const device::BluetoothGattService::GattErrorCode& input) {
14 switch (input) {
15 case device::BluetoothGattService::GattErrorCode::GATT_ERROR_UNKNOWN:
16 return bluetooth::mojom::GattResult::UNKNOWN;
17 case device::BluetoothGattService::GattErrorCode::GATT_ERROR_FAILED:
18 return bluetooth::mojom::GattResult::FAILED;
19 case device::BluetoothGattService::GattErrorCode::GATT_ERROR_IN_PROGRESS:
20 return bluetooth::mojom::GattResult::IN_PROGRESS;
21 case device::BluetoothGattService::GattErrorCode::GATT_ERROR_INVALID_LENGTH:
22 return bluetooth::mojom::GattResult::INVALID_LENGTH;
23 case device::BluetoothGattService::GattErrorCode::GATT_ERROR_NOT_PERMITTED:
24 return bluetooth::mojom::GattResult::NOT_PERMITTED;
25 case device::BluetoothGattService::GattErrorCode::GATT_ERROR_NOT_AUTHORIZED:
26 return bluetooth::mojom::GattResult::NOT_AUTHORIZED;
27 case device::BluetoothGattService::GattErrorCode::GATT_ERROR_NOT_PAIRED:
28 return bluetooth::mojom::GattResult::NOT_PAIRED;
29 case device::BluetoothGattService::GattErrorCode::GATT_ERROR_NOT_SUPPORTED:
30 return bluetooth::mojom::GattResult::NOT_SUPPORTED;
31 }
32 NOTREACHED();
33 return bluetooth::mojom::GattResult::NOT_SUPPORTED;
34 }
35
36 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698