• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef ANDROID_DVR_SENSOR_CLIENT_H_
2 #define ANDROID_DVR_SENSOR_CLIENT_H_
3 
4 #include <hardware/sensors.h>
5 #include <pdx/client.h>
6 #include <poll.h>
7 
8 namespace android {
9 namespace dvr {
10 
11 // SensorClient is a remote interface to the sensor service in sensord.
12 class SensorClient : public pdx::ClientBase<SensorClient> {
13  public:
14   ~SensorClient();
15 
16   int StartSensor();
17   int StopSensor();
18   int Poll(sensors_event_t* events, int max_count);
19 
20  private:
21   friend BASE;
22 
23   // Set up a channel associated with the sensor of the indicated type.
24   // NOTE(segal): If our hardware ends up with multiple sensors of the same
25   // type, we'll have to change this.
26   explicit SensorClient(int sensor_type);
27 
28   int sensor_type_;
29 
30   SensorClient(const SensorClient&);
31   SensorClient& operator=(const SensorClient&);
32 };
33 
34 }  // namespace dvr
35 }  // namespace android
36 
37 #endif  // ANDROID_DVR_SENSOR_CLIENT_H_
38