diff --git a/system/sensortest/sensortest.c b/system/sensortest/sensortest.c index 925dac24030..73b8db17756 100644 --- a/system/sensortest/sensortest.c +++ b/system/sensortest/sensortest.c @@ -90,6 +90,8 @@ static const struct sensor_info g_sensor_info[] = {print_valf2, sizeof(struct sensor_baro), "baro"}, {print_cap, sizeof(struct sensor_cap), "cap"}, {print_valf, sizeof(struct sensor_co2), "co2"}, + {print_valf, sizeof(struct sensor_current), + "current"}, {print_valf, sizeof(struct sensor_dust), "dust"}, {print_ecg, sizeof(struct sensor_ecg), "ecg"}, {print_force, sizeof(struct sensor_force), "force"}, @@ -112,6 +114,7 @@ static const struct sensor_info g_sensor_info[] = {print_valf, sizeof(struct sensor_pm10), "pm10"}, {print_valf, sizeof(struct sensor_pm1p0), "pm1p0"}, {print_valf, sizeof(struct sensor_pm25), "pm25"}, + {print_valf, sizeof(struct sensor_power), "power"}, {print_ppgd, sizeof(struct sensor_ppgd), "ppgd"}, {print_ppgq, sizeof(struct sensor_ppgq), "ppgq"}, {print_valf, sizeof(struct sensor_prox), "prox"}, @@ -120,7 +123,9 @@ static const struct sensor_info g_sensor_info[] = sizeof(struct sensor_velocity), "velocity"}, {print_valf, sizeof(struct sensor_temp), "temp"}, {print_valf, sizeof(struct sensor_tvoc), "tvoc"}, - {print_valf, sizeof(struct sensor_uv), "uv"} + {print_valf, sizeof(struct sensor_uv), "uv"}, + {print_valf, sizeof(struct sensor_voltage), + "voltage"} }; /**************************************************************************** @@ -130,6 +135,7 @@ static const struct sensor_info g_sensor_info[] = static void print_vec3(const char *buffer, const char *name) { FAR struct sensor_accel *event = (FAR struct sensor_accel *)buffer; + printf("%s: timestamp:%" PRIu64 " x:%.2f y:%.2f z:%.2f, " "temperature:%.2f\n", name, event->timestamp, event->x, event->y, @@ -139,6 +145,7 @@ static void print_vec3(const char *buffer, const char *name) static void print_valb(const char *buffer, const char *name) { FAR struct sensor_hall *event = (FAR struct sensor_hall *)buffer; + printf("%s: timestamp:%" PRIu64 " value:%" PRIi32 "\n", name, event->timestamp, event->hall); } @@ -146,6 +153,7 @@ static void print_valb(const char *buffer, const char *name) static void print_vali2(const char *buffer, const char *name) { FAR struct sensor_ots *event = (FAR struct sensor_ots *)buffer; + printf("%s: timestamp:%" PRIu64 " value1:% " PRIi32 " value2:% " PRIi32 "\n", name, event->timestamp, event->x, event->y); } @@ -153,6 +161,7 @@ static void print_vali2(const char *buffer, const char *name) static void print_valf(const char *buffer, const char *name) { FAR struct sensor_prox *event = (FAR struct sensor_prox *)buffer; + printf("%s: timestamp:%" PRIu64 " value:%.2f\n", name, event->timestamp, event->proximity); } @@ -160,6 +169,7 @@ static void print_valf(const char *buffer, const char *name) static void print_valf2(const char *buffer, const char *name) { FAR struct sensor_baro *event = (FAR struct sensor_baro *)buffer; + printf("%s: timestamp:%" PRIu64 " value1:%.2f value2:%.2f\n", name, event->timestamp, event->pressure, event->temperature); } @@ -167,6 +177,7 @@ static void print_valf2(const char *buffer, const char *name) static void print_valf3(const char *buffer, const char *name) { FAR struct sensor_rgb *event = (FAR struct sensor_rgb *)buffer; + printf("%s: timestamp:%" PRIu64 " value1:%.2f value2:%.2f, value3:%.2f\n", name, event->timestamp, event->r, event->g, event->b); } @@ -174,6 +185,7 @@ static void print_valf3(const char *buffer, const char *name) static void print_ecg(const char *buffer, const char *name) { struct sensor_ecg *event = (struct sensor_ecg *)buffer; + printf("%s: timestamp:%" PRIu64 " ecg:%.4f status:%" PRIu32, name, event->timestamp, event->ecg, event->status); } @@ -189,6 +201,7 @@ static void print_force(const char *buffer, const char *name) static void print_ppgd(const char *buffer, const char *name) { FAR struct sensor_ppgd *event = (FAR struct sensor_ppgd *)buffer; + printf("%s: timestamp:%" PRIu64 " ppg1:%" PRIu32 " ppg2:%" PRIu32 " " "current:%" PRIu32 " gain1:%" PRIu16 " gain2:%" PRIu16 "\n", name, event->timestamp, event->ppg[0], event->ppg[1], @@ -198,6 +211,7 @@ static void print_ppgd(const char *buffer, const char *name) static void print_ppgq(const char *buffer, const char *name) { FAR struct sensor_ppgq *event = (FAR struct sensor_ppgq *)buffer; + printf("%s: timestamp:%" PRIu64 " ppg1:%" PRIu32 " ppg2:%" PRIu32 " " "ppg3:%" PRIu32 " ppg4:%" PRIu32 " current:%" PRIu32 " " "gain1:%" PRIu16 " gain2:%" PRIu16 " gain3:%" PRIu16 " " @@ -210,6 +224,7 @@ static void print_ppgq(const char *buffer, const char *name) static void print_cap(FAR const char *buffer, FAR const char *name) { FAR struct sensor_cap *event = (FAR struct sensor_cap *)buffer; + printf("%s: timestamp:%" PRIu64 " status:%" PRIu32 " " "rawdata0:%" PRIu32 " rawdata1:%" PRIu32 " rawdata2:%" PRIu32 " " "rawdata3:%" PRIu32 "\n",