diff --git a/sys/include/phydat.h b/sys/include/phydat.h index 77062314f3..96e7c87817 100644 --- a/sys/include/phydat.h +++ b/sys/include/phydat.h @@ -94,6 +94,7 @@ enum { UNIT_A, /**< Ampere */ UNIT_V, /**< Volts */ UNIT_GS, /**< gauss */ + UNIT_DBM, /**< decibel-milliwatts */ /* pressure */ UNIT_BAR, /**< Beer? */ UNIT_PA, /**< Pascal */ diff --git a/sys/phydat/phydat_str.c b/sys/phydat/phydat_str.c index a10fd7aee6..c97666ee94 100644 --- a/sys/phydat/phydat_str.c +++ b/sys/phydat/phydat_str.c @@ -42,6 +42,7 @@ void phydat_dump(phydat_t *data, uint8_t dim) case UNIT_PERCENT: case UNIT_TEMP_C: case UNIT_TEMP_F: + case UNIT_DBM: /* no string conversion */ scale_prefix = '\0'; break; @@ -91,6 +92,7 @@ const char *phydat_unit_to_str(uint8_t unit) case UNIT_GR: return "G"; case UNIT_A: return "A"; case UNIT_V: return "V"; + case UNIT_DBM: return "dBm"; case UNIT_GS: return "Gs"; case UNIT_BAR: return "Bar"; case UNIT_PA: return "Pa";