[sensors] Minor tuning of hal definition
* Swap GEOMAGNETIC_FIELD with MAGNETIC_FIELD for more accurate
definition.
* Remove redundunt prefixes in various enum definitions.
* Clarify that string type will be removed for well defined sensor
types. This avoid dependency on strings defined in sensors.h.
* Added SensorFlagShift enum.
* Remove unused flag parameter in batch.
* Remove legacy setDelay function.
* Change the type of sensor flag to bitfield<SensorFlagBits>, and
use uint32_t since only low 32 bits are used.
Test: all sensor works(in marlin), tested with sensorlogger.
Change-Id: I93a4d13c5d2e054857d1e400d15002aeb9a47368
diff --git a/sensors/1.0/default/Sensors.cpp b/sensors/1.0/default/Sensors.cpp
index f9f1ca6..8903397 100644
--- a/sensors/1.0/default/Sensors.cpp
+++ b/sensors/1.0/default/Sensors.cpp
@@ -142,15 +142,6 @@
enabled));
}
-Return<Result> Sensors::setDelay(
- int32_t sensor_handle, int64_t sampling_period_ns) {
- return ResultFromStatus(
- mSensorDevice->setDelay(
- reinterpret_cast<sensors_poll_device_t *>(mSensorDevice),
- sensor_handle,
- sampling_period_ns));
-}
-
Return<void> Sensors::poll(int32_t maxCount, poll_cb _hidl_cb) {
hidl_vec<Event> out;
hidl_vec<SensorInfo> dynamicSensorsAdded;
@@ -206,14 +197,13 @@
Return<Result> Sensors::batch(
int32_t sensor_handle,
- int32_t flags,
int64_t sampling_period_ns,
int64_t max_report_latency_ns) {
return ResultFromStatus(
mSensorDevice->batch(
mSensorDevice,
sensor_handle,
- flags,
+ 0, /*flags*/
sampling_period_ns,
max_report_latency_ns));
}