blob: 34bd13d164f560dc72483f6bd8c0337c5715ad7d [file] [log] [blame]
// Copyright 2022 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@available(added=10)
library fuchsia.bluetooth.fastpair;
using fuchsia.bluetooth;
using zx;
/// Represents an active Fast Pair Provider service. The lifetime of the service is tied to this
/// protocol.
///
/// Closing the protocol disables the service.
///
/// The system may close the protocol to communicate that the service was terminated
/// for internal reasons.
closed protocol ProviderWatcher {
/// Called if the Fast Pair pairing procedure for a peer is successfully complete.
///
/// + request `id` The unique ID associated with the connected Fast Pair Seeker peer.
/// - response Each `OnPairingComplete` request should be acknowledged.
strict OnPairingComplete(struct {
id fuchsia.bluetooth.PeerId;
}) -> ();
};
/// Protocol to enable the Bluetooth Fast Pair Provider service on the system.
@discoverable
closed protocol Provider {
/// Request to enable the Fast Pair Provider service.
///
/// Only one client can register to enable the Fast Pair service. An Error will be returned
/// for subsequent requests.
///
/// The lifetime of the service is tied to the provided `watcher`. To disable Fast Pair
/// functionality, close the `watcher`.
///
/// + request `watcher` The client end of the ProviderWatcher which determines the lifetime of
/// the Fast Pair service.
/// - response An empty response will be sent when the server has processed the
/// request.
/// * error Returns `ALREADY_BOUND` if a subsequent request is made to enable
/// the service.
strict Enable(resource struct {
watcher client_end:ProviderWatcher;
}) -> () error zx.Status;
};