实现获取光敏值的接口

onereq
Matthew 2 months ago
parent 991fc0a449
commit f247a6f4e0

@ -1292,6 +1292,17 @@ float CPhoneDevice::QueryBattaryVoltage(int timesForAvg, bool* isCharging)
return (matched > 0) ? ((float)totalVals / 1000.0 / matched) : 0; return (matched > 0) ? ((float)totalVals / 1000.0 / matched) : 0;
} }
uint32_t CPhoneDevice::QueryLdr()
{
int val = GpioControl::getLightAdc();
if (val > 0)
{
return static_cast<uint32_t>(val);
}
return 0;
}
bool CPhoneDevice::RequestPosition() bool CPhoneDevice::RequestPosition()
{ {
JNIEnv* env = NULL; JNIEnv* env = NULL;

@ -235,6 +235,7 @@ public:
virtual bool Reboot(int resetType, bool manually, const std::string& reason, uint32_t timeout = 1000); virtual bool Reboot(int resetType, bool manually, const std::string& reason, uint32_t timeout = 1000);
virtual bool EnableGPS(bool enabled); virtual bool EnableGPS(bool enabled);
virtual float QueryBattaryVoltage(int timesForAvg, bool* isCharging); virtual float QueryBattaryVoltage(int timesForAvg, bool* isCharging);
virtual uint32_t QueryLdr();
virtual bool RequestPosition(); virtual bool RequestPosition();
virtual timer_uid_t RegisterHeartbeat(unsigned int timerType, unsigned int timeout, time_t tsForNextPhoto); virtual timer_uid_t RegisterHeartbeat(unsigned int timerType, unsigned int timeout, time_t tsForNextPhoto);
virtual bool TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector<OSD_INFO>& osds, const std::string& path); virtual bool TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector<OSD_INFO>& osds, const std::string& path);

Loading…
Cancel
Save