Lines Matching refs:data
121 SeeDataArg *data; member
148 auto *data = static_cast<const SeeBufArg *>(*arg); in copyPayload() local
152 static_cast<const pb_byte_t *>(data->buf), in copyPayload()
153 data->bufLen)) { in copyPayload()
216 SeeBufArg data = { in encodeSnsSuidReq() local
222 .data_type.arg = &data, in encodeSnsSuidReq()
365 UniquePtr<sns_client_request_msg> *msg, SeeBufArg *data) { in prepSnsClientReq() argument
368 CHRE_ASSERT(data); in prepSnsClientReq()
378 data->buf = payload, data->bufLen = payloadLen, in prepSnsClientReq()
390 req->request.payload.arg = data; in prepSnsClientReq()
404 auto *data = static_cast<SeeBufArg *>(*arg); in decodeStringField() local
405 data->bufLen = stream->bytes_left; in decodeStringField()
406 data->buf = stream->state; in decodeStringField()
440 SeeBufArg data; in decodeSnsSuidEvent() local
444 .data_type.arg = &data, in decodeSnsSuidEvent()
463 strncmp(info->sync->syncDataType, static_cast<const char *>(data.buf), in decodeSnsSuidEvent()
464 std::min(data.bufLen, kSeeAttrStrValLen)) != 0) { in decodeSnsSuidEvent()
576 auto data = MakeUniqueZeroFill<DecodeData>(); in decodeSnsStdAttrValue() local
578 if (data.isNull()) { in decodeSnsStdAttrValue()
581 data->value.str.funcs.decode = decodeStringField; in decodeSnsStdAttrValue()
582 data->value.str.arg = &data->strData; in decodeSnsStdAttrValue()
583 data->value.subtype.values.funcs.decode = decodeSnsStdAttrValue; in decodeSnsStdAttrValue()
584 data->value.subtype.values.arg = &data->subtypeAttrArg; in decodeSnsStdAttrValue()
586 success = pb_decode(stream, sns_std_attr_value_data_fields, &data->value); in decodeSnsStdAttrValue()
591 if (data->value.has_flt) { in decodeSnsStdAttrValue()
599 if (data->value.flt < attrVal->fltMin) { in decodeSnsStdAttrValue()
600 attrVal->fltMin = data->value.flt; in decodeSnsStdAttrValue()
602 if (data->value.flt > attrVal->fltMax) { in decodeSnsStdAttrValue()
603 attrVal->fltMax = data->value.flt; in decodeSnsStdAttrValue()
605 } else if (data->value.has_sint) { in decodeSnsStdAttrValue()
606 attrVal->int64 = data->value.sint; in decodeSnsStdAttrValue()
607 } else if (data->value.has_boolean) { in decodeSnsStdAttrValue()
608 attrVal->boolVal = data->value.boolean; in decodeSnsStdAttrValue()
609 } else if (data->strData.buf != nullptr) { in decodeSnsStdAttrValue()
610 strlcpy(attrVal->strVal, static_cast<const char *>(data->strData.buf), in decodeSnsStdAttrValue()
612 } else if (!data->value.has_subtype) { in decodeSnsStdAttrValue()
628 auto data = MakeUniqueZeroFill<Decodedata>(); in decodeSnsStrAttr() local
630 if (data.isNull()) { in decodeSnsStrAttr()
633 data->attr.value.values.funcs.decode = decodeSnsStdAttrValue; in decodeSnsStrAttr()
634 data->attr.value.values.arg = &data->attrArg; in decodeSnsStrAttr()
636 success = pb_decode(stream, sns_std_attr_fields, &data->attr); in decodeSnsStrAttr()
641 switch (data->attr.attr_id) { in decodeSnsStrAttr()
643 strlcpy(attrData->name, data->attrArg.strVal, sizeof(attrData->name)); in decodeSnsStrAttr()
646 strlcpy(attrData->vendor, data->attrArg.strVal, in decodeSnsStrAttr()
650 if (!data->attrArg.boolVal) { in decodeSnsStrAttr()
651 LOGW("%s: %d", getAttrNameFromAttrId(data->attr.attr_id), in decodeSnsStrAttr()
652 data->attrArg.boolVal); in decodeSnsStrAttr()
656 attrData->maxSampleRate = data->attrArg.fltMax; in decodeSnsStrAttr()
659 attrData->streamType = data->attrArg.int64; in decodeSnsStrAttr()
662 attrData->hwId = data->attrArg.int64; in decodeSnsStrAttr()
665 attrData->passiveRequest = data->attrArg.boolVal; in decodeSnsStrAttr()
683 auto data = MakeUniqueZeroFill<DecodeData>(); in decodeSnsStdAttrEvent() local
685 if (data.isNull()) { in decodeSnsStdAttrEvent()
688 data->event.attributes.funcs.decode = decodeSnsStrAttr; in decodeSnsStdAttrEvent()
689 data->event.attributes.arg = &data->attr; in decodeSnsStdAttrEvent()
691 success = pb_decode(stream, sns_std_attr_event_fields, &data->event); in decodeSnsStdAttrEvent()
708 memcpy(info->sync->syncData, &data->attr, sizeof(data->attr)); in decodeSnsStdAttrEvent()
751 SeeDataArg *data = info->data; in populateEventSample() local
752 size_t index = data->sampleIndex; in populateEventSample()
753 if (!data->event.isNull() && index < data->totalSamples) { in populateEventSample()
756 data->sensorType); in populateEventSample()
762 reinterpret_cast<chreSensorThreeAxisData *>(data->event.get()); in populateEventSample()
763 info->calHelper->applyCalibration(data->sensorType, val, in populateEventSample()
771 reinterpret_cast<chreSensorFloatData *>(data->event.get()); in populateEventSample()
778 auto *event = reinterpret_cast<chreSensorByteData *>(data->event.get()); in populateEventSample()
787 reinterpret_cast<chreSensorOccurrenceData *>(data->event.get()); in populateEventSample()
795 reinterpret_cast<chrexSensorVendor0Data *>(data->event.get()); in populateEventSample()
804 reinterpret_cast<chrexSensorVendor1Data *>(data->event.get()); in populateEventSample()
813 reinterpret_cast<chrexSensorVendor2Data *>(data->event.get()); in populateEventSample()
821 reinterpret_cast<chrexSensorVendor3Data *>(data->event.get()); in populateEventSample()
830 reinterpret_cast<chrexSensorVendor4Data *>(data->event.get()); in populateEventSample()
839 reinterpret_cast<chrexSensorVendor5Data *>(data->event.get()); in populateEventSample()
847 reinterpret_cast<chrexSensorVendor6Data *>(data->event.get()); in populateEventSample()
856 reinterpret_cast<chrexSensorVendor7Data *>(data->event.get()); in populateEventSample()
865 reinterpret_cast<chrexSensorVendor8Data *>(data->event.get()); in populateEventSample()
874 reinterpret_cast<chrexSensorVendor9Data *>(data->event.get()); in populateEventSample()
882 reinterpret_cast<chrexSensorVendor10Data *>(data->event.get()); in populateEventSample()
894 if (data->sampleIndex == 0) { in populateEventSample()
896 reinterpret_cast<chreSensorDataHeader *>(data->event.get()); in populateEventSample()
897 header->baseTimestamp = data->timeNs; in populateEventSample()
900 uint64_t delta = data->timeNs - data->prevTimeNs; in populateEventSample()
904 static_cast<uint8_t>(data->sensorType), data->prevTimeNs, in populateEventSample()
905 data->timeNs); in populateEventSample()
910 data->prevTimeNs = data->timeNs; in populateEventSample()
919 auto *data = static_cast<SeeFloatArg *>(*arg); in decodeFloatData() local
923 if (data->index >= ARRAY_SIZE(data->val)) { in decodeFloatData()
924 LOGE("Float array length exceeds %zu", ARRAY_SIZE(data->val)); in decodeFloatData()
927 fltPtr = &(data->val[data->index]); in decodeFloatData()
930 (data->index)++; in decodeFloatData()
942 SeeBufArg data = {}; in decodeSnsStdSensorPhysicalConfigEvent() local
945 .operation_mode.arg = &data, in decodeSnsStdSensorPhysicalConfigEvent()
967 if (data.bufLen > 0) { in decodeSnsStdSensorPhysicalConfigEvent()
970 (strncmp(static_cast<const char *>(data.buf), kOpModeOff, in decodeSnsStdSensorPhysicalConfigEvent()
971 std::min(data.bufLen, sizeof(kOpModeOff))) != 0); in decodeSnsStdSensorPhysicalConfigEvent()
974 if (event.has_sample_rate || data.bufLen > 0) { in decodeSnsStdSensorPhysicalConfigEvent()
976 statusData->sensorType = info->data->sensorType; in decodeSnsStdSensorPhysicalConfigEvent()
977 info->data->status = std::move(statusData); in decodeSnsStdSensorPhysicalConfigEvent()
988 .data.funcs.decode = decodeFloatData, in decodeSnsStdSensorEvent()
989 .data.arg = &sample, in decodeSnsStdSensorEvent()
1078 info->data->timeNs); in decodeSnsCalEvent()
1086 info->data->bias = std::move(biasData); in decodeSnsCalEvent()
1087 info->data->sensorType = sensorType; in decodeSnsCalEvent()
1156 static_cast<uint8_t>(info->data->sensorType), in decodeSnsResamplerConfigEvent()
1189 info->data->isHostWakeSuspendEvent = true; in decodeSnsRemoteProcStateEvent()
1190 info->data->isHostAwake = (event.event_type == SNS_REMOTE_PROC_STATE_AWAKE); in decodeSnsRemoteProcStateEvent()
1226 info->data->sensorType = CHRE_SENSOR_TYPE_STATIONARY_DETECT; in decodeSnsAmdProtoEvent()
1228 info->data->sensorType = CHRE_SENSOR_TYPE_INSTANT_MOTION_DETECT; in decodeSnsAmdProtoEvent()
1320 bool success = decodeMsgIdAndTime(stream, &info->msgId, &info->data->timeNs); in decodeSnsClientEventMsg()
1346 info->data->sampleIndex++; in decodeSnsClientEventMsg()
1474 allocateEvent(info.data->sensorType, info.data->sampleIndex))); in prepareSensorEvent()
1475 info.data->event = std::move(buf); in prepareSensorEvent()
1477 if (!info.data->event.isNull()) { in prepareSensorEvent()
1480 info.data->prevTimeNs = 0; in prepareSensorEvent()
1483 reinterpret_cast<chreSensorDataHeader *>(info.data->event.get()); in prepareSensorEvent()
1485 header->readingCount = info.data->sampleIndex; in prepareSensorEvent()
1489 info.data->totalSamples = info.data->sampleIndex; in prepareSensorEvent()
1493 info.data->sampleIndex = 0; in prepareSensorEvent()
1555 auto data = MakeUnique<DecodeData>(); in handleSnsClientEventMsg() local
1557 if (data.isNull()) { in handleSnsClientEventMsg()
1561 data->info.client = client; in handleSnsClientEventMsg()
1562 data->info.sync = &data->syncArg; in handleSnsClientEventMsg()
1563 data->info.data = &data->dataArg; in handleSnsClientEventMsg()
1564 data->info.decodeMsgIdOnly = true; in handleSnsClientEventMsg()
1565 data->info.remoteProcSuid = &mRemoteProcSuid; in handleSnsClientEventMsg()
1566 data->info.calHelper = mCalHelper; in handleSnsClientEventMsg()
1567 data->event.events.funcs.decode = decodeSnsClientEventMsg; in handleSnsClientEventMsg()
1568 data->event.events.arg = &data->info; in handleSnsClientEventMsg()
1571 if (!pb_decode(&stream, sns_client_event_msg_fields, &data->event)) { in handleSnsClientEventMsg()
1574 data->info.suid = data->event.suid; in handleSnsClientEventMsg()
1575 data->info.decodeMsgIdOnly = false; in handleSnsClientEventMsg()
1576 data->info.data->sensorType = getSensorTypeFromSensorInfo( in handleSnsClientEventMsg()
1577 data->info.client, data->info.suid, mSensorInfos); in handleSnsClientEventMsg()
1586 data->info.sync->syncData = mSyncData; in handleSnsClientEventMsg()
1587 data->info.sync->syncDataType = mSyncDataType; in handleSnsClientEventMsg()
1588 data->info.sync->syncSuid = mSyncSuid; in handleSnsClientEventMsg()
1591 if (data->info.data->sampleIndex > 0) { in handleSnsClientEventMsg()
1592 if (data->info.data->sensorType == CHRE_SENSOR_TYPE_INVALID) { in handleSnsClientEventMsg()
1594 data->info.suid.suid_high, data->info.suid.suid_low); in handleSnsClientEventMsg()
1595 } else if (!prepareSensorEvent(data->info)) { in handleSnsClientEventMsg()
1600 if (!pb_decode(&streamCpy, sns_client_event_msg_fields, &data->event)) { in handleSnsClientEventMsg()
1602 } else if (synchronizedDecode && data->info.sync->syncIndFound) { in handleSnsClientEventMsg()
1606 if (data->info.msgId == SNS_STD_MSGID_SNS_STD_FLUSH_EVENT) { in handleSnsClientEventMsg()
1607 mCbIf->onFlushCompleteEvent(data->info.data->sensorType); in handleSnsClientEventMsg()
1609 if (data->info.data->isHostWakeSuspendEvent) { in handleSnsClientEventMsg()
1610 mCbIf->onHostWakeSuspendEvent(data->info.data->isHostAwake); in handleSnsClientEventMsg()
1612 if (!data->info.data->event.isNull()) { in handleSnsClientEventMsg()
1613 mCbIf->onSensorDataEvent(data->info.data->sensorType, in handleSnsClientEventMsg()
1614 std::move(data->info.data->event)); in handleSnsClientEventMsg()
1616 if (!data->info.data->bias.isNull()) { in handleSnsClientEventMsg()
1617 mCbIf->onSensorBiasEvent(data->info.data->sensorType, in handleSnsClientEventMsg()
1618 std::move(data->info.data->bias)); in handleSnsClientEventMsg()
1620 if (!data->info.data->status.isNull()) { in handleSnsClientEventMsg()
1621 if (data->info.data->sensorType == CHRE_SENSOR_TYPE_INVALID) { in handleSnsClientEventMsg()
1623 data->info.suid.suid_high, data->info.suid.suid_low); in handleSnsClientEventMsg()
1625 mCbIf->onSamplingStatusUpdate(std::move(data->info.data->status)); in handleSnsClientEventMsg()
1878 SeeBufArg data; in sendReq() local
1882 batchPeriodUs, passive, &msg, &data)) { in sendReq()