1/*
2 * Copyright 2015, The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *     http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/**
18 * Binder IPC interface for receiving callbacks related to Bluetooth Low Energy
19 * operations.
20 */
21oneway interface IBluetoothLowEnergyCallback {
22  /**
23   * Called to report the result of a call to
24   * IBluetoothLowEnergy.registerClient. |status| will be BLE_STATUS_SUCCESS (0)
25   * if the client was successfully registered. |client_if| is the owning
26   * application's unique Low Energy client handle and can be used
27   * to perform further operations on the IBluetoothLowEnergy interface.
28   */
29  void onClientRegistered(in int status, in int client_if);
30
31  /* Called asynchronously to notify the delegate of connection state change.
32   */
33  void OnConnectionState(in int status, in int client_id, in const char* address,
34                         in bool connected);
35
36  /* Called to report current MTU value. Can be a result of calling
37   * IBluetoothLowEnergy.setMtu or remote device trying to change MTU.
38   */
39  void OnMtuChanged(in int status, in const char* address, in int mtu);
40
41  /**
42   * Called to report BLE device scan results once a scan session is started for
43   * this client using IBluetoothLowEnergy.startScan. |scan_result| contains all
44   * the data related to the discovered BLE device.
45   */
46  void onScanResult(in ScanResult scan_result);
47
48  /**
49   * Called to report the result of a call to
50   * IBluetoothLowEnergy.startMultiAdvertising or stopMultiAdvertising.
51   */
52  void onMultiAdvertiseCallback(in int status, in boolean is_start,
53                                in AdvertiseSettings settings);
54}
55