Lines Matching refs:dst

67 void convertToSensor(const SensorInfo& src, sensor_t* dst) {  in convertToSensor()  argument
68 dst->name = strdup(src.name.c_str()); in convertToSensor()
69 dst->vendor = strdup(src.vendor.c_str()); in convertToSensor()
70 dst->version = src.version; in convertToSensor()
71 dst->handle = src.sensorHandle; in convertToSensor()
72 dst->type = (int)src.type; in convertToSensor()
73 dst->maxRange = src.maxRange; in convertToSensor()
74 dst->resolution = src.resolution; in convertToSensor()
75 dst->power = src.power; in convertToSensor()
76 dst->minDelay = src.minDelayUs; in convertToSensor()
77 dst->fifoReservedEventCount = src.fifoReservedEventCount; in convertToSensor()
78 dst->fifoMaxEventCount = src.fifoMaxEventCount; in convertToSensor()
79 dst->stringType = strdup(src.typeAsString.c_str()); in convertToSensor()
80 dst->requiredPermission = strdup(src.requiredPermission.c_str()); in convertToSensor()
81 dst->maxDelay = src.maxDelayUs; in convertToSensor()
82 dst->flags = src.flags; in convertToSensor()
83 dst->reserved[0] = dst->reserved[1] = 0; in convertToSensor()
86 void convertToSensorEvent(const Event& src, sensors_event_t* dst) { in convertToSensorEvent() argument
87 *dst = {.version = sizeof(sensors_event_t), in convertToSensorEvent()
97 dst->meta_data.what = (int32_t)src.payload.get<Event::EventPayload::meta>().what; in convertToSensorEvent()
98 dst->meta_data.sensor = src.sensorHandle; in convertToSensorEvent()
100 dst->sensor = 0; in convertToSensorEvent()
110 dst->acceleration.x = src.payload.get<Event::EventPayload::vec3>().x; in convertToSensorEvent()
111 dst->acceleration.y = src.payload.get<Event::EventPayload::vec3>().y; in convertToSensorEvent()
112 dst->acceleration.z = src.payload.get<Event::EventPayload::vec3>().z; in convertToSensorEvent()
113 dst->acceleration.status = (int32_t)src.payload.get<Event::EventPayload::vec3>().status; in convertToSensorEvent()
118 dst->data[0] = src.payload.get<Event::EventPayload::vec4>().x; in convertToSensorEvent()
119 dst->data[1] = src.payload.get<Event::EventPayload::vec4>().y; in convertToSensorEvent()
120 dst->data[2] = src.payload.get<Event::EventPayload::vec4>().z; in convertToSensorEvent()
121 dst->data[3] = src.payload.get<Event::EventPayload::vec4>().w; in convertToSensorEvent()
127 dst->data[0] = src.payload.get<Event::EventPayload::data>().values[0]; in convertToSensorEvent()
128 dst->data[1] = src.payload.get<Event::EventPayload::data>().values[1]; in convertToSensorEvent()
129 dst->data[2] = src.payload.get<Event::EventPayload::data>().values[2]; in convertToSensorEvent()
130 dst->data[3] = src.payload.get<Event::EventPayload::data>().values[3]; in convertToSensorEvent()
131 dst->data[4] = src.payload.get<Event::EventPayload::data>().values[4]; in convertToSensorEvent()
138 dst->uncalibrated_gyro.x_uncalib = src.payload.get<Event::EventPayload::uncal>().x; in convertToSensorEvent()
139 dst->uncalibrated_gyro.y_uncalib = src.payload.get<Event::EventPayload::uncal>().y; in convertToSensorEvent()
140 dst->uncalibrated_gyro.z_uncalib = src.payload.get<Event::EventPayload::uncal>().z; in convertToSensorEvent()
141 dst->uncalibrated_gyro.x_bias = src.payload.get<Event::EventPayload::uncal>().xBias; in convertToSensorEvent()
142 dst->uncalibrated_gyro.y_bias = src.payload.get<Event::EventPayload::uncal>().yBias; in convertToSensorEvent()
143 dst->uncalibrated_gyro.z_bias = src.payload.get<Event::EventPayload::uncal>().zBias; in convertToSensorEvent()
165 dst->data[0] = src.payload.get<Event::EventPayload::scalar>(); in convertToSensorEvent()
170 dst->u64.step_counter = src.payload.get<Event::EventPayload::stepCount>(); in convertToSensorEvent()
175 dst->heart_rate.bpm = src.payload.get<Event::EventPayload::heartRate>().bpm; in convertToSensorEvent()
176 dst->heart_rate.status = in convertToSensorEvent()
183 dst->data[i] = src.payload.get<Event::EventPayload::pose6DOF>().values[i]; in convertToSensorEvent()
189 dst->dynamic_sensor_meta.connected = in convertToSensorEvent()
191 dst->dynamic_sensor_meta.handle = in convertToSensorEvent()
193 dst->dynamic_sensor_meta.sensor = NULL; // to be filled in later in convertToSensorEvent()
195 memcpy(dst->dynamic_sensor_meta.uuid, in convertToSensorEvent()
204 additional_info_event_t* dstInfo = &dst->additional_info; in convertToSensorEvent()
235 dst->head_tracker.rx = ht.rx; in convertToSensorEvent()
236 dst->head_tracker.ry = ht.ry; in convertToSensorEvent()
237 dst->head_tracker.rz = ht.rz; in convertToSensorEvent()
238 dst->head_tracker.vx = ht.vx; in convertToSensorEvent()
239 dst->head_tracker.vy = ht.vy; in convertToSensorEvent()
240 dst->head_tracker.vz = ht.vz; in convertToSensorEvent()
241 dst->head_tracker.discontinuity_count = ht.discontinuityCount; in convertToSensorEvent()
247 dst->limited_axes_imu.x = src.payload.get<Event::EventPayload::limitedAxesImu>().x; in convertToSensorEvent()
248 dst->limited_axes_imu.y = src.payload.get<Event::EventPayload::limitedAxesImu>().y; in convertToSensorEvent()
249 dst->limited_axes_imu.z = src.payload.get<Event::EventPayload::limitedAxesImu>().z; in convertToSensorEvent()
250 dst->limited_axes_imu.x_supported = in convertToSensorEvent()
252 dst->limited_axes_imu.y_supported = in convertToSensorEvent()
254 dst->limited_axes_imu.z_supported = in convertToSensorEvent()
260 dst->limited_axes_imu_uncalibrated.x_uncalib = in convertToSensorEvent()
262 dst->limited_axes_imu_uncalibrated.y_uncalib = in convertToSensorEvent()
264 dst->limited_axes_imu_uncalibrated.z_uncalib = in convertToSensorEvent()
266 dst->limited_axes_imu_uncalibrated.x_bias = in convertToSensorEvent()
268 dst->limited_axes_imu_uncalibrated.y_bias = in convertToSensorEvent()
270 dst->limited_axes_imu_uncalibrated.z_bias = in convertToSensorEvent()
272 dst->limited_axes_imu_uncalibrated.x_supported = in convertToSensorEvent()
274 dst->limited_axes_imu_uncalibrated.y_supported = in convertToSensorEvent()
276 dst->limited_axes_imu_uncalibrated.z_supported = in convertToSensorEvent()
281 dst->heading.heading = src.payload.get<Event::EventPayload::heading>().heading; in convertToSensorEvent()
282 dst->heading.accuracy = src.payload.get<Event::EventPayload::heading>().accuracy; in convertToSensorEvent()
288 memcpy(dst->data, src.payload.get<Event::EventPayload::data>().values.data(), in convertToSensorEvent()
295 void convertFromSensorEvent(const sensors_event_t& src, Event* dst) { in convertFromSensorEvent() argument
296 *dst = { in convertFromSensorEvent()
302 switch (dst->sensorType) { in convertFromSensorEvent()
309 dst->sensorHandle = src.meta_data.sensor; in convertFromSensorEvent()
310 dst->payload.set<Event::EventPayload::Tag::meta>(meta); in convertFromSensorEvent()
325 dst->payload.set<Event::EventPayload::Tag::vec3>(vec3); in convertFromSensorEvent()
335 dst->payload.set<Event::EventPayload::Tag::vec4>(vec4); in convertFromSensorEvent()
343 dst->payload.set<Event::EventPayload::Tag::data>(data); in convertFromSensorEvent()
357 dst->payload.set<Event::EventPayload::Tag::uncal>(uncal); in convertFromSensorEvent()
379 dst->payload.set<Event::EventPayload::Tag::scalar>((float)src.data[0]); in convertFromSensorEvent()
384 dst->payload.set<Event::EventPayload::Tag::stepCount>(src.u64.step_counter); in convertFromSensorEvent()
392 dst->payload.set<Event::EventPayload::Tag::heartRate>(heartRate); in convertFromSensorEvent()
401 dst->payload.set<Event::EventPayload::Tag::pose6DOF>(pose6DOF); in convertFromSensorEvent()
411 dst->payload.set<Event::EventPayload::Tag::dynamic>(dynamic); in convertFromSensorEvent()
426 dst->payload.set<Event::EventPayload::Tag::additional>(info); in convertFromSensorEvent()
440 dst->payload.set<Event::EventPayload::Tag::headTracker>(headTracker); in convertFromSensorEvent()
453 dst->payload.set<Event::EventPayload::Tag::limitedAxesImu>(limitedAxesImu); in convertFromSensorEvent()
469 dst->payload.set<Event::EventPayload::Tag::limitedAxesImuUncal>(limitedAxesImuUncal); in convertFromSensorEvent()
477 dst->payload.set<Event::EventPayload::heading>(heading); in convertFromSensorEvent()
482 CHECK_GE((int32_t)dst->sensorType, (int32_t)SensorType::DEVICE_PRIVATE_BASE); in convertFromSensorEvent()
486 dst->payload.set<Event::EventPayload::Tag::data>(data); in convertFromSensorEvent()
492 void convertFromASensorEvent(const ASensorEvent& src, Event* dst) { in convertFromASensorEvent() argument
493 convertFromSensorEvent(common::convertASensorEvent(src), dst); in convertFromASensorEvent()