Signed-off-by: hmz007 <hmz007@gmail.com> Change-Id: Ib87fdbe7a0be7dc961af3500fe9ea4589a127f9f
39 lines
783 B
C++
39 lines
783 B
C++
/*
|
|
* Copyright 2024 Rockchip Electronics Co., Ltd
|
|
*/
|
|
#ifndef ANDROID_PROXIMITY_SENSOR_H
|
|
#define ANDROID_PROXIMITY_SENSOR_H
|
|
|
|
#pragma once
|
|
|
|
#include <aidl/android/hardware/sensors/BnSensors.h>
|
|
|
|
#include "Sensor.h"
|
|
|
|
namespace aidl {
|
|
namespace android {
|
|
namespace hardware {
|
|
namespace sensors {
|
|
|
|
class ProximitySensor : public Sensor {
|
|
public:
|
|
ProximitySensor(int32_t sensorHandle, ISensorsEventCallback* callback);
|
|
|
|
protected:
|
|
float mCurEventData;
|
|
float mLastEventData;
|
|
|
|
virtual void readEventPayload(EventPayload& payload) override;
|
|
virtual void driverActivate(bool enable) override;
|
|
virtual void driverSetDelay(int64_t samplingPeriodNs) override;
|
|
|
|
void processEvent(int code, int value);
|
|
};
|
|
|
|
} // sensors
|
|
} // hardware
|
|
} // android
|
|
} // aidl
|
|
|
|
#endif
|