!641 Add acc&ambient_light1 for log print

Merge pull request !641 from 17349030869/master
This commit is contained in:
openharmony_ci 2024-09-06 11:23:31 +00:00 committed by Gitee
commit 55e39a14e0
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 11 additions and 0 deletions

View File

@ -50,8 +50,11 @@ private:
std::mutex clientLoginfoMutex_;
LogPrintInfo info_;
std::map<int32_t, LogPrintInfo> 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_MAGNETIC_FIELD, info_},
};
std::map<const SensorUser *, LogPrintInfo> clientLoginfo_;

View File

@ -41,10 +41,14 @@ const std::vector<int32_t> g_triggerSensorType = {
SENSOR_TYPE_ID_HALL_EXT,
SENSOR_TYPE_ID_PROXIMITY,
SENSOR_TYPE_ID_HALL,
SENSOR_TYPE_ID_WEAR_DETECTION,
};
const std::vector<int32_t> g_continuousSensorType = {
SENSOR_TYPE_ID_ACCELEROMETER,
SENSOR_TYPE_ID_POSTURE,
SENSOR_TYPE_ID_AMBIENT_LIGHT,
SENSOR_TYPE_ID_AMBIENT_LIGHT1,
SENSOR_TYPE_ID_GYROSCOPE,
SENSOR_TYPE_ID_MAGNETIC_FIELD,
};
}
@ -98,12 +102,16 @@ int32_t PrintSensorData::GetDataDimension(int32_t sensorId)
switch (sensorId) {
case SENSOR_TYPE_ID_HALL:
case SENSOR_TYPE_ID_PROXIMITY:
case SENSOR_TYPE_ID_WEAR_DETECTION:
return ONE_DIMENSION;
case SENSOR_TYPE_ID_HALL_EXT:
return TWO_DIMENSION;
case SENSOR_TYPE_ID_POSTURE:
return SEVEN_DIMENSION;
case SENSOR_TYPE_ID_AMBIENT_LIGHT:
case SENSOR_TYPE_ID_AMBIENT_LIGHT1:
case SENSOR_TYPE_ID_ACCELEROMETER:
case SENSOR_TYPE_ID_GYROSCOPE:
case SENSOR_TYPE_ID_MAGNETIC_FIELD:
return THREE_DIMENSION;
default: