Print MAC layer with mac command

This commit is contained in:
adamdunkels 2008-07-02 14:08:06 +00:00
parent adbf6c47ab
commit 88fb193a68

View File

@ -28,7 +28,7 @@
* *
* This file is part of the Contiki operating system. * This file is part of the Contiki operating system.
* *
* $Id: shell-rime.c,v 1.3 2008/02/24 20:58:35 adamdunkels Exp $ * $Id: shell-rime.c,v 1.4 2008/07/02 14:08:06 adamdunkels Exp $
*/ */
/** /**
@ -158,14 +158,16 @@ PROCESS_THREAD(shell_mac_process, ev, data)
PROCESS_BEGIN(); PROCESS_BEGIN();
onoroff = shell_strtolong((char *)data, &next); onoroff = shell_strtolong((char *)data, &next);
if(next == data) { if(next == data) {
shell_output_str(&mac_command, "usage: ", mac_command.description); shell_output_str(&mac_command, "mac: current MAC layer: ", rime_mac->name);
shell_output_str(&mac_command, "mac usage: ", mac_command.description);
} else { } else {
if(onoroff) { if(onoroff) {
rime_mac->on(); rime_mac->on();
shell_output_str(&mac_command, "mac: turned MAC on", ""); shell_output_str(&mac_command, "mac: turned MAC on: ", rime_mac->name);
} else { } else {
rime_mac->off(1); rime_mac->off(1);
shell_output_str(&mac_command, "mac: turned MAC off (keeping radio on)", ""); shell_output_str(&mac_command, "mac: turned MAC off (keeping radio on): ",
rime_mac->name);
} }
} }
PROCESS_END(); PROCESS_END();