phy: fix cca ed level parameter parsing
Alexander Aring
maintainerPATCH 1/3 phy: fix cca ed level parameter parsing
This patch fix the parsing of cca ed level parameter which is now an floating point dbm value.
--- src/phy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
src/phy.c +2 -2
@@ -121,14 +121,14 @@ static int handle_cca_ed_level(struct nl802154_state *state, int argc, char **argv, enum id_input id) { - long level; + float level;char *end;if (argc <1 )return 1 ;/* CCA_ED_LEVEL */ - level =strtol (argv[0 ], &end,10 ); + level =strtof (argv[0 ], &end);if (*end !='\0' )return 1 ;
Signature · 1 line
2.4.1
Alexander Aring
maintainerPATCH 2/3 info: fix tx power printout
This patch uses the format string "%.3g" instead "%.2g" for current tx power value. This is the same format string like we use to printout all supported tx power values.
--- src/info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/info.c +1 -1
@@ -95,7 +95,7 @@ static int print_phy_handler(struct nl_msg *msg, void *arg) }if (tb_msg[NL802154_ATTR_TX_POWER ]) -printf ("tx_power: %.2g\n" ,MBM_TO_DBM (nla_get_s32 (tb_msg[NL802154_ATTR_TX_POWER ]))); +printf ("tx_power: %.3g\n" ,MBM_TO_DBM (nla_get_s32 (tb_msg[NL802154_ATTR_TX_POWER ])));if (tb_msg[NL802154_ATTR_WPAN_PHY_CAPS ]) {struct nlattr *tb_caps[NL802154_CAP_ATTR_MAX +1 ];
Signature · 1 line
2.4.1
Re: [PATCH wpan-tools 2/3] info: fix tx power printout
Quoted 5 lines · Alexander Aring
This patch uses the format string "%.3g" instead "%.2g" for current tx power value. This is the same format string like we use to printout all supported tx power values.
Signed-off-by Alexander Aring <[email protected]>
Signature · 1 line
Varka Bhadram
Alexander Aring
maintainerPATCH 3/3 info: add support for cca ed level info
In reply to Alexander AringThis patch adds support for dumping the current cca ed level value.
--- src/info.c | 3 +++ 1 file changed, 3 insertions(+)
src/info.c +3 -0
@@ -94,6 +94,9 @@ static int print_phy_handler(struct nl_msg *msg, void *arg)printf ("\n" ); } +if (tb_msg[NL802154_ATTR_CCA_ED_LEVEL ]) +printf ("cca_ed_level: %.3g\n" ,MBM_TO_DBM (nla_get_s32 (tb_msg[NL802154_ATTR_CCA_ED_LEVEL ]))); +if (tb_msg[NL802154_ATTR_TX_POWER ])printf ("tx_power: %.3g\n" ,MBM_TO_DBM (nla_get_s32 (tb_msg[NL802154_ATTR_TX_POWER ])));
Signature · 1 line
2.4.1
Re: [PATCH wpan-tools 3/3] info: add support for cca ed level info
Quoted 3 lines · Alexander Aring
This patch adds support for dumping the current cca ed level value.
Signed-off-by Alexander Aring <[email protected]>
Signature · 1 line
Varka Bhadram
Quoted 4 lines · Alexander Aring
This patch fix the parsing of cca ed level parameter which is now an floating point dbm value.
Signed-off-by Alexander Aring <[email protected]>
Signature · 1 line
Varka Bhadram