Remove dangling whitespace

This commit is contained in:
Gregory Nutt 2017-06-15 10:51:25 -06:00
parent e7409b3b16
commit a8ab2f7505
11 changed files with 108 additions and 108 deletions

View File

@ -136,7 +136,7 @@ static void acceptassoc_eventcb(FAR struct ieee802154_notif_s *notif, FAR void *
printf("i8sak: a device is trying to associate\n");
/* If the address matches our device, accept the association.
/* If the address matches our device, accept the association.
* Otherwise, reject the assocation.
*/
@ -145,11 +145,11 @@ static void acceptassoc_eventcb(FAR struct ieee802154_notif_s *notif, FAR void *
{
/* Send a ASSOC.resp primtive to the MAC. Copy the association
* indication address into the association response primitive
*/
*/
memcpy(&assocresp.devaddr[0], &notif->u.assocind.devaddr[0],
IEEE802154_EADDR_LEN);
assocresp.assocsaddr = i8sak->next_saddr;
assocresp.status = IEEE802154_STATUS_SUCCESS;
@ -160,11 +160,11 @@ static void acceptassoc_eventcb(FAR struct ieee802154_notif_s *notif, FAR void *
{
/* Send a ASSOC.resp primtive to the MAC. Copy the association
* indication address into the association response primitive
*/
*/
memcpy(&assocresp.devaddr[0], &notif->u.assocind.devaddr[0],
IEEE802154_EADDR_LEN);
assocresp.status = IEEE802154_STATUS_DENIED;
printf("i8sak: rejecting association request\n");

View File

@ -86,7 +86,7 @@ void i8sak_assoc_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[])
* default PAN Coordinator address. This is actually the way the i8sak settings
* are configured, so just set the flag if it's not already set.
*/
if (!i8sak->addrset)
{
i8sak->addrset = true;
@ -133,7 +133,7 @@ void i8sak_assoc_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[])
i8sak_cmd_error(i8sak); /* This exits for us */
}
}
/* If none of the option flags were used, and there is an argument included,
* assume it is the PAN ID
*/
@ -142,7 +142,7 @@ void i8sak_assoc_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[])
{
i8sak->ep.panid = i8sak_str2luint16(argv[1]);
}
fd = open(i8sak->devname, O_RDWR);
if (fd < 0)
{
@ -212,7 +212,7 @@ static void assoc_eventcb(FAR struct ieee802154_notif_s *notif, FAR void *arg)
}
else
{
printf("i8sak: ASSOC.request failed: %s\n",
printf("i8sak: ASSOC.request failed: %s\n",
IEEE802154_STATUS_STRING[notif->u.assocconf.status]);
}

View File

@ -137,7 +137,7 @@ static inline void i8sak_blaster_start (FAR struct i8sak_s *i8sak)
/* Signal the daemon to start running */
printf("starting blaster\n");
printf("starting blaster\n");
sem_post(&i8sak->updatesem);
}
}

View File

