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