2 * Copyright (C) 2016 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef WIFI_LEGACY_WIFI_HAL_H_
18 #define WIFI_LEGACY_WIFI_HAL_H_
23 #include <hardware_legacy/wifi_hal.h>
29 namespace implementation {
32 * Class that encapsulates all legacy HAL interactions.
33 * This class manages the lifetime of the event loop thread used by legacy HAL.
38 // Initialize the legacy HAL and start the event looper thread.
40 // Deinitialize the legacy HAL and stop the event looper thread.
41 wifi_error stop(const std::function<void()>& on_complete_callback);
44 // Retrieve the interface handle to be used for the "wlan" interface.
45 wifi_error retrieveWlanInterfaceHandle();
46 // Run the legacy HAL event loop thread.
49 // Event loop thread used by legacy HAL.
50 std::thread event_loop_thread_;
51 // Global function table of legacy HAL.
52 wifi_hal_fn global_func_table_;
53 // Opaque handle to be used for all global operations.
54 wifi_handle global_handle_;
55 // Opaque handle to be used for all wlan0 interface specific operations.
56 wifi_interface_handle wlan_interface_handle_;
57 // Flag to indicate if we have initiated the cleanup of legacy HAL.
58 bool awaiting_event_loop_termination_;
61 } // namespace implementation
64 } // namespace hardware
65 } // namespace android
67 #endif // WIFI_LEGACY_WIFI_HAL_H_