• Home
  • Raw
  • Download

Lines Matching refs:data

108   SeeDataArg *data;  member
177 auto *data = static_cast<const SeeBufArg *>(*arg); in copyPayload() local
181 stream, static_cast<const pb_byte_t *>(data->buf), data->bufLen)) { in copyPayload()
244 SeeBufArg data = { in encodeSnsSuidReq() local
250 .data_type.arg = &data, in encodeSnsSuidReq()
344 UniquePtr<sns_client_request_msg> *msg, SeeBufArg *data) { in prepSnsClientReq() argument
347 CHRE_ASSERT(data); in prepSnsClientReq()
357 data->buf = payload, in prepSnsClientReq()
358 data->bufLen = payloadLen, in prepSnsClientReq()
367 req->request.payload.arg = data; in prepSnsClientReq()
381 auto *data = static_cast<SeeBufArg *>(*arg); in decodeStringField() local
382 data->bufLen = stream->bytes_left; in decodeStringField()
383 data->buf = stream->state; in decodeStringField()
416 SeeBufArg data; in decodeSnsSuidEvent() local
420 .data_type.arg = &data, in decodeSnsSuidEvent()
440 static_cast<const char *>(data.buf), in decodeSnsSuidEvent()
441 std::min(data.bufLen, kSeeAttrStrValLen)) != 0) { in decodeSnsSuidEvent()
553 auto data = MakeUniqueZeroFill<DecodeData>(); in decodeSnsStdAttrValue() local
555 if (data.isNull()) { in decodeSnsStdAttrValue()
558 data->value.str.funcs.decode = decodeStringField; in decodeSnsStdAttrValue()
559 data->value.str.arg = &data->strData; in decodeSnsStdAttrValue()
560 data->value.subtype.values.funcs.decode = decodeSnsStdAttrValue; in decodeSnsStdAttrValue()
561 data->value.subtype.values.arg = &data->subtypeAttrArg; in decodeSnsStdAttrValue()
563 success = pb_decode(stream, sns_std_attr_value_data_fields, &data->value); in decodeSnsStdAttrValue()
568 if (data->value.has_flt) { in decodeSnsStdAttrValue()
576 if (data->value.flt < attrVal->fltMin) { in decodeSnsStdAttrValue()
577 attrVal->fltMin = data->value.flt; in decodeSnsStdAttrValue()
579 if (data->value.flt > attrVal->fltMax) { in decodeSnsStdAttrValue()
580 attrVal->fltMax = data->value.flt; in decodeSnsStdAttrValue()
582 } else if (data->value.has_sint) { in decodeSnsStdAttrValue()
583 attrVal->int64 = data->value.sint; in decodeSnsStdAttrValue()
584 } else if (data->value.has_boolean) { in decodeSnsStdAttrValue()
585 attrVal->boolVal = data->value.boolean; in decodeSnsStdAttrValue()
586 } else if (data->strData.buf != nullptr) { in decodeSnsStdAttrValue()
587 strlcpy(attrVal->strVal, static_cast<const char *>(data->strData.buf), in decodeSnsStdAttrValue()
589 } else if (!data->value.has_subtype) { in decodeSnsStdAttrValue()
605 auto data = MakeUniqueZeroFill<Decodedata>(); in decodeSnsStrAttr() local
607 if (data.isNull()) { in decodeSnsStrAttr()
610 data->attr.value.values.funcs.decode = decodeSnsStdAttrValue; in decodeSnsStrAttr()
611 data->attr.value.values.arg = &data->attrArg; in decodeSnsStrAttr()
613 success = pb_decode(stream, sns_std_attr_fields, &data->attr); in decodeSnsStrAttr()
618 switch (data->attr.attr_id) { in decodeSnsStrAttr()
620 strlcpy(attrData->name, data->attrArg.strVal, sizeof(attrData->name)); in decodeSnsStrAttr()
623 strlcpy(attrData->vendor, data->attrArg.strVal, in decodeSnsStrAttr()
627 strlcpy(attrData->type, data->attrArg.strVal, sizeof(attrData->type)); in decodeSnsStrAttr()
630 if (!data->attrArg.boolVal) { in decodeSnsStrAttr()
631 LOGW("%s: %d", getAttrNameFromAttrId(data->attr.attr_id), in decodeSnsStrAttr()
632 data->attrArg.boolVal); in decodeSnsStrAttr()
636 attrData->maxSampleRate = data->attrArg.fltMax; in decodeSnsStrAttr()
639 attrData->streamType = data->attrArg.int64; in decodeSnsStrAttr()
642 attrData->hwId = data->attrArg.int64; in decodeSnsStrAttr()
645 attrData->passiveRequest = data->attrArg.boolVal; in decodeSnsStrAttr()
663 auto data = MakeUniqueZeroFill<DecodeData>(); in decodeSnsStdAttrEvent() local
665 if (data.isNull()) { in decodeSnsStdAttrEvent()
668 data->event.attributes.funcs.decode = decodeSnsStrAttr; in decodeSnsStdAttrEvent()
669 data->event.attributes.arg = &data->attr; in decodeSnsStdAttrEvent()
671 success = pb_decode(stream, sns_std_attr_event_fields, &data->event); in decodeSnsStdAttrEvent()
688 memcpy(info->sync->syncData, &data->attr, sizeof(data->attr)); in decodeSnsStdAttrEvent()
743 void populateEventSample(SeeDataArg *data, const float *val) { in populateEventSample() argument
744 size_t index = data->sampleIndex; in populateEventSample()
745 if (!data->event.isNull() && index < data->totalSamples) { in populateEventSample()
747 data->sensorType); in populateEventSample()
753 data->event.get()); in populateEventSample()
754 applyThreeAxisCalibration(&event->readings[index], val, data->cal); in populateEventSample()
761 data->event.get()); in populateEventSample()
768 auto *event = reinterpret_cast<chreSensorByteData *>(data->event.get()); in populateEventSample()
777 data->event.get()); in populateEventSample()
785 data->event.get()); in populateEventSample()
794 data->event.get()); in populateEventSample()
803 data->event.get()); in populateEventSample()
814 if (data->sampleIndex == 0) { in populateEventSample()
816 data->event.get()); in populateEventSample()
817 header->baseTimestamp = data->timeNs; in populateEventSample()
820 uint64_t delta = data->timeNs - data->prevTimeNs; in populateEventSample()
823 " curr %" PRIu64, static_cast<uint8_t>(data->sensorType), in populateEventSample()
824 data->prevTimeNs, data->timeNs); in populateEventSample()
829 data->prevTimeNs = data->timeNs; in populateEventSample()
838 auto *data = static_cast<SeeFloatArg *>(*arg); in decodeFloatData() local
842 if (data->index >= ARRAY_SIZE(data->val)) { in decodeFloatData()
843 LOGE("Float array length exceeds %zu", ARRAY_SIZE(data->val)); in decodeFloatData()
846 fltPtr = &(data->val[data->index]); in decodeFloatData()
849 (data->index)++; in decodeFloatData()
860 SeeBufArg data = {}; in decodeSnsStdSensorPhysicalConfigEvent() local
863 .operation_mode.arg = &data, in decodeSnsStdSensorPhysicalConfigEvent()
885 if (data.bufLen > 0) { in decodeSnsStdSensorPhysicalConfigEvent()
888 (strncmp(static_cast<const char *>(data.buf), kOpModeOff, in decodeSnsStdSensorPhysicalConfigEvent()
889 std::min(data.bufLen, sizeof(kOpModeOff))) != 0); in decodeSnsStdSensorPhysicalConfigEvent()
892 if (event.has_sample_rate || data.bufLen > 0) { in decodeSnsStdSensorPhysicalConfigEvent()
894 statusData->sensorType = info->data->sensorType; in decodeSnsStdSensorPhysicalConfigEvent()
895 info->data->status = std::move(statusData); in decodeSnsStdSensorPhysicalConfigEvent()
906 .data.funcs.decode = decodeFloatData, in decodeSnsStdSensorEvent()
907 .data.arg = &sample, in decodeSnsStdSensorEvent()
915 populateEventSample(info->data, sample.val); in decodeSnsStdSensorEvent()
1020 populateEventSample(info->data, &value); in decodeSnsProximityEvent()
1052 info->data->isHostWakeSuspendEvent = true; in decodeSnsRemoteProcStateEvent()
1053 info->data->isHostAwake = in decodeSnsRemoteProcStateEvent()
1146 bool success = decodeMsgIdAndTime(stream, &info->msgId, &info->data->timeNs); in decodeSnsClientEventMsg()
1169 info->data->sampleIndex++; in decodeSnsClientEventMsg()
1270 allocateEvent(info.data->sensorType, info.data->sampleIndex))); in prepareSensorEvent()
1271 info.data->event = std::move(buf); in prepareSensorEvent()
1273 if (!info.data->event.isNull()) { in prepareSensorEvent()
1276 info.data->prevTimeNs = 0; in prepareSensorEvent()
1279 info.data->event.get()); in prepareSensorEvent()
1282 info.data->sensorType); in prepareSensorEvent()
1283 header->readingCount = info.data->sampleIndex; in prepareSensorEvent()
1286 info.data->totalSamples = info.data->sampleIndex; in prepareSensorEvent()
1290 info.data->sampleIndex = 0; in prepareSensorEvent()
1328 auto data = MakeUnique<DecodeData>(); in handleSnsClientEventMsg() local
1330 if (data.isNull()) { in handleSnsClientEventMsg()
1334 data->info.client = client; in handleSnsClientEventMsg()
1335 data->info.sync = &data->syncArg; in handleSnsClientEventMsg()
1336 data->info.data = &data->dataArg; in handleSnsClientEventMsg()
1337 data->info.decodeMsgIdOnly = true; in handleSnsClientEventMsg()
1338 data->info.remoteProcSuid = &mRemoteProcSuid; in handleSnsClientEventMsg()
1339 data->info.calInfo = &mCalInfo[0]; in handleSnsClientEventMsg()
1340 data->event.events.funcs.decode = decodeSnsClientEventMsg; in handleSnsClientEventMsg()
1341 data->event.events.arg = &data->info; in handleSnsClientEventMsg()
1344 if (!pb_decode(&stream, sns_client_event_msg_fields, &data->event)) { in handleSnsClientEventMsg()
1347 data->info.suid = data->event.suid; in handleSnsClientEventMsg()
1348 data->info.decodeMsgIdOnly = false; in handleSnsClientEventMsg()
1349 data->info.data->cal = getCalDataFromSuid(data->info.suid); in handleSnsClientEventMsg()
1350 data->info.data->sensorType = getSensorTypeFromSensorInfo( in handleSnsClientEventMsg()
1351 data->info.client, data->info.suid, mSensorInfos); in handleSnsClientEventMsg()
1360 data->info.sync->syncData = mSyncData; in handleSnsClientEventMsg()
1361 data->info.sync->syncDataType = mSyncDataType; in handleSnsClientEventMsg()
1362 data->info.sync->syncSuid = mSyncSuid; in handleSnsClientEventMsg()
1365 if (data->info.data->sampleIndex > 0) { in handleSnsClientEventMsg()
1366 if (data->info.data->sensorType == SensorType::Unknown) { in handleSnsClientEventMsg()
1368 data->info.suid.suid_high, data->info.suid.suid_low); in handleSnsClientEventMsg()
1369 } else if (!prepareSensorEvent(data->info)) { in handleSnsClientEventMsg()
1374 if (!pb_decode(&streamCpy, sns_client_event_msg_fields, &data->event)) { in handleSnsClientEventMsg()
1376 } else if (synchronizedDecode && data->info.sync->syncIndFound) { in handleSnsClientEventMsg()
1380 if (data->info.data->isHostWakeSuspendEvent) { in handleSnsClientEventMsg()
1381 mCbIf->onHostWakeSuspendEvent(data->info.data->isHostAwake); in handleSnsClientEventMsg()
1383 if (!data->info.data->event.isNull()) { in handleSnsClientEventMsg()
1385 data->info.data->sensorType, std::move(data->info.data->event)); in handleSnsClientEventMsg()
1387 if (!data->info.data->status.isNull()) { in handleSnsClientEventMsg()
1388 if (data->info.data->sensorType == SensorType::Unknown) { in handleSnsClientEventMsg()
1390 data->info.suid.suid_high, data->info.suid.suid_low); in handleSnsClientEventMsg()
1392 mCbIf->onSamplingStatusUpdate(std::move(data->info.data->status)); in handleSnsClientEventMsg()
1605 SeeBufArg data; in sendReq() local
1609 batchPeriodUs, passive, &msg, &data)) { in sendReq()