fuchsia_bluetooth/expectation/
peer.rs

1// Copyright 2020 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.
4
5//! Expectations for Bluetooth Peers (i.e. Remote Devices)
6
7use fidl_fuchsia_bluetooth_sys::TechnologyType;
8
9use crate::expectation::Predicate;
10use crate::over;
11use crate::types::{Address, Peer, PeerId};
12
13pub fn name(expected_name: &str) -> Predicate<Peer> {
14    over!(Peer: name, Predicate::equal(Some(expected_name.to_string())))
15}
16pub fn identifier(expected_ident: PeerId) -> Predicate<Peer> {
17    over!(Peer: id, Predicate::equal(expected_ident))
18}
19pub fn address(expected_address: Address) -> Predicate<Peer> {
20    over!(Peer: address, Predicate::equal(expected_address))
21}
22pub fn technology(tech: TechnologyType) -> Predicate<Peer> {
23    over!(Peer: technology, Predicate::equal(tech))
24}
25pub fn connected(connected: bool) -> Predicate<Peer> {
26    over!(Peer: connected, Predicate::equal(connected))
27}
28pub fn bonded(bonded: bool) -> Predicate<Peer> {
29    over!(Peer: bonded, Predicate::equal(bonded))
30}