1// Copyright 2023 The Fuchsia 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.
45use fidl_fuchsia_bluetooth_hfp::CallDirection as FidlCallDirection;
67/// The direction of call initiation.
8#[derive(Debug, PartialEq, Clone, Copy)]
9pub enum Direction {
10/// Call originated on this device. This is also known as an Outgoing call.
11MobileOriginated,
12/// Call is terminated on this device. This is also known as an Incoming call.
13MobileTerminated,
14}
1516impl From<FidlCallDirection> for Direction {
17fn from(x: FidlCallDirection) -> Self {
18match x {
19 FidlCallDirection::MobileOriginated => Self::MobileOriginated,
20 FidlCallDirection::MobileTerminated => Self::MobileTerminated,
21 }
22 }
23}
2425impl From<Direction> for i64 {
26fn from(x: Direction) -> Self {
27match x {
28 Direction::MobileOriginated => 0,
29 Direction::MobileTerminated => 1,
30 }
31 }
32}