@ -131,7 +131,7 @@ static void i8sak_switch_instance(FAR char *devname);
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name : i8sak_tx
*
@ -187,7 +187,7 @@ int i8sak_tx(FAR struct i8sak_s *i8sak, int fd)
{
printf(" write: errno=%d\n",errno);
}
return ret;
}
@ -205,14 +205,14 @@ int i8sak_tx(FAR struct i8sak_s *i8sak, int fd)
int i8sak_str2payload(FAR const char *str, FAR uint8_t *buf)
{
int str_len, ret, i = 0;
str_len = strlen(str);
/* Each byte is represented by 2 chars */
ret = str_len >> 1;
/* Check if the number of chars is a multiple of 2 and that the number of
/* Check if the number of chars is a multiple of 2 and that the number of
* bytes does not exceed the max MAC frame payload supported */
if ((str_len & 1) || (ret > IEEE802154_MAX_MAC_PAYLOAD_SIZE))
@ -417,21 +417,21 @@ bool i8sak_str2bool(FAR const char *str)
static void i8sak_switch_instance(FAR char *devname)
{
FAR struct i8sak_s *i8sak;
/* Search list of i8sak instances for one associated with the provided device */
i8sak = (FAR struct i8sak_s *)sq_peek(&g_i8sak_instances);
while (i8sak != NULL)
{
if (strcmp(devname, i8sak->devname) == 0)
{
break;
}
i8sak = (FAR struct i8sak_s *)sq_next((FAR sq_entry_t *)i8sak);
}
/* If there isn't a i8sak instance started for this device, allocate one */
if (i8sak == NULL)
@ -450,7 +450,7 @@ static void i8sak_switch_instance(FAR char *devname)
* the shared active global i8sak is correct */
g_activei8sak = i8sak;
if (!g_activei8sak_set)
{
g_activei8sak_set = true;
@ -471,7 +471,7 @@ static int i8sak_setup(FAR struct i8sak_s *i8sak, FAR const char *devname)
{
return OK;
}
i8sak->daemon_started = false;
i8sak->daemon_shutdown = false;
@ -485,9 +485,9 @@ static int i8sak_setup(FAR struct i8sak_s *i8sak, FAR const char *devname)
}
strcpy(&i8sak->devname[0], devname);
/* Initialze default extended address */
for (i = 0; i < IEEE802154_EADDR_LEN; i++)
{
i8sak->addr.eaddr[i] = (uint8_t)((CONFIG_IEEE802154_I8SAK_DEV_EADDR >> (i*8)) & 0xFF);
@ -512,9 +512,9 @@ static int i8sak_setup(FAR struct i8sak_s *i8sak, FAR const char *devname)
printf("cannot open %s, errno=%d\n", i8sak->devname, errno);
i8sak_cmd_error(i8sak);
}
ieee802154_seteaddr(fd, &i8sak->addr.eaddr[0]);
close(fd);
i8sak->addrset = false;
@ -589,7 +589,7 @@ static int i8sak_daemon(int argc, FAR char *argv[])
/* Signal the calling thread that the daemon is up and running */
sem_post(&i8sak->sigsem);
while (!i8sak->daemon_shutdown)
{
if (i8sak->blasterenabled)
@ -662,7 +662,7 @@ int i8_main(int argc, char *argv[])
sq_addlast((FAR sq_entry_t *)&g_i8sak_pool[i], &g_i8sak_free);
g_i8sak_pool[i].initialized = false;
}
g_i8sak_initialized = true;
}
@ -688,17 +688,17 @@ int i8_main(int argc, char *argv[])
}
/* Argument must be command */
}
/* If devname wasn't included, we need to check if our sticky feature has
* ever been set.
*/
else if (!g_activei8sak_set)
{
fprintf(stderr, "ERROR: Must include devname the first time you run\n");
i8sak_showusage(argv[0], EXIT_FAILURE);
}
/* Find the command in the g_i8sak_command[] list */
i8sakcmd = NULL;
@ -711,7 +711,7 @@ int i8_main(int argc, char *argv[])
break;
}
}
if (i8sakcmd == NULL)
{
i8sak_showusage(argv[0], EXIT_FAILURE);
@ -730,7 +730,7 @@ int i8_main(int argc, char *argv[])
fprintf(stderr, "ERROR: Failed to lock i8sak instance\n");
exit(EXIT_FAILURE);
}
i8sakcmd->handler(g_activei8sak, argc - argind, &argv[argind]);
sem_post(&g_activei8sak->exclsem);

View File

@ -110,7 +110,7 @@ void i8sak_poll_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[])
i8sak_cmd_error(i8sak); /* This exits for us */
}
}
if (ret != OK)
{
i8sak_cmd_error(i8sak);
@ -167,7 +167,7 @@ static void poll_eventcb(FAR struct ieee802154_notif_s *notif, FAR void *arg)
}
else
{
printf("i8sak: POLL.request failed: %s\n",
printf("i8sak: POLL.request failed: %s\n",
IEEE802154_STATUS_STRING[notif->u.pollconf.status]);
}

View File

@ -105,7 +105,7 @@ void i8sak_sniffer_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[])
i8sak_cmd_error(i8sak); /* This exits for us */
}
}
if (ret != OK)
{
i8sak_cmd_error(i8sak);
@ -120,12 +120,12 @@ void i8sak_sniffer_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[])
/* Enable promiscuous mode */
printf("i8sak: turning on promiscuous mode.\n");
printf("i8sak: turning on promiscuous mode.\n");
ieee802154_setpromisc(fd, true);
/* Make sure receiver is always on while idle */
printf("i8sak: setting receiveonidle.\n");
printf("i8sak: setting receiveonidle.\n");
ieee802154_setrxonidle(fd, true);
close(fd);

View File

