blob: e8d5bef9e1466bf8dc91e89c076acd6f556c881d [file] [log] [blame]
// Copyright 2018 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.
library fuchsia.bluetooth.bredr;
using fuchsia.bluetooth;
// Possible security levels for services.
// See BT spec v5.0, Vol 3, Part C, Section 5.2.2.8 for detailed descriptions.
enum SecurityLevel {
NONE = 0; // Only allowed for specific services.
ENCRYPTION_OPTIONAL = 1; // MITM protection not required, min user interaction
ENCRYPTION_REQUIRED = 2; // Encryption required, MITM protection not required
MITM_PROTECTED = 3; // MITM Protection & Encryption required. Interaction okay
HIGH_STRENGTH = 4; // 128-bit or equivalent key required using FIPS algorithms
};
[Discoverable]
interface Profile {
// Register a service. This service will be registered and discoverable with
// the Service Discovery Protocol server.
// The |security_level| provided here will be required before a connection is
// established.
// If |devices| is true, connections to the service's channels will create a
// device instead of producing an OnConnected event.
// Returns |status| for success or error.
// If successful, a unique |service_id| is returned to identify this service.
1: AddService(ServiceDefinition definition, SecurityLevel sec_level,
bool devices) ->
(fuchsia.bluetooth.Status status, uint64 service_id);
// Disconnects all channels associated with |device_id| from a service
// specified by |service_id|.
2: DisconnectClient(string device_id, uint64 service_id);
// Removes a previously-registered service, disconnecting all clients.
3: RemoveService(uint64 service_id);
// Produced when a protocol channel is connected for this profile.
// |channel| contains the channel connected to, and information about the
// protocol is provided in |protocol|. All protocols supported internally will
// be handled, for example an RFCOMM socket will be provided instead of an
// L2CAP socket if the services protocol descriptor includes it.
101: -> OnConnected(string device_id, uint64 service_id,
handle<socket> channel, ProtocolDescriptor protocol);
// Produced when a remote device disconnects or is disconnected from a added
// service.
102: -> OnDisconnected(string device_id, uint64 service_id);
};