diff --git a/utils/common/include/print_sensor_data.h b/utils/common/include/print_sensor_data.h index 1bb675500438813074b5fe34aa8f297ff14f4d56..4031ccd577b9e5e019ce83253a8c9e348e99122a 100644 --- a/utils/common/include/print_sensor_data.h +++ b/utils/common/include/print_sensor_data.h @@ -60,11 +60,14 @@ private: LogPrintInfo info_; std::map hdiLoginfo_ = { {SENSOR_TYPE_ID_ACCELEROMETER, info_}, - {SENSOR_TYPE_ID_GYROSCOPE, info_}, - {SENSOR_TYPE_ID_POSTURE, info_}, {SENSOR_TYPE_ID_AMBIENT_LIGHT, info_}, {SENSOR_TYPE_ID_AMBIENT_LIGHT1, info_}, + {SENSOR_TYPE_ID_GRAVITY, info_}, + {SENSOR_TYPE_ID_GYROSCOPE, info_}, {SENSOR_TYPE_ID_MAGNETIC_FIELD, info_}, + {SENSOR_TYPE_ID_ORIENTATION, info_}, + {SENSOR_TYPE_ID_POSTURE, info_}, + {SENSOR_TYPE_ID_ROTATION_VECTOR, info_}, }; std::map clientLoginfo_; }; diff --git a/utils/common/src/print_sensor_data.cpp b/utils/common/src/print_sensor_data.cpp index 985a1f6ed474cf45d95da9ffcccb9dc09aa30bc8..c9306c34b0ac49d862c97d5330b45725d1878b53 100644 --- a/utils/common/src/print_sensor_data.cpp +++ b/utils/common/src/print_sensor_data.cpp @@ -43,20 +43,22 @@ constexpr int32_t FIRST_PRINT_TIMES = 20; constexpr float LOG_FORMAT_DIVIDER = 1e9f; const std::vector g_triggerSensorType = { + SENSOR_TYPE_ID_DROP_DETECTION, + SENSOR_TYPE_ID_HALL, SENSOR_TYPE_ID_HALL_EXT, SENSOR_TYPE_ID_PROXIMITY, - SENSOR_TYPE_ID_HALL, - SENSOR_TYPE_ID_WEAR_DETECTION, SENSOR_TYPE_ID_PROXIMITY1, + SENSOR_TYPE_ID_WEAR_DETECTION, }; const std::vector g_continuousSensorType = { SENSOR_TYPE_ID_ACCELEROMETER, - SENSOR_TYPE_ID_POSTURE, SENSOR_TYPE_ID_AMBIENT_LIGHT, SENSOR_TYPE_ID_AMBIENT_LIGHT1, + SENSOR_TYPE_ID_GRAVITY, SENSOR_TYPE_ID_GYROSCOPE, SENSOR_TYPE_ID_MAGNETIC_FIELD, SENSOR_TYPE_ID_ORIENTATION, + SENSOR_TYPE_ID_POSTURE, SENSOR_TYPE_ID_ROTATION_VECTOR, }; } @@ -90,7 +92,7 @@ void PrintSensorData::ControlSensorHdiPrint(const SensorData &sensorData) it->second.hdiTimesFlag = sensorData.timestamp; } if (sensorData.timestamp - it->second.hdiTimesFlag >= LOG_INTERVAL) { - SEN_HILOGI("sensorType: %{public}d, hdiTimes:%{public}s", sensorData.sensorTypeId, + SEN_HILOGI("sensorType:%{public}d, hdiTimes:%{public}s", sensorData.sensorTypeId, std::to_string(it->second.hdiTimes).c_str()); it->second.hdiTimesFlag = sensorData.timestamp; it->second.hdiTimes = 0; @@ -142,6 +144,7 @@ void PrintSensorData::ProcessHdiDFX(const SensorData &sensorData) int32_t PrintSensorData::GetDataDimension(int32_t sensorType) { switch (sensorType) { + case SENSOR_TYPE_ID_DROP_DETECTION: case SENSOR_TYPE_ID_HALL: case SENSOR_TYPE_ID_PROXIMITY: case SENSOR_TYPE_ID_WEAR_DETECTION: @@ -149,6 +152,7 @@ int32_t PrintSensorData::GetDataDimension(int32_t sensorType) case SENSOR_TYPE_ID_AMBIENT_LIGHT: case SENSOR_TYPE_ID_AMBIENT_LIGHT1: case SENSOR_TYPE_ID_ACCELEROMETER: + case SENSOR_TYPE_ID_GRAVITY: case SENSOR_TYPE_ID_GYROSCOPE: case SENSOR_TYPE_ID_MAGNETIC_FIELD: case SENSOR_TYPE_ID_ORIENTATION: