implement cca_threshold settings to shell

This commit is contained in:
Jonas 2015-10-28 18:05:32 +01:00 committed by Kévin Roussel
parent e9f86c1126
commit 4ab55873dd

View File

@ -82,6 +82,7 @@ static void _set_usage(char *cmd_name)
" * \"channel\" - sets the frequency channel\n"
" * \"chan\" - alias for \"channel\"\n"
" * \"csma_retries\" - set max. number of channel access attempts\n"
" * \"cca_threshold\" - set ED threshold during CCA in dBm\n"
" * \"nid\" - sets the network identifier (or the PAN ID)\n"
" * \"page\" - set the channel page (IEEE 802.15.4)\n"
" * \"pan\" - alias for \"nid\"\n"
@ -103,7 +104,7 @@ static void _hl_usage(char *cmd_name)
static void _flag_usage(char *cmd_name)
{
printf("usage: %s <if_id> [-]{promisc|autoack|csma|autocca|preload|iphc|rtr_adv}\n", cmd_name);
printf("usage: %s <if_id> [-]{promisc|autoack|csma|autocca|cca_threshold|preload|iphc|rtr_adv}\n", cmd_name);
}
static void _add_usage(char *cmd_name)
@ -153,6 +154,10 @@ static void _print_netopt(netopt_t opt)
printf("CSMA retries");
break;
case NETOPT_CCA_THRESHOLD:
printf("CCA threshold [in dBm]");
break;
default:
/* we don't serve these options here */
break;
@ -584,6 +589,9 @@ static int _netif_set(char *cmd_name, kernel_pid_t dev, char *key, char *value)
else if (strcmp("csma_retries", key) == 0) {
return _netif_set_u8(dev, NETOPT_CSMA_RETRIES, value);
}
else if (strcmp("cca_threshold", key) == 0) {
return _netif_set_u8(dev, NETOPT_CCA_THRESHOLD, value);
}
_set_usage(cmd_name);
return 1;