From 3c287c058d12862b329abe720158d1c90f0a65f4 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Tue, 21 Feb 2023 12:19:50 +0100 Subject: [PATCH] sys/phydat: Fix unit confusion Previously, `UNIT_G` was used for g-force with the correct symbol `g`, `UNIT_GR` for gram (as in kilogram) with the incorrect symbol `G` (which would be correct for Gauss), and `UNIT_GS` for Gauss with symbol `Gs` (which is an uncommon but correct symbol). To avoid confusion between G-Force, Gauss, and Gram the units have been renamed to `UNIT_G_FORCE`, `UNIT_GRAM`, and `UNIT_GAUSS`. In addition, gram now uses the correct symbol `g` and Gauss uses `G`. --- drivers/adxl345/adxl345_saul.c | 2 +- drivers/bmx055/bmx055_saul.c | 4 ++-- drivers/fxos8700/fxos8700_saul.c | 4 ++-- drivers/hmc5883l/hmc5883l_saul.c | 2 +- drivers/lis2dh12/lis2dh12_saul.c | 2 +- drivers/lis3dh/lis3dh_saul.c | 2 +- drivers/lis3mdl/lis3mdl_saul.c | 2 +- drivers/lsm303dlhc/lsm303dlhc_saul.c | 4 ++-- drivers/lsm6dsl/lsm6dsl_saul.c | 2 +- drivers/mag3110/mag3110_saul.c | 2 +- drivers/mma7660/mma7660_saul.c | 2 +- drivers/mma8x5x/mma8x5x_saul.c | 2 +- drivers/mpu9x50/mpu9x50_saul.c | 4 ++-- drivers/qmc5883l/qmc5883l_saul.c | 2 +- sys/include/phydat.h | 9 ++++++--- sys/include/senml/phydat.h | 6 +++--- sys/phydat/phydat_str.c | 6 +++--- sys/senml/phydat.c | 12 ++++++------ tests/phydat_dump/main.c | 6 +++--- tests/phydat_dump/tests/01-run.py | 8 ++++---- tests/senml_phydat/main.c | 4 ++-- tests/unittests/tests-phydat/tests-phydat.c | 10 +++++----- 22 files changed, 50 insertions(+), 47 deletions(-) diff --git a/drivers/adxl345/adxl345_saul.c b/drivers/adxl345/adxl345_saul.c index 432e249595..594961e8d9 100644 --- a/drivers/adxl345/adxl345_saul.c +++ b/drivers/adxl345/adxl345_saul.c @@ -25,7 +25,7 @@ static int read_acc(const void *dev, phydat_t *res) { adxl345_read((const adxl345_t *)dev, (adxl345_data_t *)res->val); - res->unit = UNIT_G; + res->unit = UNIT_G_FORCE; res->scale = -3; return 3; } diff --git a/drivers/bmx055/bmx055_saul.c b/drivers/bmx055/bmx055_saul.c index a84cd8e15f..5d738b8e33 100644 --- a/drivers/bmx055/bmx055_saul.c +++ b/drivers/bmx055/bmx055_saul.c @@ -29,7 +29,7 @@ static int read_mag(const void *dev, phydat_t *res) if (bmx055_mag_read(mydev, res->val) != BMX055_OK) { return 0; } - res->unit = UNIT_GS; + res->unit = UNIT_GAUSS; res->scale = 0; return 3; } @@ -41,7 +41,7 @@ static int read_acc(const void *dev, phydat_t *res) if (bmx055_acc_read(mydev, res->val) != BMX055_OK) { return 0; } - res->unit = UNIT_G; + res->unit = UNIT_G_FORCE; res->scale = -3; return 3; } diff --git a/drivers/fxos8700/fxos8700_saul.c b/drivers/fxos8700/fxos8700_saul.c index e9954f9461..7a46b5864c 100644 --- a/drivers/fxos8700/fxos8700_saul.c +++ b/drivers/fxos8700/fxos8700_saul.c @@ -31,7 +31,7 @@ static int read_mag(const void *dev, phydat_t *res) /* Read failure */ return -ECANCELED; } - res->unit = UNIT_GS; + res->unit = UNIT_GAUSS; res->scale = -3; return 3; } @@ -48,7 +48,7 @@ static int read_acc(const void *dev, phydat_t *res) res->scale = 0; } else { - res->unit = UNIT_G; + res->unit = UNIT_G_FORCE; if (((fxos8700_t *)dev)->p.acc_range == FXOS8700_REG_XYZ_DATA_CFG_FS__2G) { res->scale = -4; } diff --git a/drivers/hmc5883l/hmc5883l_saul.c b/drivers/hmc5883l/hmc5883l_saul.c index 63cf50de5f..ae1b5e2d82 100644 --- a/drivers/hmc5883l/hmc5883l_saul.c +++ b/drivers/hmc5883l/hmc5883l_saul.c @@ -28,7 +28,7 @@ static int read(const void *dev, phydat_t *res) res->val[0] = data.x; res->val[1] = data.y; res->val[2] = data.z; - res->unit = UNIT_GS; + res->unit = UNIT_GAUSS; res->scale = -3; return 3; } diff --git a/drivers/lis2dh12/lis2dh12_saul.c b/drivers/lis2dh12/lis2dh12_saul.c index 5fe3d319c8..6f4f574af9 100644 --- a/drivers/lis2dh12/lis2dh12_saul.c +++ b/drivers/lis2dh12/lis2dh12_saul.c @@ -26,7 +26,7 @@ static int read_accelerometer(const void *dev, phydat_t *res) if (lis2dh12_read(dev, (lis2dh12_fifo_data_t*)res->val) != LIS2DH12_OK) { return 0; } - res->unit = UNIT_G; + res->unit = UNIT_G_FORCE; res->scale = -3; return 3; } diff --git a/drivers/lis3dh/lis3dh_saul.c b/drivers/lis3dh/lis3dh_saul.c index 03cb933a09..bbf6bd94e4 100644 --- a/drivers/lis3dh/lis3dh_saul.c +++ b/drivers/lis3dh/lis3dh_saul.c @@ -39,7 +39,7 @@ static int read_acc(const void *dev, phydat_t *res) res->val[2] = xyz.acc_z; /* unit: milli-G */ res->scale = -3; - res->unit = UNIT_G; + res->unit = UNIT_G_FORCE; return 3; } diff --git a/drivers/lis3mdl/lis3mdl_saul.c b/drivers/lis3mdl/lis3mdl_saul.c index 93efec2ecb..92c95c6a07 100644 --- a/drivers/lis3mdl/lis3mdl_saul.c +++ b/drivers/lis3mdl/lis3mdl_saul.c @@ -29,7 +29,7 @@ static int read_mag(const void *dev, phydat_t *res) lis3mdl_read_mag(d, (lis3mdl_3d_data_t *)res); - res->unit = UNIT_GS; + res->unit = UNIT_GAUSS; res->scale = -3; return 3; } diff --git a/drivers/lsm303dlhc/lsm303dlhc_saul.c b/drivers/lsm303dlhc/lsm303dlhc_saul.c index 461ad66f05..f89b31f7f8 100644 --- a/drivers/lsm303dlhc/lsm303dlhc_saul.c +++ b/drivers/lsm303dlhc/lsm303dlhc_saul.c @@ -34,7 +34,7 @@ static int read_acc(const void *dev, phydat_t *res) res->val[i] *= fac; } - res->unit = UNIT_G; + res->unit = UNIT_G_FORCE; res->scale = -3; return 3; } @@ -63,7 +63,7 @@ static int read_mag(const void *dev, phydat_t *res) res->val[i] = (int16_t)tmp; } - res->unit = UNIT_GS; + res->unit = UNIT_GAUSS; res->scale = -3; return 3; } diff --git a/drivers/lsm6dsl/lsm6dsl_saul.c b/drivers/lsm6dsl/lsm6dsl_saul.c index 1a51f25fe2..39ac219cc4 100644 --- a/drivers/lsm6dsl/lsm6dsl_saul.c +++ b/drivers/lsm6dsl/lsm6dsl_saul.c @@ -31,7 +31,7 @@ static int read_acc(const void *dev, phydat_t *res) } res->scale = -3; - res->unit = UNIT_G; + res->unit = UNIT_G_FORCE; return 3; } diff --git a/drivers/mag3110/mag3110_saul.c b/drivers/mag3110/mag3110_saul.c index 0821ce4c20..f81ba62487 100644 --- a/drivers/mag3110/mag3110_saul.c +++ b/drivers/mag3110/mag3110_saul.c @@ -28,7 +28,7 @@ static int read_mag(const void *dev, phydat_t *res) { mag3110_read((const mag3110_t *)dev, (mag3110_data_t *)res->val); - res->unit = UNIT_GS; + res->unit = UNIT_GAUSS; res->scale = 2; return 3; diff --git a/drivers/mma7660/mma7660_saul.c b/drivers/mma7660/mma7660_saul.c index 411e0d65e8..39860ac548 100644 --- a/drivers/mma7660/mma7660_saul.c +++ b/drivers/mma7660/mma7660_saul.c @@ -28,7 +28,7 @@ static int read_acc(const void *dev, phydat_t *res) { mma7660_read((const mma7660_t *)dev, (mma7660_data_t *)res->val); - res->unit = UNIT_G; + res->unit = UNIT_G_FORCE; res->scale = -3; return 3; diff --git a/drivers/mma8x5x/mma8x5x_saul.c b/drivers/mma8x5x/mma8x5x_saul.c index 8a925d740c..5c4be8dea3 100644 --- a/drivers/mma8x5x/mma8x5x_saul.c +++ b/drivers/mma8x5x/mma8x5x_saul.c @@ -29,7 +29,7 @@ static int read_acc(const void *dev, phydat_t *res) { mma8x5x_read((const mma8x5x_t *)dev, (mma8x5x_data_t *)res->val); - res->unit = UNIT_G; + res->unit = UNIT_G_FORCE; res->scale = -3; return 3; diff --git a/drivers/mpu9x50/mpu9x50_saul.c b/drivers/mpu9x50/mpu9x50_saul.c index 302cc4538e..f06b94e2ab 100644 --- a/drivers/mpu9x50/mpu9x50_saul.c +++ b/drivers/mpu9x50/mpu9x50_saul.c @@ -33,7 +33,7 @@ static int read_acc(const void *dev, phydat_t *res) } res->scale = -3; - res->unit = UNIT_G; + res->unit = UNIT_G_FORCE; return 3; } @@ -59,7 +59,7 @@ static int read_mag(const void *dev, phydat_t *res) } res->scale = -2; - res->unit = UNIT_GS; + res->unit = UNIT_GAUSS; return 3; } diff --git a/drivers/qmc5883l/qmc5883l_saul.c b/drivers/qmc5883l/qmc5883l_saul.c index 266b46e155..ed68e4aaaf 100644 --- a/drivers/qmc5883l/qmc5883l_saul.c +++ b/drivers/qmc5883l/qmc5883l_saul.c @@ -27,7 +27,7 @@ static int read(const void *dev, phydat_t *res) { int ret = qmc5883l_read((const qmc5883l_t *)dev, res->val); if ((ret == QMC5883L_OK) || (ret == QMC5883L_OVERFLOW)) { - res->unit = UNIT_GS; + res->unit = UNIT_GAUSS; res->scale = -3; return 3; } diff --git a/sys/include/phydat.h b/sys/include/phydat.h index d4083b2a25..e7847ce549 100644 --- a/sys/include/phydat.h +++ b/sys/include/phydat.h @@ -87,16 +87,19 @@ enum { UNIT_M2, /**< square meters */ UNIT_M3, /**< cubic meters */ /* kinetic */ - UNIT_G, /**< gravitational force */ + UNIT_G_FORCE, /**< gravitational force equivalent */ + UNIT_G = UNIT_G_FORCE, /**< @deprecated, use UNIT_G_FORCE instead */ UNIT_DPS, /**< degree per second */ /* weight */ - UNIT_GR, /**< grams - not using the SI unit (kg) here to make scale + UNIT_GRAM, /**< grams - not using the SI unit (kg) here to make scale * handling simpler */ + UNIT_GR = UNIT_GRAM, /**< @deprecated, use UNIT_GRAM instead */ /* electricity */ UNIT_A, /**< Ampere */ UNIT_V, /**< Volts */ UNIT_W, /**< Watt */ - UNIT_GS, /**< gauss */ + UNIT_GAUSS, /**< gauss */ + UNIT_GS = UNIT_GAUSS, /**< @deprecated, use UNIT_GAUSS instead */ UNIT_T, /**< Tesla */ UNIT_DBM, /**< decibel-milliwatts */ UNIT_COULOMB, /**< coulomb */ diff --git a/sys/include/senml/phydat.h b/sys/include/senml/phydat.h index 1c645c5444..8ebfb1a200 100644 --- a/sys/include/senml/phydat.h +++ b/sys/include/senml/phydat.h @@ -58,10 +58,10 @@ void phydat_to_senml_bool(senml_bool_value_t *senml, const phydat_t *phydat, con * * - @ref UNIT_TIME is converted to @ref SENML_UNIT_SECOND. * - @ref UNIT_F is converted to @ref SENML_UNIT_KELVIN. - * - @ref UNIT_G is converted to @ref SENML_UNIT_METER_PER_SQUARE_SECOND. + * - @ref UNIT_G_FORCE is converted to @ref SENML_UNIT_METER_PER_SQUARE_SECOND. * - @ref UNIT_BAR is converted to @ref SENML_UNIT_PASCAL. * - @ref UNIT_GPM3 is converted to @ref SENML_UNIT_KILOGRAM_PER_CUBIC_METER. - * - @ref UNIT_GS is converted to @ref SENML_UNIT_TESLA. + * - @ref UNIT_GAUSS is converted to @ref SENML_UNIT_TESLA. * - Compatible units are set to their SenML equivalent. * - Incompatible (or unknown) units are set to @ref SENML_UNIT_NONE. * @@ -80,7 +80,7 @@ void phydat_to_senml_float(senml_value_t *senml, const phydat_t *phydat, const u * - @ref UNIT_TIME is converted to @ref SENML_UNIT_SECOND. * - @ref UNIT_BAR is converted to @ref SENML_UNIT_PASCAL. * - @ref UNIT_GPM3 is converted to @ref SENML_UNIT_KILOGRAM_PER_CUBIC_METER. - * - @ref UNIT_GS is converted to @ref SENML_UNIT_TESLA. + * - @ref UNIT_GAUSS is converted to @ref SENML_UNIT_TESLA. * - Compatible units are set to their SenML equivalent. * - Incompatible (or unknown) units are set to @ref SENML_UNIT_NONE. * diff --git a/sys/phydat/phydat_str.c b/sys/phydat/phydat_str.c index bad60643f3..566a1ca8a2 100644 --- a/sys/phydat/phydat_str.c +++ b/sys/phydat/phydat_str.c @@ -106,14 +106,14 @@ const char *phydat_unit_to_str(uint8_t unit) case UNIT_M: return "m"; case UNIT_M2: return "m^2"; case UNIT_M3: return "m^3"; - case UNIT_G: return "g"; + case UNIT_G_FORCE: return "gₙ"; case UNIT_DPS: return "dps"; - case UNIT_GR: return "G"; + case UNIT_GRAM: return "g"; case UNIT_A: return "A"; case UNIT_V: return "V"; case UNIT_W: return "W"; case UNIT_DBM: return "dBm"; - case UNIT_GS: return "Gs"; + case UNIT_GAUSS: return "Gs"; case UNIT_T: return "T"; case UNIT_BAR: return "Bar"; case UNIT_PA: return "Pa"; diff --git a/sys/senml/phydat.c b/sys/senml/phydat.c index 31b3c2dd48..d08a93a96b 100644 --- a/sys/senml/phydat.c +++ b/sys/senml/phydat.c @@ -24,7 +24,7 @@ static uint8_t phydat_unit_to_senml_unit(uint8_t unit) case UNIT_M: return SENML_UNIT_METER; case UNIT_M2: return SENML_UNIT_SQUARE_METER; case UNIT_M3: return SENML_UNIT_CUBIC_METER; - case UNIT_GR: return SENML_UNIT_GRAM; + case UNIT_GRAM: return SENML_UNIT_GRAM; case UNIT_A: return SENML_UNIT_AMPERE; case UNIT_V: return SENML_UNIT_VOLT; case UNIT_W: return SENML_UNIT_WATT; @@ -45,8 +45,8 @@ static uint8_t phydat_unit_to_senml_unit(uint8_t unit) /* Incompatible units */ case UNIT_TEMP_F: return SENML_UNIT_NONE; /* use K or Cel instead */ - case UNIT_GS: return SENML_UNIT_NONE; /* use T instead */ - case UNIT_G: return SENML_UNIT_NONE; /* use m/s2 instead */ + case UNIT_GAUSS: return SENML_UNIT_NONE; /* use T instead */ + case UNIT_G_FORCE: return SENML_UNIT_NONE; /* use m/s2 instead */ case UNIT_BAR: return SENML_UNIT_NONE; /* use Pa or hPa instead */ case UNIT_TIME: return SENML_UNIT_NONE; /* split into second/minute/hour */ case UNIT_DATE: return SENML_UNIT_NONE; /* split into day/month/year */ @@ -87,7 +87,7 @@ void phydat_to_senml_float(senml_value_t *senml, const phydat_t *phydat, const u value = (value + 459.67) * (5. / 9.); senml->attr.unit = SENML_UNIT_KELVIN; break; - case UNIT_G: + case UNIT_G_FORCE: /* convert gravitational acceleration to acceleration */ value *= 9.80665; senml->attr.unit = SENML_UNIT_METER_PER_SQUARE_SECOND; @@ -100,7 +100,7 @@ void phydat_to_senml_float(senml_value_t *senml, const phydat_t *phydat, const u value *= 0.001; senml->attr.unit = SENML_UNIT_KILOGRAM_PER_CUBIC_METER; break; - case UNIT_GS: + case UNIT_GAUSS: value *= 0.0001; senml->attr.unit = SENML_UNIT_TESLA; break; @@ -138,7 +138,7 @@ void phydat_to_senml_decimal(senml_value_t *senml, const phydat_t *phydat, const e -= 3; senml->attr.unit = SENML_UNIT_KILOGRAM_PER_CUBIC_METER; break; - case UNIT_GS: + case UNIT_GAUSS: e -= 4; senml->attr.unit = SENML_UNIT_TESLA; break; diff --git a/tests/phydat_dump/main.c b/tests/phydat_dump/main.c index f4225b78c7..dc18897645 100644 --- a/tests/phydat_dump/main.c +++ b/tests/phydat_dump/main.c @@ -39,13 +39,13 @@ _phydat_test_t _test_vector[] = { .dim = 3, .dat = { .val = { 1234, 13456, -14567 }, .unit = UNIT_M, .scale = -3 } }, { .dim = 1, .dat = { .val = { -12345 }, .unit = UNIT_M2, .scale = -5 } }, { .dim = 1, .dat = { .val = { -12345 }, .unit = UNIT_M3, .scale = -6 } }, - { .dim = 3, .dat = { .val = { 12, 34, 5678}, .unit = UNIT_G, .scale = -2 } }, + { .dim = 3, .dat = { .val = { 12, 34, 5678}, .unit = UNIT_G_FORCE, .scale = -2 } }, { .dim = 3, .dat = { .val = { 123, 345, 678 }, .unit = UNIT_DPS, .scale = -3 } }, - { .dim = 1, .dat = { .val = { 12345 }, .unit = UNIT_GR, .scale = -1 } }, + { .dim = 1, .dat = { .val = { 12345 }, .unit = UNIT_GRAM, .scale = -1 } }, { .dim = 1, .dat = { .val = { 12345 }, .unit = UNIT_A, .scale = 3 } }, { .dim = 1, .dat = { .val = { 12345 }, .unit = UNIT_V, .scale = 6 } }, { .dim = 1, .dat = { .val = { 12345 }, .unit = UNIT_W, .scale = 7 } }, - { .dim = 1, .dat = { .val = { 12345 }, .unit = UNIT_GS, .scale = -1 } }, + { .dim = 1, .dat = { .val = { 12345 }, .unit = UNIT_GAUSS, .scale = -1 } }, { .dim = 3, .dat = { .val = { 123, 456, 789 }, .unit = UNIT_T, .scale = -9 } }, { .dim = 1, .dat = { .val = { 12345 }, .unit = UNIT_DBM, .scale = -3 } }, { .dim = 1, .dat = { .val = { 12345 }, .unit = UNIT_COULOMB, .scale = 0 } }, diff --git a/tests/phydat_dump/tests/01-run.py b/tests/phydat_dump/tests/01-run.py index 670c589e06..5da3e79015 100755 --- a/tests/phydat_dump/tests/01-run.py +++ b/tests/phydat_dump/tests/01-run.py @@ -33,13 +33,13 @@ def testfunc(child): child.expect(r'\t\[2\] -14567 mm\r\n') child.expect(r'Data:\t -0.12345 m\^2\r\n') child.expect(r'Data:\t -12345e-6 m\^3\r\n') - child.expect(r'Data:\t\[0\] 0.12 g\r\n') - child.expect(r'\t\[1\] 0.34 g\r\n') - child.expect(r'\t\[2\] 56.78 g\r\n') + child.expect(r'Data:\t\[0\] 0.12 gₙ\r\n') + child.expect(r'\t\[1\] 0.34 gₙ\r\n') + child.expect(r'\t\[2\] 56.78 gₙ\r\n') child.expect(r'Data:\t\[0\] 123 mdps\r\n') child.expect(r'\t\[1\] 345 mdps\r\n') child.expect(r'\t\[2\] 678 mdps\r\n') - child.expect(r'Data:\t 1234.5 G\r\n') + child.expect(r'Data:\t 1234.5 g\r\n') child.expect(r'Data:\t 12345 kA\r\n') child.expect(r'Data:\t 12345 MV\r\n') child.expect(r'Data:\t 12345e7 W\r\n') diff --git a/tests/senml_phydat/main.c b/tests/senml_phydat/main.c index 0781912f11..2704bb168d 100644 --- a/tests/senml_phydat/main.c +++ b/tests/senml_phydat/main.c @@ -84,7 +84,7 @@ static value_test_t value_tests[] = { .senml2 = senml_df(0, 3, SENML_UNIT_NONE), }, { - .phydat = { { 314, 0, 0 }, UNIT_G, -2 }, + .phydat = { { 314, 0, 0 }, UNIT_G_FORCE, -2 }, .senml1 = senml_f(30.792881, SENML_UNIT_METER_PER_SQUARE_SECOND), .senml2 = senml_df(314, -2, SENML_UNIT_NONE), }, @@ -99,7 +99,7 @@ static value_test_t value_tests[] = { .senml2 = senml_df(193, 2, SENML_UNIT_KILOGRAM_PER_CUBIC_METER), }, { - .phydat = { { 220, 0, 0 }, UNIT_GS, 3 }, + .phydat = { { 220, 0, 0 }, UNIT_GAUSS, 3 }, .senml1 = senml_f(22, SENML_UNIT_TESLA), .senml2 = senml_df(220, -1, SENML_UNIT_TESLA), } diff --git a/tests/unittests/tests-phydat/tests-phydat.c b/tests/unittests/tests-phydat/tests-phydat.c index 504f029db5..7287171a73 100644 --- a/tests/unittests/tests-phydat/tests-phydat.c +++ b/tests/unittests/tests-phydat/tests-phydat.c @@ -58,8 +58,8 @@ static tdat_t data[] = { }, { .dim = 3, - .dat = { { 1032, 10, -509 }, UNIT_G, -3 }, - .json = "{\"d\":[1.032,0.010,-0.509],\"u\":\"g\"}", + .dat = { { 1032, 10, -509 }, UNIT_G_FORCE, -3 }, + .json = "{\"d\":[1.032,0.010,-0.509],\"u\":\"gₙ\"}", }, { .dim = 3, @@ -204,14 +204,14 @@ static void test_unitstr__success(void) TEST_ASSERT_EQUAL_STRING("m", phydat_unit_to_str_verbose(UNIT_M)); TEST_ASSERT_EQUAL_STRING("m^2", phydat_unit_to_str_verbose(UNIT_M2)); TEST_ASSERT_EQUAL_STRING("m^3", phydat_unit_to_str_verbose(UNIT_M3)); - TEST_ASSERT_EQUAL_STRING("g", phydat_unit_to_str_verbose(UNIT_G)); + TEST_ASSERT_EQUAL_STRING("gₙ", phydat_unit_to_str_verbose(UNIT_G_FORCE)); TEST_ASSERT_EQUAL_STRING("dps", phydat_unit_to_str_verbose(UNIT_DPS)); - TEST_ASSERT_EQUAL_STRING("G", phydat_unit_to_str_verbose(UNIT_GR)); + TEST_ASSERT_EQUAL_STRING("g", phydat_unit_to_str_verbose(UNIT_GRAM)); TEST_ASSERT_EQUAL_STRING("A", phydat_unit_to_str_verbose(UNIT_A)); TEST_ASSERT_EQUAL_STRING("V", phydat_unit_to_str_verbose(UNIT_V)); TEST_ASSERT_EQUAL_STRING("W", phydat_unit_to_str_verbose(UNIT_W)); TEST_ASSERT_EQUAL_STRING("dBm", phydat_unit_to_str_verbose(UNIT_DBM)); - TEST_ASSERT_EQUAL_STRING("Gs", phydat_unit_to_str_verbose(UNIT_GS)); + TEST_ASSERT_EQUAL_STRING("Gs", phydat_unit_to_str_verbose(UNIT_GAUSS)); TEST_ASSERT_EQUAL_STRING("T", phydat_unit_to_str_verbose(UNIT_T)); TEST_ASSERT_EQUAL_STRING("Bar", phydat_unit_to_str_verbose(UNIT_BAR)); TEST_ASSERT_EQUAL_STRING("Pa", phydat_unit_to_str_verbose(UNIT_PA));