diff --git a/include/wireless/ieee802154.h b/include/wireless/ieee802154.h index a7993108f..a8242c662 100644 --- a/include/wireless/ieee802154.h +++ b/include/wireless/ieee802154.h @@ -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); diff --git a/wireless/iwpan/src/iwpan.c b/wireless/iwpan/src/iwpan.c index da0c6c4b7..bce2a84ec 100644 --- a/wireless/iwpan/src/iwpan.c +++ b/wireless/iwpan/src/iwpan.c @@ -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 + * Gregory Nutt * * 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 [OPTIONS]\n"); + fprintf(stderr, "\nWhere supported commands an [OPTIONS] appear below\n"); + fprintf(stderr, "\nRadio Query:\n"); + fprintf(stderr, "\t%s show \n", progname); + fprintf(stderr, "\nRadio Settings:\n"); + fprintf(stderr, "\t%s cca \n", progname); + fprintf(stderr, "\t%s chan \n", progname); + fprintf(stderr, "\t%s devmode \n", progname); + fprintf(stderr, "\t%s eaddr \n", progname); + fprintf(stderr, "\t%s panid \n", progname); + fprintf(stderr, "\t%s promisc \n", progname); + fprintf(stderr, "\t%s saddr \n", progname); + fprintf(stderr, "\t%s txpwr \n", progname); + fprintf(stderr, "\nMAC Commands:\n"); + fprintf(stderr, "\t%s assoc TBD\n", progname); + fprintf(stderr, "\t%s disassoc TBD\n", progname); + fprintf(stderr, "\t%s get TBD\n", progname); + fprintf(stderr, "\t%s gts TBD\n", progname); + fprintf(stderr, "\t%s poll TBD\n", progname); + fprintf(stderr, "\t%s rxenab TBD\n", progname); + fprintf(stderr, "\t%s scan TBD\n", progname); + fprintf(stderr, "\t%s set TBD\n", progname); + fprintf(stderr, "\t%s start TBD\n", progname); + fprintf(stderr, "\t%s sync TBD\n", progname); + exit(exitcode); +} + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -69,4 +130,3 @@ int iwpan_main(int argc, char *argv[]) { return EXIT_SUCCESS; } - diff --git a/wireless/wapi/src/wapi.c b/wireless/wapi/src/wapi.c index a5f53c2d2..c123f2154 100644 --- a/wireless/wapi/src/wapi.c +++ b/wireless/wapi/src/wapi.c @@ -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,