Skip to content

Commit

Permalink
shell: Enable setting acknowledgement request flag from shell
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneby committed Jun 7, 2016
1 parent 69b1ef3 commit 384fce3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion sys/shell/commands/sc_netif.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ static void _hl_usage(char *cmd_name)

static void _flag_usage(char *cmd_name)
{
printf("usage: %s <if_id> [-]{promisc|autoack|csma|autocca|cca_threshold|preload|iphc|rtr_adv}\n", cmd_name);
printf("usage: %s <if_id> [-]{promisc|autoack|ack_req|csma|autocca|cca_threshold|preload|iphc|rtr_adv}\n", cmd_name);
}

static void _add_usage(char *cmd_name)
Expand Down Expand Up @@ -380,6 +380,13 @@ static void _netif_list(kernel_pid_t dev)
linebreak = true;
}

res = gnrc_netapi_get(dev, NETOPT_ACK_REQ, 0, &enable, sizeof(enable));

if ((res >= 0) && (enable == NETOPT_ENABLE)) {
printf("ACK_REQ ");
linebreak = true;
}

res = gnrc_netapi_get(dev, NETOPT_PRELOADING, 0, &enable, sizeof(enable));

if ((res >= 0) && (enable == NETOPT_ENABLE)) {
Expand Down Expand Up @@ -825,6 +832,9 @@ static int _netif_flag(char *cmd, kernel_pid_t dev, char *flag)
else if (strcmp(flag, "autoack") == 0) {
return _netif_set_flag(dev, NETOPT_AUTOACK, set);
}
else if (strcmp(flag, "ack_req") == 0) {
return _netif_set_flag(dev, NETOPT_ACK_REQ, set);
}
else if (strcmp(flag, "raw") == 0) {
return _netif_set_flag(dev, NETOPT_RAWMODE, set);
}
Expand Down

0 comments on commit 384fce3

Please sign in to comment.