1 /*
2  * Copyright 2020 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 #pragma once
18 
19 #include "hci/address_with_type.h"
20 #include "hci/hci_packets.h"
21 
22 namespace bluetooth {
23 namespace hci {
24 namespace acl_manager {
25 
26 /// @brief These are callbacks needed to track the state of the acceptlist, used by the
27 /// Rust connection manager.
28 class LeAcceptlistCallbacks {
29 public:
30   virtual ~LeAcceptlistCallbacks() = default;
31   // Invoked when controller sends Connection Complete event with Success error code
32   // AddressWithType is the address returned by the controller.
33   virtual void OnLeConnectSuccess(AddressWithType) = 0;
34   // Invoked when controller sends Connection Complete event with failing error code
35   // AddressWithType is the address returned by the controller.
36   virtual void OnLeConnectFail(AddressWithType, ErrorCode reason) = 0;
37   // Invoked when an LE connection is disconnected. AddressWithType is the remote address
38   // associated with this connection at the time of connection.
39   virtual void OnLeDisconnection(AddressWithType) = 0;
40   // Invoked when the resolving list has changed, so we need to re-resolve our addresses.
41   virtual void OnResolvingListChange() = 0;
42 };
43 
44 }  // namespace acl_manager
45 }  // namespace hci
46 }  // namespace bluetooth
47