From e084781afc99075c4154614b49d99d3308d8c8ee Mon Sep 17 00:00:00 2001 From: Andre Heider Date: Tue, 22 Nov 2022 09:45:23 +0100 Subject: utils: add helper functions to get names by values Some defines/enums use bits, while some functions only set a single one. Make it less painful to get to a name for those. This avoids hardcoding bit lists for consumers. Signed-off-by: Andre Heider --- include/iwinfo/utils.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/iwinfo/utils.h b/include/iwinfo/utils.h index e9b8f1d..a7645de 100644 --- a/include/iwinfo/utils.h +++ b/include/iwinfo/utils.h @@ -43,6 +43,9 @@ static inline int iwinfo_mbm2dbm(int gain) return gain / 100; } +const char * const iwinfo_band_name(int mask); +const char * const iwinfo_htmode_name(int mask); + size_t iwinfo_format_hwmodes(int modes, char *buf, size_t len); int iwinfo_htmode_is_ht(int htmode); int iwinfo_htmode_is_vht(int htmode); -- cgit v1.2.1