@ -124,12 +124,12 @@ void i8sak_startpan_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[])
* it assuming that we are the default PAN coordinator address and the
* endpoint is the default device address.
*/
if (!i8sak->addrset)
{
for (i = 0; i < IEEE802154_EADDR_LEN; i++)
{
i8sak->addr.eaddr[i] =
i8sak->addr.eaddr[i] =
(uint8_t)((CONFIG_IEEE802154_I8SAK_PANCOORD_EADDR >> (i*8)) & 0xFF);
}
@ -139,10 +139,10 @@ void i8sak_startpan_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[])
for (i = 0; i < IEEE802154_EADDR_LEN; i++)
{
i8sak->ep.eaddr[i] =
i8sak->ep.eaddr[i] =
(uint8_t)((CONFIG_IEEE802154_I8SAK_DEV_EADDR >> (i*8)) & 0xFF);
}
i8sak->ep.mode = IEEE802154_ADDRMODE_SHORT;
i8sak->ep.saddr = CONFIG_IEEE802154_I8SAK_DEV_SADDR;
i8sak->ep.panid = CONFIG_IEEE802154_I8SAK_PANID;
@ -159,7 +159,7 @@ void i8sak_startpan_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[])
startreq.panid = i8sak->addr.panid;
startreq.chnum = i8sak->chnum;
startreq.chpage = i8sak->chpage;
startreq.chpage = i8sak->chpage;
startreq.beaconorder = 15;
startreq.pancoord = true;
startreq.coordrealign = false;

View File

