OLD | NEW |
(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 |
OLD | NEW |