Skip to content
Snippets Groups Projects
Commit e986145b authored by Anjan Chanda's avatar Anjan Chanda
Browse files

remove test code for controller_command_parse()

parent 1c5051d7
Branches
No related tags found
3 merge requests!295wifi_opclass: add wifi_radio_opclass_update_channel,!294Revert "fix typo query_channel_pref enum",!293Draft: Janusz cntlr apis
Pipeline #131467 failed
...@@ -1018,47 +1018,3 @@ int controller_command_parse(const char *command, void *args, struct blob_attr * ...@@ -1018,47 +1018,3 @@ int controller_command_parse(const char *command, void *args, struct blob_attr *
//blob_buf_free(&bi); //blob_buf_free(&bi);
return 0; return 0;
} }
#ifdef CNTLR_CMD_TEST
int main()
{
const char *sta_caps_args = "{\"agent\":\"00:11:22:33:44:55\"}";
const char *ap_caps_args = "{\"agent\":\"00:11:22:33:44:55\", \"bssid\":\"aa:bb:cc:00:00:01\"}";
struct blob_attr *tba[NUM_ATTRS_AP_CAPS] = {0};
struct blob_attr *tbs[NUM_ATTRS_STA_CAPS] = {0};
int ret;
iterate_commands();
return 0;
//controller_command_help("query_ap_caps");
//controller_command_help("query_sta_caps");
memset(tba, 0, sizeof(struct blob_attr *) * NUM_ATTRS_AP_CAPS);
memset(tbs, 0, sizeof(struct blob_attr *) * NUM_ATTRS_STA_CAPS);
ret = controller_command_parse("query_sta_caps", sta_caps_args, tbs);
if (!ret) {
if (tbs[STA_CAPS_ATTR_AGENT]) {
char agentstr[32] = {0};
strncpy(agentstr, blobmsg_data(tbs[STA_CAPS_ATTR_AGENT]), sizeof(agentstr) - 1);
printf("query_sta_caps: agent = %s\n", agentstr);
}
if (tbs[STA_CAPS_ATTR_STA])
printf("query_sta_caps: sta = %s\n", blobmsg_get_string(tbs[STA_CAPS_ATTR_STA]));
} else
printf("query_sta_caps: Failed to parse\n");
ret = controller_command_parse("query_ap_caps", ap_caps_args, tba);
if (!ret) {
if (tba[AP_CAPS_ATTR_AGENT])
printf("query_ap_caps: agent = %s\n", blobmsg_get_string(tba[AP_CAPS_ATTR_AGENT]));
if (tba[AP_CAPS_ATTR_BSSID])
printf("query_ap_caps: bssid = %s\n", blobmsg_get_string(tba[AP_CAPS_ATTR_BSSID]));
} else
printf("query_ap_caps: Failed to parse\n");
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment