Android-cuttlefish cvd tool
sensors_hal_proxy.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2025 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 <atomic>
20#include <mutex>
21#include <thread>
22
28
29namespace cuttlefish {
30namespace sensors {
31
33 public:
34 SensorsHalProxy(transport::Channel& control_channel,
35 transport::Channel& data_channel, SharedFD kernel_events_fd,
36 SensorsSimulator& sensors_simulator, DeviceType device_type);
37
38 private:
40
48 std::atomic<bool> hal_activated_ = false;
49 std::atomic<bool> running_ = true;
50 std::mutex report_mtx_;
51};
52
53} // namespace sensors
54} // namespace cuttlefish
Definition: shared_fd.h:125
Definition: sensors_hal_proxy.h:32
SensorsHalProxy(transport::Channel &control_channel, transport::Channel &data_channel, SharedFD kernel_events_fd, SensorsSimulator &sensors_simulator, DeviceType device_type)
Definition: sensors_hal_proxy.cpp:181
void ReportToGuest(SensorsMask mask)
Definition: sensors_hal_proxy.cpp:225
std::atomic< bool > hal_activated_
Definition: sensors_hal_proxy.h:48
std::thread reboot_monitor_thread_
Definition: sensors_hal_proxy.h:43
SharedFD kernel_events_fd_
Definition: sensors_hal_proxy.h:46
std::thread req_responder_thread_
Definition: sensors_hal_proxy.h:41
std::mutex report_mtx_
Definition: sensors_hal_proxy.h:50
transport::Channel & data_channel_
Definition: sensors_hal_proxy.h:45
std::atomic< bool > running_
Definition: sensors_hal_proxy.h:49
SensorsSimulator & sensors_simulator_
Definition: sensors_hal_proxy.h:47
std::thread data_reporter_thread_
Definition: sensors_hal_proxy.h:42
transport::Channel & control_channel_
Definition: sensors_hal_proxy.h:44
Definition: sensors_simulator.h:38
Definition: channel.h:66
int SensorsMask
Definition: sensors.h:51
Definition: alloc_driver.h:21
DeviceType
Definition: device_type.h:25
__u32 mask
Definition: nl80211.h:0