Home | History | Annotate | Download | only in smgr

Lines Matching defs:sensorType

135  * SensorType as used by platform-independent CHRE code. This is useful in
145 SensorType getSensorTypeFromSensorId(uint8_t sensorId, uint8_t dataType,
156 return SensorType::Accelerometer;
158 return SensorType::UncalibratedAccelerometer;
163 return SensorType::Gyroscope;
165 return SensorType::UncalibratedGyroscope;
170 return SensorType::GeomagneticField;
172 return SensorType::UncalibratedGeomagneticField;
176 return SensorType::Pressure;
179 return SensorType::Proximity;
181 return SensorType::StationaryDetect;
183 return SensorType::InstantMotion;
186 return SensorType::VendorType0;
192 return SensorType::AccelerometerTemperature;
195 return SensorType::GyroscopeTemperature;
200 return SensorType::Light;
204 return SensorType::Unknown;
208 * Converts a reportId as provided by SMGR to a SensorType.
211 * @return Returns the sensorType that corresponds to the reportId.
213 SensorType getSensorTypeFromReportId(uint8_t reportId) {
214 SensorType sensorType;
215 if (reportId < static_cast<uint8_t>(SensorType::SENSOR_TYPE_COUNT)) {
216 sensorType = static_cast<SensorType>(reportId);
218 sensorType = SensorType::Unknown;
220 return sensorType;
224 * Converts a PlatformSensor to a unique report ID through SensorType. This is
231 * @return Returns a unique report ID that is based on SensorType.
234 SensorType sensorType = getSensorTypeFromSensorId(
237 CHRE_ASSERT_LOG(sensorType != SensorType::Unknown,
240 return static_cast<uint8_t>(sensorType);
250 SensorType sensorType = getSensorTypeFromReportId(reportId);
251 return (sensorType == SensorType::AccelerometerTemperature
252 || sensorType == SensorType::GyroscopeTemperature);
273 * @param sensorType The sensorType of this sensor.
277 ChreSensorData *allocateLastEvent(SensorType sensorType, size_t *eventSize) {
282 if (sensorTypeIsOnChange(sensorType)) {
283 SensorSampleType sampleType = getSensorSampleTypeFromSensorType(sensorType);
305 FATAL_ERROR("Failed to allocate last event memory for SensorType %d",
306 static_cast<int>(sensorType));
331 SensorType sensorType = getSensorTypeFromSensorId(
333 sensor.minInterval = sensorTypeIsOneShot(sensorType) ?
338 sensor.lastEvent = allocateLastEvent(sensorType, &sensor.lastEventSize);
361 SensorType sensorType, chreSensorDataHeader *header,
372 header->sensorHandle = getSensorHandleFromSensorType(sensorType);
378 SensorType sensorType, chreSensorThreeAxisData *data,
380 populateSensorDataHeader(sensorType, &data->header, sensorIndex);
396 if (sensorType == SensorType::GeomagneticField
397 || sensorType == SensorType::UncalibratedGeomagneticField) {
407 SensorType sensorType, chreSensorFloatData *data,
409 populateSensorDataHeader(sensorType, &data->header, sensorIndex);
424 SensorType sensorType, chreSensorByteData *data,
426 populateSensorDataHeader(sensorType, &data->header, sensorIndex);
444 SensorType sensorType, chreSensorOccurrenceData *data,
446 populateSensorDataHeader(sensorType, &data->header, sensorIndex);
459 * Allocate event memory according to SensorType and populate event readings.
463 SensorType sensorType,
465 SensorSampleType sampleType = getSensorSampleTypeFromSensorType(sensorType);
474 populateThreeAxisEvent(bufferingIndMsg, sensorType, event, sensorIndex);
485 populateFloatEvent(bufferingIndMsg, sensorType, event, sensorIndex);
496 populateByteEvent(bufferingIndMsg, sensorType, event, sensorIndex);
508 bufferingIndMsg, sensorType, event, sensorIndex);
516 bufferingIndMsg, sensorType, sensorIndex,
521 LOGW("Unhandled sensor data %" PRIu8, static_cast<uint8_t>(sensorType));
534 SensorType sensorType = getSensorTypeForSampleEventType(eventType);
535 if (sensorTypeIsOneShot(sensorType)) {
537 .removeAllRequests(sensorType);
569 SensorType sensorType = getSensorTypeFromReportId(
571 if (sensorType == SensorType::Unknown) {
575 LOGW("Received sensorType %d event with 0 sample",
576 static_cast<int>(sensorType));
579 bufferingIndMsg, sensorType, sensorIndex);
589 if (sensorTypeIsOnChange(sensorType)) {
590 updateLastEvent(sensorType, eventData);
594 getSampleEventTypeForSensorType(sensorType), eventData,
636 * @param sensorTypes A non-null pointer to a SensorType array of size at least
640 SensorType *sensorTypes) {
649 sensorTypes[0] = SensorType::Accelerometer;
650 sensorTypes[1] = SensorType::UncalibratedAccelerometer;
651 sensorTypes[2] = SensorType::AccelerometerTemperature;
655 sensorTypes[0] = SensorType::Gyroscope;
656 sensorTypes[1] = SensorType::UncalibratedGyroscope;
657 sensorTypes[2] = SensorType::GyroscopeTemperature;
661 sensorTypes[0] = SensorType::GeomagneticField;
662 sensorTypes[1] = SensorType::UncalibratedGeomagneticField;
665 SensorType sensorType = getSensorTypeFromSensorId(sensorId,
667 if (sensorType != SensorType::Unknown) {
668 sensorTypes[0] = sensorType;
677 * Obtains the merged SensorMode of the specified sensor ID, with sensorType's
681 * @param sensorType The SensorType whose sensor request is to be replaced by
686 SensorMode getMergedMode(uint8_t sensorId, SensorType sensorType,
689 SensorType sensorTypes[kMaxNumSensorsPerSensorId];
700 (sensorTypes[i] == sensorType) ? request : sensor->getRequest());
717 SensorMode mode = getMergedMode(sensorId, SensorType::Unknown, dummyRequest);
1005 SensorType sensorType = getSensorTypeFromSensorId(
1008 if (sensorType != SensorType::Unknown) {
1012 SensorType uncalibratedType = getSensorTypeFromSensorId(
1015 if (sensorType != uncalibratedType) {
1141 * @param sensorType The SensorType of this request
1145 bool isRequestAllowed(SensorType sensorType, const SensorRequest& request) {
1149 ->getSensorRequestManager().getSensor(sensorType);
1157 sensor->sensorId, sensorType, request);
1160 LOGD("sensorType %d allowed %d: mergedMode %d, otherClientPresent %d",
1161 static_cast<size_t>(sensorType), allowed,
1216 * @param sensorType The sensor type of the request.
1220 bool makeRequest(SensorType sensorType, const SensorRequest& request) {
1224 .getSensor(sensorType);
1261 SensorType sensorTypes[kMaxNumSensorsPerSensorId];
1287 SensorType sensorTypes[kMaxNumSensorsPerSensorId];
1435 bool passiveLight = (getSensorType() == SensorType::Light
1456 SensorType PlatformSensor::getSensorType() const {