Home | History | Annotate | Download | only in core

Lines Matching refs:sensorType

35  * This SensorType is designed to wrap constants provided by the CHRE API
41 enum class SensorType {
77 * This SensorSampleType is designed to help classify SensorType's data type in
94 * @param sensorType The sensor type to obtain a string for.
97 const char *getSensorTypeName(SensorType sensorType);
101 * must not be SensorType::Unknown. This is a fatal error.
103 * @param sensorType The type of the sensor.
106 uint16_t getSampleEventTypeForSensorType(SensorType sensorType);
114 SensorType getSensorTypeForSampleEventType(uint16_t eventType);
119 * SensorType except for Unknown starting from zero to the maximum value sensor
122 constexpr size_t getSensorTypeArrayIndex(SensorType sensorType) {
123 return static_cast<size_t>(sensorType) - 1;
127 * @return The number of valid sensor types in the SensorType enum.
130 // The number of valid entries in the SensorType enum (not including Unknown).
131 return static_cast<size_t>(SensorType::SENSOR_TYPE_COUNT) - 1;
136 * SensorType. If the integer sensor type does not match one of the internal
137 * sensor types, SensorType::Unknown is returned.
139 * @param sensorType The integer sensor type.
140 * @return The strongly-typed sensor if a match is found or SensorType::Unknown.
142 SensorType getSensorTypeFromUnsignedInt(uint8_t sensorType);
145 * Translates a SensorType to an unsigned integer as provided by CHRE API. If
146 * the sensor type is SensorType::Unknown, 0 is returned.
148 * @param sensorType The strongly-typed sensor.
149 * @return The integer sensor type if sensorType is not SensorType::Unknown.
151 uint8_t getUnsignedIntFromSensorType(SensorType sensorType);
156 * API is not expected to be called with SensorType::Unknown as nanoapps are not
159 * @param sensorType The type of the sensor to obtain a handle for.
162 constexpr uint32_t getSensorHandleFromSensorType(SensorType sensorType) {
163 return static_cast<uint32_t>(sensorType);
167 * Maps a sensor handle to a SensorType or returns SensorType::Unknown if the
173 constexpr SensorType getSensorTypeFromSensorHandle(uint32_t handle) {
174 return (handle > static_cast<uint32_t>(SensorType::Unknown)
175 && handle < static_cast<uint32_t>(SensorType::SENSOR_TYPE_COUNT))
176 ? static_cast<SensorType>(handle) : SensorType::Unknown;
182 * @param sensorType The sensor type to obtain its temperature sensor type for.
183 * @return The temperature sensor type or SensorType::Unknown if not supported
186 SensorType getTempSensorType(SensorType sensorType);
189 * Maps a sensorType to its SensorSampleType.
191 * @param sensorType The type of the sensor to obtain its SensorSampleType for.
192 * @return The SensorSampleType of the sensorType.
194 SensorSampleType getSensorSampleTypeFromSensorType(SensorType sensorType);
256 * @param sensorType The sensor type of the sensor.
259 bool sensorTypeIsOneShot(SensorType sensorType);
264 * @param sensorType The sensor type of the sensor.
267 bool sensorTypeIsOnChange(SensorType sensorType);
272 * @param sensorType The sensor type of the sensor.
275 bool sensorTypeIsContinuous(SensorType sensorType);