@@ -372,11 +372,18 @@ static int print_phy_handler(struct nl_msg *msg, void *arg)
if (tb_caps[NL802154_CAP_ATTR_TX_POWERS]) {
int rem_pwrs;
+ int counter = 0;
struct nlattr *nl_pwrs;
printf("\ttx_powers: ");
- nla_for_each_nested(nl_pwrs, tb_caps[NL802154_CAP_ATTR_TX_POWERS], rem_pwrs)
- printf("%.3g,", MBM_TO_DBM(nla_get_s32(nl_pwrs)));
+ nla_for_each_nested(nl_pwrs, tb_caps[NL802154_CAP_ATTR_TX_POWERS], rem_pwrs) {
+ if (counter % 6 == 0) {
+ printf("\n\t\t\t%.3g dBM, ", MBM_TO_DBM(nla_get_s32(nl_pwrs)));
+ } else {
+ printf("%.3g dBM, ", MBM_TO_DBM(nla_get_s32(nl_pwrs)));
+ }
+ counter++;
+ }
/* TODO */
printf("\b \n");
}
Add unit, some spacing and break lines to make the output easier to understand and read. Fixes #7 Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com> --- src/info.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)