[sensor]修改传感器设备名称前缀

This commit is contained in:
Meco Man 2022-11-08 21:38:38 -05:00 committed by guo
parent 39b25f660a
commit f550fc58a9
1 changed files with 24 additions and 24 deletions

View File

@ -19,28 +19,28 @@
static char *const sensor_name_str[] = static char *const sensor_name_str[] =
{ {
"none", "None",
"acce_", /* Accelerometer */ "ac-", /* Accelerometer */
"gyro_", /* Gyroscope */ "gy-", /* Gyroscope */
"mag_", /* Magnetometer */ "ma-", /* Magnetometer */
"temp_", /* Temperature */ "tm-", /* Temperature */
"humi_", /* Relative Humidity */ "hm-", /* Relative Humidity */
"baro_", /* Barometer */ "br-", /* Barometer */
"li_", /* Ambient light */ "li-", /* Ambient light */
"pr_", /* Proximity */ "pr-", /* Proximity */
"hr_", /* Heart Rate */ "hr-", /* Heart Rate */
"tvoc_", /* TVOC Level */ "tv-", /* TVOC Level */
"noi_", /* Noise Loudness */ "ni-", /* Noise Loudness */
"step_", /* Step sensor */ "st-", /* Step sensor */
"forc_", /* Force sensor */ "fr-", /* Force sensor */
"dust_", /* Dust sensor */ "du-", /* Dust sensor */
"eco2_", /* eCO2 sensor */ "ec-", /* eCO2 sensor */
"gnss_", /* GPS/GNSS sensor */ "gn-", /* GPS/GNSS sensor */
"tof_", /* TOF sensor */ "tf-", /* TOF sensor */
"spo2_", /* SpO2 sensor */ "sp-", /* SpO2 sensor */
"iaq_", /* IAQ sensor */ "ia-", /* IAQ sensor */
"etoh_", /* EtOH sensor */ "et-", /* EtOH sensor */
"bp_" /* Blood Pressure */ "bp-" /* Blood Pressure */
}; };
/* sensor interrupt handler function */ /* sensor interrupt handler function */
@ -480,12 +480,12 @@ int rt_hw_sensor_register(rt_sensor_t sensor,
result = rt_device_register(device, device_name, flag | RT_DEVICE_FLAG_STANDALONE); result = rt_device_register(device, device_name, flag | RT_DEVICE_FLAG_STANDALONE);
if (result != RT_EOK) if (result != RT_EOK)
{ {
LOG_E("rt_sensor[%s] register err code: %d", device_name, result); LOG_E("sensor[%s] register err code: %d", device_name, result);
rt_free(device_name); rt_free(device_name);
return result; return result;
} }
LOG_I("rt_sensor[%s] init success", device_name); LOG_I("sensor[%s] init success", device_name);
rt_free(device_name); rt_free(device_name);
return RT_EOK; return RT_EOK;
} }