wireless: nxstyle fixes

fixes for the style errors reported by nxstyle

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
This commit is contained in:
Alin Jerpelea 2021-06-09 17:29:09 +02:00 committed by Xiang Xiao
parent 4cf4aa0bc8
commit c726646010
5 changed files with 34 additions and 26 deletions

View File

@ -73,7 +73,8 @@ static void btsak_advertise_showusage(FAR const char *progname,
*
****************************************************************************/
static void btsak_cmd_advertisestart(FAR struct btsak_s *btsak, FAR char *cmd,
static void btsak_cmd_advertisestart(FAR struct btsak_s *btsak,
FAR char *cmd,
int argc, FAR char *argv[])
{
struct btreq_s btreq;
@ -193,7 +194,8 @@ static void btsak_cmd_advertisestop(FAR struct btsak_s *btsak, FAR char *cmd,
*
****************************************************************************/
void btsak_cmd_advertise(FAR struct btsak_s *btsak, int argc, FAR char *argv[])
void btsak_cmd_advertise(FAR struct btsak_s *btsak,
int argc, FAR char *argv[])
{
int argind;
@ -222,7 +224,8 @@ void btsak_cmd_advertise(FAR struct btsak_s *btsak, int argc, FAR char *argv[])
}
else
{
fprintf(stderr, "ERROR: Unrecognized advertise command: %s\n", argv[argind]);
fprintf(stderr,
"ERROR: Unrecognized advertise command: %s\n", argv[argind]);
btsak_advertise_showusage(btsak->progname, argv[0], EXIT_FAILURE);
}
}

View File

@ -76,7 +76,9 @@ static void btsak_features_showusage(FAR const char *progname,
*
****************************************************************************/
void btsak_cmd_features(FAR struct btsak_s *btsak, int argc, FAR char *argv[])
void btsak_cmd_features(FAR struct btsak_s *btsak,
int argc,
FAR char *argv[])
{
struct btreq_s btreq;
int sockfd;

View File

@ -102,25 +102,25 @@ void btsak_cmd_info(FAR struct btsak_s *btsak, int argc, FAR char *argv[])
errno);
}
else
{
printf("Device: %s\n", btsak->ifname);
printf("BDAddr: %02x:%02x:%02x:%02x:%02x:%02x\n",
{
printf("Device: %s\n", btsak->ifname);
printf("BDAddr: %02x:%02x:%02x:%02x:%02x:%02x\n",
btreq.btr_bdaddr.val[5], btreq.btr_bdaddr.val[4],
btreq.btr_bdaddr.val[3], btreq.btr_bdaddr.val[2],
btreq.btr_bdaddr.val[1], btreq.btr_bdaddr.val[0]);
printf("Flags: %04x\n", btreq.btr_flags);
printf("Free: %u\n", btreq.btr_num_cmd);
printf(" ACL: %u\n", btreq.btr_num_acl);
printf(" SCO: %u\n", btreq.btr_num_sco);
printf("Max:\n");
printf(" ACL: %u\n", btreq.btr_max_acl);
printf(" SCO: %u\n", btreq.btr_max_sco);
printf("MTU:\n");
printf(" ACL: %u\n", btreq.btr_acl_mtu);
printf(" SCO: %u\n", btreq.btr_sco_mtu);
printf("Policy: %u\n", btreq.btr_link_policy);
printf("Type: %u\n", btreq.btr_packet_type);
}
printf("Flags: %04x\n", btreq.btr_flags);
printf("Free: %u\n", btreq.btr_num_cmd);
printf(" ACL: %u\n", btreq.btr_num_acl);
printf(" SCO: %u\n", btreq.btr_num_sco);
printf("Max:\n");
printf(" ACL: %u\n", btreq.btr_max_acl);
printf(" SCO: %u\n", btreq.btr_max_sco);
printf("MTU:\n");
printf(" ACL: %u\n", btreq.btr_acl_mtu);
printf(" SCO: %u\n", btreq.btr_sco_mtu);
printf("Policy: %u\n", btreq.btr_link_policy);
printf("Type: %u\n", btreq.btr_packet_type);
}
}
close(sockfd);

View File

@ -58,7 +58,8 @@ static void btsak_scan_showusage(FAR const char *progname,
fprintf(stderr, "\t%s <ifname> %s [-h] <start [-d]|get|stop>\n",
progname, cmd);
fprintf(stderr, "\nWhere the options do the following:\n\n");
fprintf(stderr, "\tstart\t- Starts scanning. The -d option enables duplicate\n");
fprintf(stderr,
"\tstart\t- Starts scanning. The -d option enables duplicate\n");
fprintf(stderr, "\t\t filtering.\n");
fprintf(stderr, "\tget\t- Shows new accumulated scan results\n");
fprintf(stderr, "\tstop\t- Stops scanning\n");
@ -279,7 +280,8 @@ void btsak_cmd_scan(FAR struct btsak_s *btsak, int argc, FAR char *argv[])
}
else
{
fprintf(stderr, "ERROR: Unrecognized scan command: %s\n", argv[argind]);
fprintf(stderr,
"ERROR: Unrecognized scan command: %s\n", argv[argind]);
btsak_scan_showusage(btsak->progname, argv[0], EXIT_FAILURE);
}
}

View File

@ -33,13 +33,13 @@
* Public Functions
****************************************************************************/
int ieee802154_addrtostr(FAR char *buf, int len,
FAR struct ieee802154_addr_s *addr)
{
#if 0
#ifndef CONFIG_BIG_ENDIAN
uint16_t panid = ((addr->panid & 0xff) << 8) | ((addr->panid >> 8) & 0xff);
uint16_t panid = ((addr->panid & 0xff) << 8) |
((addr->panid >> 8) & 0xff);
#else
uint16_t panid = addr->panid;
#endif
@ -51,7 +51,8 @@ int ieee802154_addrtostr(FAR char *buf, int len,
else if (addr->mode == IEEE802154_ADDRMODE_SHORT)
{
#ifndef CONFIG_BIG_ENDIAN
uint16_t saddr = ((addr->saddr & 0xff) << 8) | ((addr->saddr >> 8) & 0xff);
uint16_t saddr = ((addr->saddr & 0xff) << 8) |
((addr->saddr >> 8) & 0xff);
#else
uint16_t saddr = addr->saddr;
#endif
@ -71,7 +72,7 @@ int ieee802154_addrtostr(FAR char *buf, int len,
}
else
{
return snprintf(buf,len,"<INVAL>");
return snprintf(buf, len, "<INVAL>");
}
return -1;