From 3263a74925f4f6185ee356ef96daed056b0c1537 Mon Sep 17 00:00:00 2001 From: Justin Hammond Date: Sun, 20 Sep 2026 16:58:20 +0800 Subject: [PATCH 1/2] system/sensortest: Add rows for the voltage, current and power topics. The three electrical topics exist and publish, but sensortest rejects their node names before opening them: its table is matched by name and carries each structure's size, so a type without a row is one the tool cannot read at all. All three are a timestamp and a single value, the shape print_valf already handles. Signed-off-by: Justin Hammond --- system/sensortest/sensortest.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/system/sensortest/sensortest.c b/system/sensortest/sensortest.c index 925dac24030..243212b6ecb 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"} }; /**************************************************************************** From ae602e3e61096f17f7973cc8f8b7ad356a08a01d Mon Sep 17 00:00:00 2001 From: Justin Hammond Date: Sun, 20 Sep 2026 16:59:49 +0800 Subject: [PATCH 2/2] system/sensortest: Put a blank line after the declarations. Each of the ten print helpers opens with a declaration followed immediately by its printf, which nxstyle reports as an error on every one of them. The file cannot be checked cleanly until they are fixed, so a later change to it starts from a failing run and has to sort its own errors from the existing ones. Whitespace only. git diff -w is empty. Signed-off-by: Justin Hammond --- system/sensortest/sensortest.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/system/sensortest/sensortest.c b/system/sensortest/sensortest.c index 243212b6ecb..73b8db17756 100644 --- a/system/sensortest/sensortest.c +++ b/system/sensortest/sensortest.c @@ -135,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, @@ -144,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); } @@ -151,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); } @@ -158,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); } @@ -165,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); } @@ -172,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); } @@ -179,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); } @@ -194,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], @@ -203,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 " " @@ -215,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",