• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2016 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 #include "chre/platform/platform_sensor.h"
18 
19 namespace chre {
20 
PlatformSensor(PlatformSensor && other)21 PlatformSensor::PlatformSensor(PlatformSensor&& other) {
22   *this = std::move(other);
23 }
24 
~PlatformSensor()25 PlatformSensor::~PlatformSensor() {}
26 
init()27 void PlatformSensor::init() {
28   // TODO: Implement this. Probably we would open some files provided to mock
29   // sensor data. Perhaps from command-line arguemnts.
30 }
31 
deinit()32 void PlatformSensor::deinit() {
33   // TODO: Implement this. Probably we would close the files opened previously
34   // by init.
35 }
36 
getSensors(DynamicVector<Sensor> * sensors)37 bool PlatformSensor::getSensors(DynamicVector<Sensor> *sensors) {
38   CHRE_ASSERT(sensors);
39 
40   // TODO: Implement this. Perhaps look at all sensor trace files provided and
41   // return the list of sensor data available.
42   return false;
43 }
44 
applyRequest(const SensorRequest & request)45 bool PlatformSensor::applyRequest(const SensorRequest& request) {
46   // TODO: Implement this. Perhaps consider the request and start to pass in
47   // sensor samples from mock sensor data once the sensor has transitioned to
48   // being enabled. Maybe consider resampling input data if the provided mock
49   // data rate is higher than requested.
50   return false;
51 }
52 
flushAsync()53 bool PlatformSensor::flushAsync() {
54   // TODO: Implement this
55   return false;
56 }
57 
getSensorType() const58 SensorType PlatformSensor::getSensorType() const {
59   // TODO: Implement this.
60   return SensorType::Unknown;
61 }
62 
getMinInterval() const63 uint64_t PlatformSensor::getMinInterval() const {
64   // TODO: Implement this.
65   return 0;
66 }
67 
getSensorName() const68 const char *PlatformSensor::getSensorName() const {
69   // TODO: Implement this.
70   return "";
71 }
72 
operator =(PlatformSensor && other)73 PlatformSensor& PlatformSensor::operator=(PlatformSensor&& other) {
74   // TODO: Implement this.
75   return *this;
76 }
77 
getLastEvent() const78 ChreSensorData *PlatformSensor::getLastEvent() const {
79   // TODO: Implement this.
80   return nullptr;
81 }
82 
getSamplingStatus(struct chreSensorSamplingStatus * status) const83 bool PlatformSensor::getSamplingStatus(
84     struct chreSensorSamplingStatus *status) const {
85   // TODO: Implement this.
86   return false;
87 }
88 
getThreeAxisBias(struct chreSensorThreeAxisData * bias) const89 bool PlatformSensor::getThreeAxisBias(
90     struct chreSensorThreeAxisData *bias) const {
91   // TODO: Implement this.
92   return false;
93 }
94 
setLastEvent(const ChreSensorData * event)95 void PlatformSensorBase::setLastEvent(const ChreSensorData *event) {
96   // TODO: Implement this.
97 }
98 
99 }  // namespace chre
100