@ -114,12 +114,12 @@ void i8sak_tx_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[])
break;
}
}
if (ret != OK)
{
i8sak_cmd_error(i8sak);
}
if (argc == argind + 1)
{
i8sak->payload_len = i8sak_str2payload(argv[1], &i8sak->payload[0]);
@ -131,7 +131,7 @@ void i8sak_tx_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[])
printf("i8sak: cannot open %s, errno=%d\n", i8sak->devname, errno);
i8sak_cmd_error(i8sak);
}
/* Check if transaction should be indirect or not */
ieee802154_getdevmode(fd, &devmode);
@ -162,7 +162,7 @@ void i8sak_tx_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[])
close(fd);
i8sak_cmd_error(i8sak);
}
i8sak->indirect = false;
}
@ -187,7 +187,7 @@ void i8sak_tx_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[])
close(fd);
i8sak_cmd_error(i8sak);
}
close(fd);
}
@ -208,7 +208,7 @@ static void tx_eventcb(FAR struct ieee802154_notif_s *notif, FAR void *arg)
}
else
{
printf("i8sak: frame failed to send: %s\n",
printf("i8sak: frame failed to send: %s\n",
IEEE802154_STATUS_STRING[notif->u.dataconf.status]);
}

View File

@ -71,13 +71,13 @@ static pthread_addr_t wpanlistener_eventthread(pthread_addr_t arg);
* OK on success; a negated errno on failure
*
* Assumptions:
*
*
****************************************************************************/
int wpanlistener_setup(FAR struct wpanlistener_s *handle, int fd)
{
int i;
/* Initialize the frame receiver allocation pool */
sq_init(&handle->framereceivers);
@ -95,9 +95,9 @@ int wpanlistener_setup(FAR struct wpanlistener_s *handle, int fd)
{
sq_addlast((FAR sq_entry_t *)&handle->eventreceiver_pool[i], &handle->eventreceivers_free);
}
sem_init(&handle->exclsem, 0, 1);
handle->is_setup = true;
handle->fd = fd;
return OK;
@ -116,7 +116,7 @@ int wpanlistener_setup(FAR struct wpanlistener_s *handle, int fd)
* OK on success; a negated errno on failure
*
* Assumptions:
*
*
****************************************************************************/
int wpanlistener_start(FAR struct wpanlistener_s *handle)
@ -157,7 +157,7 @@ int wpanlistener_start(FAR struct wpanlistener_s *handle)
* OK on success; a negated errno on failure
*
* Assumptions:
*
*
****************************************************************************/
int wpanlistener_stop(FAR struct wpanlistener_s *handle)
@ -181,12 +181,12 @@ int wpanlistener_stop(FAR struct wpanlistener_s *handle)
* arg - user specified argument to send to the callback
* oneshot - whether the receiver is automatically unregistered after the
* first notification
*
*
* Returned Value:
* OK if successful; a negated errno on failure
*
* Assumptions:
*
*
****************************************************************************/
int wpanlistener_add_framereceiver(FAR struct wpanlistener_s *handle,
@ -216,12 +216,12 @@ int wpanlistener_add_framereceiver(FAR struct wpanlistener_s *handle,
sem_post(&handle->exclsem);
return -ENOMEM;
}
receiver->cb = cb;
memcpy(&receiver->filter, filter, sizeof(struct wpanlistener_framefilter_s));
receiver->arg = arg;
receiver->oneshot = oneshot;
/* Link the receiver into the list */
sq_addlast((FAR sq_entry_t *)receiver, &handle->framereceivers);
@ -229,7 +229,7 @@ int wpanlistener_add_framereceiver(FAR struct wpanlistener_s *handle,
sem_post(&handle->exclsem);
return OK;
}
/****************************************************************************
* Name: wpanlistener_add_eventreceiver
*
@ -251,7 +251,7 @@ int wpanlistener_add_framereceiver(FAR struct wpanlistener_s *handle,
* OK if successful; a negated errno on failure
*
* Assumptions:
*
*
****************************************************************************/
int wpanlistener_add_eventreceiver(FAR struct wpanlistener_s *handle,
@ -281,7 +281,7 @@ int wpanlistener_add_eventreceiver(FAR struct wpanlistener_s *handle,
sem_post(&handle->exclsem);
return -ENOMEM;
}
receiver->cb = cb;
memcpy(&receiver->filter, filter, sizeof(struct wpanlistener_eventfilter_s));
receiver->arg = arg;
@ -290,7 +290,7 @@ int wpanlistener_add_eventreceiver(FAR struct wpanlistener_s *handle,
/* Link the receiver into the list */
sq_addlast((FAR sq_entry_t *)receiver, &handle->eventreceivers);
sem_post(&handle->exclsem);
return OK;
@ -311,7 +311,7 @@ int wpanlistener_add_eventreceiver(FAR struct wpanlistener_s *handle,
* OK on success; a negated errno on failure
*
* Assumptions:
*
*
****************************************************************************/
int wpanlistener_remove_framereceiver(FAR struct wpanlistener_s *handle,
@ -328,14 +328,14 @@ int wpanlistener_remove_framereceiver(FAR struct wpanlistener_s *handle,
fprintf(stderr, "wpanlistener: failed to remove receiver: %d\n", ret);
return ret;
}
/* Search through frame receivers until either we match the callback, or
* there is no more receivers to check.
*/
receiver = (FAR struct wpanlistener_framereceiver_s *)sq_peek(
&handle->framereceivers);
while (receiver != NULL)
{
/* Check if callback matches */
@ -354,11 +354,11 @@ int wpanlistener_remove_framereceiver(FAR struct wpanlistener_s *handle,
return OK;
}
receiver = (FAR struct wpanlistener_framereceiver_s *)sq_next(
(FAR sq_entry_t *)receiver);
}
sem_post(&handle->exclsem);
fprintf(stderr, "wpanlistener: failed to remove receiver");
return ERROR;
@ -379,7 +379,7 @@ int wpanlistener_remove_framereceiver(FAR struct wpanlistener_s *handle,
* OK on success; a negated errno on failure
*
* Assumptions:
*
*
****************************************************************************/
int wpanlistener_remove_eventreceiver(FAR struct wpanlistener_s *handle,
@ -396,14 +396,14 @@ int wpanlistener_remove_eventreceiver(FAR struct wpanlistener_s *handle,
fprintf(stderr, "wpanlistener: failed to remove receiver: %d\n", ret);
return ret;
}
/* Search through frame receivers until either we match the callback, or
* there is no more receivers to check.
*/
receiver = (FAR struct wpanlistener_eventreceiver_s *)sq_peek(
&handle->eventreceivers);
while (receiver != NULL)
{
/* Check if callback matches */
@ -422,11 +422,11 @@ int wpanlistener_remove_eventreceiver(FAR struct wpanlistener_s *handle,
return OK;
}
receiver = (FAR struct wpanlistener_eventreceiver_s *)sq_next(
(FAR sq_entry_t *)receiver);
}
sem_post(&handle->exclsem);
fprintf(stderr, "wpanlistener: failed to remove receiver");
return ERROR;
@ -474,29 +474,29 @@ static pthread_addr_t wpanlistener_framethread(pthread_addr_t arg)
printf(" \n");
fflush(stdout);
/* Loop through frame receivers and call callbacks for those receivers
* whose filter matches this frame
*/
receiver = (FAR struct wpanlistener_framereceiver_s *)sq_peek(
&handle->framereceivers);
while (receiver != NULL)
{
/* TODO: When filtering options are figured out. Actually filter packets
* here. For now, all frames get passed to all receivers.
*/
receiver->cb(&frame, receiver->arg);
receiver = (FAR struct wpanlistener_framereceiver_s *)sq_next(
(FAR sq_entry_t *)receiver);
/* Check if the receiver was a one-shot receiver, then throw it out
* if it is
*/
if (receiver->oneshot)
{
/* Unlink the receiver from the list */
@ -547,10 +547,10 @@ static pthread_addr_t wpanlistener_eventthread(pthread_addr_t arg)
/* Loop through event receivers and call callbacks for those receivers
* listening for this event type.
*/
receiver = (FAR struct wpanlistener_eventreceiver_s *)sq_peek(
&handle->eventreceivers);
while (receiver != NULL)
{
if (notif.notiftype == IEEE802154_NOTIFY_CONF_DATA &&
@ -727,15 +727,15 @@ static pthread_addr_t wpanlistener_eventthread(pthread_addr_t arg)
receiver->filter.indevents.disassoc)
{
receiver->cb(&notif, receiver->arg);
if (receiver->oneshot)
{
/* Unlink the receiver from the list */
sq_rem((FAR sq_entry_t *)receiver, &handle->eventreceivers);
/* Link the receiver back into the free list */
sq_addlast((FAR sq_entry_t *)receiver, &handle->eventreceivers_free);
}
}
@ -744,15 +744,15 @@ static pthread_addr_t wpanlistener_eventthread(pthread_addr_t arg)
receiver->filter.indevents.beaconnotify)
{
receiver->cb(&notif, receiver->arg);
if (receiver->oneshot)
{
/* Unlink the receiver from the list */
sq_rem((FAR sq_entry_t *)receiver, &handle->eventreceivers);
/* Link the receiver back into the free list */
sq_addlast((FAR sq_entry_t *)receiver, &handle->eventreceivers_free);
}
}
@ -761,15 +761,15 @@ static pthread_addr_t wpanlistener_eventthread(pthread_addr_t arg)
receiver->filter.indevents.gts)
{
receiver->cb(&notif, receiver->arg);
if (receiver->oneshot)
{
/* Unlink the receiver from the list */
sq_rem((FAR sq_entry_t *)receiver, &handle->eventreceivers);
/* Link the receiver back into the free list */
sq_addlast((FAR sq_entry_t *)receiver, &handle->eventreceivers_free);
}
}
@ -778,15 +778,15 @@ static pthread_addr_t wpanlistener_eventthread(pthread_addr_t arg)
receiver->filter.indevents.orphan)
{
receiver->cb(&notif, receiver->arg);
if (receiver->oneshot)
{
/* Unlink the receiver from the list */
sq_rem((FAR sq_entry_t *)receiver, &handle->eventreceivers);
/* Link the receiver back into the free list */
sq_addlast((FAR sq_entry_t *)receiver, &handle->eventreceivers_free);
}
}
@ -795,15 +795,15 @@ static pthread_addr_t wpanlistener_eventthread(pthread_addr_t arg)
receiver->filter.indevents.commstatus)
{
receiver->cb(&notif, receiver->arg);
if (receiver->oneshot)
{
/* Unlink the receiver from the list */
sq_rem((FAR sq_entry_t *)receiver, &handle->eventreceivers);
/* Link the receiver back into the free list */
sq_addlast((FAR sq_entry_t *)receiver, &handle->eventreceivers_free);
}
}
@ -812,15 +812,15 @@ static pthread_addr_t wpanlistener_eventthread(pthread_addr_t arg)
receiver->filter.indevents.syncloss)
{
receiver->cb(&notif, receiver->arg);
if (receiver->oneshot)
{
/* Unlink the receiver from the list */
sq_rem((FAR sq_entry_t *)receiver, &handle->eventreceivers);
/* Link the receiver back into the free list */
sq_addlast((FAR sq_entry_t *)receiver, &handle->eventreceivers_free);
}
}

View File

@ -54,7 +54,7 @@
* Public Functions
****************************************************************************/
int ieee802154_enableevents(int fd, bool enable)
int ieee802154_enableevents(int fd, bool enable)
{
int ret;

View File

@ -488,7 +488,7 @@ static void wapi_essid_cmd(int sock, FAR const char *ifname,
/* Convert input strings to values */
essid_flag = (enum wapi_essid_flag_e)wapi_str2ndx(flagstr, g_wapi_essid_flags, 2);
/* Set the ESSID */
ret = wapi_set_essid(sock, ifname, essid, essid_flag);