Lines Matching full:output
775 void printCommonPDRHeader(const pldm_pdr_hdr* hdr, ordered_json& output)
777 output["recordHandle"] = hdr->record_handle;
778 output["PDRHeaderVersion"] = unsigned(hdr->version);
779 output["PDRType"] = getPDRType(hdr->type);
780 output["recordChangeNumber"] = hdr->record_change_num;
781 output["dataLength"] = hdr->length;
807 void printStateSensorPDR(const uint8_t* data, ordered_json& output)
810 output["PLDMTerminusHandle"] = pdr->terminus_handle;
811 output["sensorID"] = pdr->sensor_id;
812 output["entityType"] = getEntityName(pdr->entity_type);
813 output["entityInstanceNumber"] = pdr->entity_instance;
814 output["containerID"] = pdr->container_id;
815 output["sensorInit"] = sensorInit[pdr->sensor_init];
816 output["sensorAuxiliaryNamesPDR"] =
818 output["compositeSensorCount"] = unsigned(pdr->composite_sensor_count);
827 output.emplace(("stateSetID[" + std::to_string(compCount) + "]"),
829 output.emplace(
832 output.emplace(
847 void printPDRFruRecordSet(uint8_t* data, ordered_json& output)
863 output["PLDMTerminusHandle"] = unsigned(pdr->terminus_handle);
864 output["FRURecordSetIdentifier"] = unsigned(pdr->fru_rsi);
865 output["entityType"] = getEntityName(pdr->entity_type);
866 output["entityInstanceNumber"] = unsigned(pdr->entity_instance);
867 output["containerID"] = unsigned(pdr->container_id);
870 void printPDREntityAssociation(uint8_t* data, ordered_json& output)
892 output["containerID"] = int(pdr->container_id);
895 output["associationType"] =
902 output["containerEntityType"] =
904 output["containerEntityInstanceNumber"] =
906 output["containerEntityContainerID"] =
908 output["containedEntityCount"] =
914 output.emplace("containedEntityType[" + std::to_string(i + 1) + "]",
916 output.emplace("containedEntityInstanceNumber[" +
919 output.emplace("containedEntityContainerID[" +
927 /** @brief Format the Sensor/Effecter Aux Name PDR types to json output
930 * @param[out] output - PDRs data fields in Json format
932 void printAuxNamePDR(uint8_t* data, ordered_json& output)
949 output["terminusHandle"] = int(auxNamePdr->terminus_handle);
950 output[sPrefix + "Id"] = int(auxNamePdr->effecter_id);
951 output[sPrefix + "Count"] = int(auxNamePdr->effecter_count);
981 output[nameLanguageTagKey] = nameLanguageTag;
982 output[entityAuxNameKey] = nameString;
987 void printNumericEffecterPDR(uint8_t* data, ordered_json& output)
997 output["PLDMTerminusHandle"] = int(pdr->terminus_handle);
998 output["effecterID"] = int(pdr->effecter_id);
999 output["entityType"] = int(pdr->entity_type);
1000 output["entityInstanceNumber"] = int(pdr->entity_instance);
1001 output["containerID"] = int(pdr->container_id);
1002 output["effecterSemanticID"] = int(pdr->effecter_semantic_id);
1003 output["effecterInit"] = unsigned(pdr->effecter_init);
1004 output["effecterAuxiliaryNames"] =
1006 output["baseUnit"] = unsigned(pdr->base_unit);
1007 output["unitModifier"] = unsigned(pdr->unit_modifier);
1008 output["rateUnit"] = unsigned(pdr->rate_unit);
1009 output["baseOEMUnitHandle"] = unsigned(pdr->base_oem_unit_handle);
1010 output["auxUnit"] = unsigned(pdr->aux_unit);
1011 output["auxUnitModifier"] = unsigned(pdr->aux_unit_modifier);
1012 output["auxrateUnit"] = unsigned(pdr->aux_rate_unit);
1013 output["auxOEMUnitHandle"] = unsigned(pdr->aux_oem_unit_handle);
1014 output["isLinear"] = (unsigned(pdr->is_linear) ? true : false);
1015 output["effecterDataSize"] = unsigned(pdr->effecter_data_size);
1016 output["resolution"] = unsigned(pdr->resolution);
1017 output["offset"] = unsigned(pdr->offset);
1018 output["accuracy"] = unsigned(pdr->accuracy);
1019 output["plusTolerance"] = unsigned(pdr->plus_tolerance);
1020 output["minusTolerance"] = unsigned(pdr->minus_tolerance);
1021 output["stateTransitionInterval"] =
1023 output["TransitionInterval"] = unsigned(pdr->transition_interval);
1028 output["maxSettable"] = unsigned(pdr->max_settable.value_u8);
1029 output["minSettable"] = unsigned(pdr->min_settable.value_u8);
1032 output["maxSettable"] = unsigned(pdr->max_settable.value_s8);
1033 output["minSettable"] = unsigned(pdr->min_settable.value_s8);
1036 output["maxSettable"] = unsigned(pdr->max_settable.value_u16);
1037 output["minSettable"] = unsigned(pdr->min_settable.value_u16);
1040 output["maxSettable"] = unsigned(pdr->max_settable.value_s16);
1041 output["minSettable"] = unsigned(pdr->min_settable.value_s16);
1044 output["maxSettable"] = unsigned(pdr->max_settable.value_u32);
1045 output["minSettable"] = unsigned(pdr->min_settable.value_u32);
1048 output["maxSettable"] = unsigned(pdr->max_settable.value_s32);
1049 output["minSettable"] = unsigned(pdr->min_settable.value_s32);
1055 output["rangeFieldFormat"] = unsigned(pdr->range_field_format);
1056 output["rangeFieldSupport"] = unsigned(pdr->range_field_support.byte);
1061 output["nominalValue"] = unsigned(pdr->nominal_value.value_u8);
1062 output["normalMax"] = unsigned(pdr->normal_max.value_u8);
1063 output["normalMin"] = unsigned(pdr->normal_min.value_u8);
1064 output["ratedMax"] = unsigned(pdr->rated_max.value_u8);
1065 output["ratedMin"] = unsigned(pdr->rated_min.value_u8);
1068 output["nominalValue"] = unsigned(pdr->nominal_value.value_s8);
1069 output["normalMax"] = unsigned(pdr->normal_max.value_s8);
1070 output["normalMin"] = unsigned(pdr->normal_min.value_s8);
1071 output["ratedMax"] = unsigned(pdr->rated_max.value_s8);
1072 output["ratedMin"] = unsigned(pdr->rated_min.value_s8);
1075 output["nominalValue"] = unsigned(pdr->nominal_value.value_u16);
1076 output["normalMax"] = unsigned(pdr->normal_max.value_u16);
1077 output["normalMin"] = unsigned(pdr->normal_min.value_u16);
1078 output["ratedMax"] = unsigned(pdr->rated_max.value_u16);
1079 output["ratedMin"] = unsigned(pdr->rated_min.value_u16);
1082 output["nominalValue"] = unsigned(pdr->nominal_value.value_s16);
1083 output["normalMax"] = unsigned(pdr->normal_max.value_s16);
1084 output["normalMin"] = unsigned(pdr->normal_min.value_s16);
1085 output["ratedMax"] = unsigned(pdr->rated_max.value_s16);
1086 output["ratedMin"] = unsigned(pdr->rated_min.value_s16);
1089 output["nominalValue"] = unsigned(pdr->nominal_value.value_u32);
1090 output["normalMax"] = unsigned(pdr->normal_max.value_u32);
1091 output["normalMin"] = unsigned(pdr->normal_min.value_u32);
1092 output["ratedMax"] = unsigned(pdr->rated_max.value_u32);
1093 output["ratedMin"] = unsigned(pdr->rated_min.value_u32);
1096 output["nominalValue"] = unsigned(pdr->nominal_value.value_s32);
1097 output["normalMax"] = unsigned(pdr->normal_max.value_s32);
1098 output["normalMin"] = unsigned(pdr->normal_min.value_s32);
1099 output["ratedMax"] = unsigned(pdr->rated_max.value_s32);
1100 output["ratedMin"] = unsigned(pdr->rated_min.value_s32);
1103 output["nominalValue"] = unsigned(pdr->nominal_value.value_f32);
1104 output["normalMax"] = unsigned(pdr->normal_max.value_f32);
1105 output["normalMin"] = unsigned(pdr->normal_min.value_f32);
1106 output["ratedMax"] = unsigned(pdr->rated_max.value_f32);
1107 output["ratedMin"] = unsigned(pdr->rated_min.value_f32);
1114 void printStateEffecterPDR(const uint8_t* data, ordered_json& output)
1118 output["PLDMTerminusHandle"] = pdr->terminus_handle;
1119 output["effecterID"] = pdr->effecter_id;
1120 output["entityType"] = getEntityName(pdr->entity_type);
1121 output["entityInstanceNumber"] = pdr->entity_instance;
1122 output["containerID"] = pdr->container_id;
1123 output["effecterSemanticID"] = pdr->effecter_semantic_id;
1124 output["effecterInit"] = effecterInit[pdr->effecter_init];
1125 output["effecterDescriptionPDR"] =
1127 output["compositeEffecterCount"] =
1138 output.emplace(("stateSetID[" + std::to_string(compEffCount) + "]"),
1140 output.emplace(
1143 output.emplace(
1221 void printTerminusLocatorPDR(const uint8_t* data, ordered_json& output)
1228 output["PLDMTerminusHandle"] = pdr->terminus_handle;
1229 output["validity"] = (pdr->validity ? "valid" : "notValid");
1230 output["TID"] = unsigned(pdr->tid);
1231 output["containerID"] = pdr->container_id;
1232 output["terminusLocatorType"] =
1234 output["terminusLocatorValueSize"] =
1242 output["EID"] = unsigned(locatorValue->eid);
1262 /** @brief Format the Numeric Sensor PDR types to json output
1266 * @param[out] output - PDRs data fields in Json format
1269 ordered_json& output)
1279 output["PLDMTerminusHandle"] = pdr.terminus_handle;
1280 output["sensorID"] = pdr.sensor_id;
1281 output["entityType"] = getEntityName(pdr.entity_type);
1282 output["entityInstanceNumber"] = pdr.entity_instance_num;
1283 output["containerID"] = pdr.container_id;
1284 output["sensorInit"] = pdr.sensor_init;
1285 output["sensorAuxiliaryNamesPDR"] =
1287 output["baseUnit"] = pdr.base_unit;
1288 output["unitModifier"] = pdr.unit_modifier;
1289 output["rateUnit"] = pdr.rate_unit;
1290 output["baseOEMUnitHandle"] = pdr.base_oem_unit_handle;
1291 output["auxUnit"] = pdr.aux_unit;
1292 output["auxUnitModifier"] = pdr.aux_unit_modifier;
1293 output["auxrateUnit"] = pdr.aux_rate_unit;
1294 output["rel"] = pdr.rel;
1295 output["auxOEMUnitHandle"] = pdr.aux_oem_unit_handle;
1296 output["isLinear"] = (pdr.is_linear) ? true : false;
1297 output["sensorDataSize"] = pdr.sensor_data_size;
1298 output["resolution"] = pdr.resolution;
1299 output["offset"] = pdr.offset;
1300 output["accuracy"] = pdr.accuracy;
1301 output["plusTolerance"] = pdr.plus_tolerance;
1302 output["minusTolerance"] = pdr.minus_tolerance;
1307 output["hysteresis"] = pdr.hysteresis.value_u8;
1308 output["maxReadable"] = pdr.max_readable.value_u8;
1309 output["minReadable"] = pdr.min_readable.value_u8;
1312 output["hysteresis"] = pdr.hysteresis.value_s8;
1313 output["maxReadable"] = pdr.max_readable.value_s8;
1314 output["minReadable"] = pdr.min_readable.value_s8;
1317 output["hysteresis"] = pdr.hysteresis.value_u16;
1318 output["maxReadable"] = pdr.max_readable.value_u16;
1319 output["minReadable"] = pdr.min_readable.value_u16;
1322 output["hysteresis"] = pdr.hysteresis.value_s16;
1323 output["maxReadable"] = pdr.max_readable.value_s16;
1324 output["minReadable"] = pdr.min_readable.value_s16;
1327 output["hysteresis"] = pdr.hysteresis.value_u32;
1328 output["maxReadable"] = pdr.max_readable.value_u32;
1329 output["minReadable"] = pdr.min_readable.value_u32;
1332 output["hysteresis"] = pdr.hysteresis.value_s32;
1333 output["maxReadable"] = pdr.max_readable.value_s32;
1334 output["minReadable"] = pdr.min_readable.value_s32;
1340 output["supportedThresholds"] = pdr.supported_thresholds.byte;
1341 output["thresholAndHysteresisVolatility"] =
1343 output["stateTransitionInterval"] = pdr.state_transition_interval;
1344 output["updateInterval"] = pdr.update_interval;
1345 output["rangeFieldFormat"] = pdr.range_field_format;
1346 output["rangeFieldSupport"] = pdr.range_field_support.byte;
1351 output["nominalValue"] = pdr.nominal_value.value_u8;
1352 output["normalMax"] = pdr.normal_max.value_u8;
1353 output["normalMin"] = pdr.normal_min.value_u8;
1354 output["warningHigh"] = pdr.warning_high.value_u8;
1355 output["warningLow"] = pdr.warning_low.value_u8;
1356 output["criticalHigh"] = pdr.critical_high.value_u8;
1357 output["criticalLow"] = pdr.critical_low.value_u8;
1358 output["fatalHigh"] = pdr.fatal_high.value_u8;
1359 output["fatalLeow"] = pdr.fatal_low.value_u8;
1362 output["nominalValue"] = pdr.nominal_value.value_s8;
1363 output["normalMax"] = pdr.normal_max.value_s8;
1364 output["normalMin"] = pdr.normal_min.value_s8;
1365 output["warningHigh"] = pdr.warning_high.value_s8;
1366 output["warningLow"] = pdr.warning_low.value_s8;
1367 output["criticalHigh"] = pdr.critical_high.value_s8;
1368 output["criticalLow"] = pdr.critical_low.value_s8;
1369 output["fatalHigh"] = pdr.fatal_high.value_s8;
1370 output["fatalLeow"] = pdr.fatal_low.value_s8;
1373 output["nominalValue"] = pdr.nominal_value.value_u16;
1374 output["normalMax"] = pdr.normal_max.value_u16;
1375 output["normalMin"] = pdr.normal_min.value_u16;
1376 output["warningHigh"] = pdr.warning_high.value_u16;
1377 output["warningLow"] = pdr.warning_low.value_u16;
1378 output["criticalHigh"] = pdr.critical_high.value_u16;
1379 output["criticalLow"] = pdr.critical_low.value_u16;
1380 output["fatalHigh"] = pdr.fatal_high.value_u16;
1381 output["fatalLeow"] = pdr.fatal_low.value_u16;
1384 output["nominalValue"] = pdr.nominal_value.value_s16;
1385 output["normalMax"] = pdr.normal_max.value_s16;
1386 output["normalMin"] = pdr.normal_min.value_s16;
1387 output["warningHigh"] = pdr.warning_high.value_s16;
1388 output["warningLow"] = pdr.warning_low.value_s16;
1389 output["criticalHigh"] = pdr.critical_high.value_s16;
1390 output["criticalLow"] = pdr.critical_low.value_s16;
1391 output["fatalHigh"] = pdr.fatal_high.value_s16;
1392 output["fatalLeow"] = pdr.fatal_low.value_s16;
1395 output["nominalValue"] = pdr.nominal_value.value_u32;
1396 output["normalMax"] = pdr.normal_max.value_u32;
1397 output["normalMin"] = pdr.normal_min.value_u32;
1398 output["warningHigh"] = pdr.warning_high.value_u32;
1399 output["warningLow"] = pdr.warning_low.value_u32;
1400 output["criticalHigh"] = pdr.critical_high.value_u32;
1401 output["criticalLow"] = pdr.critical_low.value_u32;
1402 output["fatalHigh"] = pdr.fatal_high.value_u32;
1403 output["fatalLeow"] = pdr.fatal_low.value_u32;
1406 output["nominalValue"] = pdr.nominal_value.value_s32;
1407 output["normalMax"] = pdr.normal_max.value_s32;
1408 output["normalMin"] = pdr.normal_min.value_s32;
1409 output["warningHigh"] = pdr.warning_high.value_s32;
1410 output["warningLow"] = pdr.warning_low.value_s32;
1411 output["criticalHigh"] = pdr.critical_high.value_s32;
1412 output["criticalLow"] = pdr.critical_low.value_s32;
1413 output["fatalHigh"] = pdr.fatal_high.value_s32;
1414 output["fatalLeow"] = pdr.fatal_low.value_s32;
1417 output["nominalValue"] = pdr.nominal_value.value_f32;
1418 output["normalMax"] = pdr.normal_max.value_f32;
1419 output["normalMin"] = pdr.normal_min.value_f32;
1420 output["warningHigh"] = pdr.warning_high.value_f32;
1421 output["warningLow"] = pdr.warning_low.value_f32;
1422 output["criticalHigh"] = pdr.critical_high.value_f32;
1423 output["criticalLow"] = pdr.critical_low.value_f32;
1424 output["fatalHigh"] = pdr.fatal_high.value_f32;
1425 output["fatalLeow"] = pdr.fatal_low.value_f32;
1432 /** @brief Format the Compact Numeric Sensor PDR types to json output
1435 * @param[out] output - PDRs data fields in Json format
1437 void printCompactNumericSensorPDR(const uint8_t* data, ordered_json& output)
1447 output["PLDMTerminusHandle"] = int(pdr->terminus_handle);
1448 output["sensorID"] = int(pdr->sensor_id);
1449 output["entityType"] = getEntityName(pdr->entity_type);
1450 output["entityInstanceNumber"] = int(pdr->entity_instance);
1451 output["containerID"] = int(pdr->container_id);
1452 output["sensorNameStringByteLength"] = int(pdr->sensor_name_length);
1455 output["Name"] = std::format("PLDM_Device_TID{}_SensorId{}",
1463 output["Name"] = sTemp;
1465 output["baseUnit"] = unsigned(pdr->base_unit);
1466 output["unitModifier"] = signed(pdr->unit_modifier);
1467 output["occurrenceRate"] = unsigned(pdr->occurrence_rate);
1468 output["rangeFieldSupport"] = unsigned(pdr->range_field_support.byte);
1471 output["warningHigh"] = int(pdr->warning_high);
1475 output["warningLow"] = int(pdr->warning_low);
1479 output["criticalHigh"] = int(pdr->critical_high);
1483 output["criticalLow"] = int(pdr->critical_low);
1487 output["fatalHigh"] = int(pdr->fatal_high);
1491 output["fatalLow"] = int(pdr->fatal_low);
1504 ordered_json output;
1505 output["nextRecordHandle"] = nextRecordHndl;
1506 output["responseCount"] = respCnt;
1546 printCommonPDRHeader(pdr, output);
1551 printTerminusLocatorPDR(data, output);
1554 printStateSensorPDR(data, output);
1557 printNumericEffecterPDR(data, output);
1560 printNumericSensorPDR(data, respCnt, output);
1564 printAuxNamePDR(data, output);
1567 printStateEffecterPDR(data, output);
1570 printPDREntityAssociation(data, output);
1573 printPDRFruRecordSet(data, output);
1576 printCompactNumericSensorPDR(data, output);
1581 pldmtool::helper::DisplayInJson(output);
1832 ordered_json output;
1833 output["compositeSensorCount"] = (int)compSensorCount;
1839 output.emplace(("sensorOpState[" + std::to_string(i) + "]"),
1845 output.emplace(("presentState[" + std::to_string(i) + "]"),
1851 output.emplace(
1858 output.emplace(("eventState[" + std::to_string(i) + "]"),
1863 pldmtool::helper::DisplayInJson(output);
1932 ordered_json output;
1933 output["sensorDataSize"] =
1935 output["sensorOperationalState"] =
1937 output["sensorEventMessageEnable"] =
1939 output["presentState"] = getSensorState(presentState, &sensorPresState);
1940 output["previousState"] =
1942 output["eventState"] = getSensorState(eventState, &sensorPresState);
1948 output["presentReading"] =
1954 output["presentReading"] =
1960 output["presentReading"] =
1966 output["presentReading"] =
1972 output["presentReading"] =
1978 output["presentReading"] =
1990 pldmtool::helper::DisplayInJson(output);
2073 ordered_json output;
2075 output["compositeEffecterCount"] = comp_effecter_count;
2079 output[std::format("effecterOpState[{}])", i)] =
2082 output[std::format("pendingState[{}]", i)] =
2085 output[std::format("presentState[{}]", i)] =
2089 pldmtool::helper::DisplayInJson(output);
2153 ordered_json output;
2154 output["effecterDataSize"] = static_cast<int>(effecterDataSize);
2155 output["effecterOperationalState"] =
2162 output["pendingValue"] =
2164 output["presentValue"] =
2170 output["pendingValue"] =
2172 output["presentValue"] =
2178 output["pendingValue"] =
2180 output["presentValue"] =
2186 output["pendingValue"] =
2188 output["presentValue"] =
2194 output["pendingValue"] =
2196 output["presentValue"] =
2202 output["pendingValue"] =
2204 output["presentValue"] =
2216 pldmtool::helper::DisplayInJson(output);