Minor clean of functino prototypes, iwpan help, spelling.

This commit is contained in:
Gregory Nutt 2017-04-21 13:43:01 -06:00
parent cd95f9ffa5
commit 067d705b98
3 changed files with 66 additions and 5 deletions

View File

@ -129,7 +129,8 @@ int ieee802154_mlme_register(int fd,
FAR struct ieee802154_mlme_register_s *info);
#endif
int ieee802154_assoc_req(int fd, FAR struct ieee802154_assoc_req_s *req);
int ieee802154_desassoc_req(int fd,
int ieee802154_assoc_resp(int fd, FAR struct ieee802154_assoc_resp_s *resp);
int ieee802154_disassoc_req(int fd,
FAR struct ieee802154_disassoc_req_s *req);
int ieee802154_get_req(int fd, FAR struct ieee802154_get_req_s *req);
int ieee802154_gts_req(int fd, FAR struct ieee802154_gts_req_s *req);
@ -163,7 +164,7 @@ int sixlowpan_assoc_req(int sock, FAR const char *ifname,
FAR const struct ieee802154_assoc_req_s *req);
int sixlowpan_assoc_resp(int sock, FAR const char *ifname,
FAR struct ieee802154_assoc_resp_s *resp);
int sixlowpan_desassoc_req(int sock, FAR const char *ifname,
int sixlowpan_disassoc_req(int sock, FAR const char *ifname,
FAR const struct ieee802154_disassoc_req_s *req);
int sixlowpan_get_req(int sock, FAR const char *ifname,
FAR const struct ieee802154_get_req_s *req);

View File

@ -1,9 +1,10 @@
/****************************************************************************
* apps/wireless/iwpan/src/iwpan.c
*
* Copyright (C) 2017 Verge Inc. All rights reserved.
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
* Author: Anthony Merlino <anthony@vergeaero.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@ -45,10 +46,29 @@
* Private Types
****************************************************************************/
/* Describes one command */
struct iwpan_command_s
{
FAR const char *name;
uint8_t noptions;
CODE void *handler;
};
/* Generic form of a command handler */
typedef void (*cmd1_t)(int sock, FAR const char *arg1);
typedef void (*cmd2_t)(int sock, FAR const char *arg1,
FAR const char *arg2);
typedef void (*cmd3_t)(int sock, FAR const char *arg1,
FAR const char *arg2, FAR const char *arg3);
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
static void iwpan_showusage(FAR const char *progname, int exitcode);
/****************************************************************************
* Private Data
****************************************************************************/
@ -57,6 +77,47 @@
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: iwpan_showusage
*
* Description:
* Show program usage.
*
* Returned Value:
* None
*
****************************************************************************/
static void iwpan_showusage(FAR const char *progname, int exitcode)
{
fprintf(stderr, "Usage:\n", progname);
fprintf(stderr, "\t%s <command> <ifname> [OPTIONS]\n");
fprintf(stderr, "\nWhere supported commands an [OPTIONS] appear below\n");
fprintf(stderr, "\nRadio Query:\n");
fprintf(stderr, "\t%s show <ifname>\n", progname);
fprintf(stderr, "\nRadio Settings:\n");
fprintf(stderr, "\t%s cca <ifname> <cca>\n", progname);
fprintf(stderr, "\t%s chan <ifname> <channel>\n", progname);
fprintf(stderr, "\t%s devmode <ifname> <devmode>\n", progname);
fprintf(stderr, "\t%s eaddr <ifname> <eaddr>\n", progname);
fprintf(stderr, "\t%s panid <ifname> <panid>\n", progname);
fprintf(stderr, "\t%s promisc <ifname> <true|false>\n", progname);
fprintf(stderr, "\t%s saddr <ifname> <saddr>\n", progname);
fprintf(stderr, "\t%s txpwr <ifname> <txpwr>\n", progname);
fprintf(stderr, "\nMAC Commands:\n");
fprintf(stderr, "\t%s assoc <ifname> TBD\n", progname);
fprintf(stderr, "\t%s disassoc <ifname> TBD\n", progname);
fprintf(stderr, "\t%s get <ifname> TBD\n", progname);
fprintf(stderr, "\t%s gts <ifname> TBD\n", progname);
fprintf(stderr, "\t%s poll <ifname> TBD\n", progname);
fprintf(stderr, "\t%s rxenab <ifname> TBD\n", progname);
fprintf(stderr, "\t%s scan <ifname> TBD\n", progname);
fprintf(stderr, "\t%s set <ifname> TBD\n", progname);
fprintf(stderr, "\t%s start <ifname> TBD\n", progname);
fprintf(stderr, "\t%s sync <ifname> TBD\n", progname);
exit(exitcode);
}
/****************************************************************************
* Public Functions
****************************************************************************/
@ -69,4 +130,3 @@ int iwpan_main(int argc, char *argv[])
{
return EXIT_SUCCESS;
}

View File

@ -62,7 +62,7 @@ struct wapi_command_s
CODE void *handler;
};
/* Generic form of a commnd handler */
/* Generic form of a command handler */
typedef void (*cmd1_t)(int sock, FAR const char *arg1);
typedef void (*cmd2_t)(int sock, FAR const char *arg1,