-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
firmware/sys/shell_extended: Added Commands uniqueid
- Loading branch information
eduazocar
committed
Sep 22, 2022
1 parent
dd27df5
commit f78a5f8
Showing
15 changed files
with
124 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
APPLICATION ?= shell_extended | ||
|
||
include ../Makefile.common | ||
# include desired modules: | ||
USEMODULE += radio | ||
# include the shell: | ||
|
||
# Include the shell extended module, shell and shell commands modules | ||
# will be implicitly included. | ||
USEMODULE += shell_extended | ||
USEMODULE += xtimer | ||
# Include desired modules where shell extended is enabled. | ||
USEMODULE += uniqueid | ||
|
||
include $(RIOTBASE)/Makefile.include |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright (C) 2022 Mesh4all <mesh4all.org> | ||
* | ||
* This file is subject to the terms and conditions of the GNU Lesser | ||
* General Public License v2.1. See the file LICENSE in the top level | ||
* directory for more details. | ||
*/ | ||
|
||
/** | ||
* @defgroup examples_shell_extended Application example for the shell extended module | ||
* @ingroup examples | ||
* @author Luis A. Ruiz <luisan00@hotmail.com> | ||
* @author Eduardo Azócar <eduazocarv@gmail.com> | ||
* | ||
* ## How does it works? | ||
* | ||
* **ToDo** | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ifneq (,$(filter shell_extended,$(USEMODULE))) | ||
USEMODULE += shell | ||
USEMODULE += shell_commands | ||
endif | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
USEMODULE += shell | ||
|
||
ifneq (,$(filter radio,$(USEMODULE))) | ||
USEMODULE += radio | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
USEMODULE_INCLUDES_shell_extended := $(LAST_MAKEFILEDIR)/include | ||
USEMODULE_INCLUDES += $(USEMODULE_INCLUDES_shell_extended) | ||
USEMODULE_INCLUDES += $(USEMODULE_INCLUDES_shell_extended) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
* | ||
* ## Shell extended | ||
* ToDo | ||
*/ | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright (c) 2022 Mesh4all <mesh4all.org> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
/** | ||
* @brief Extends the shell functionality for uniqueid | ||
* @author Luis A. Ruiz <luisan00@hotmail.com> | ||
* @author Eduardo Azócar <eduazocarv@gmail.com> | ||
*/ | ||
|
||
#include <stdio.h> | ||
#include <string.h> | ||
#include "uniqueid.h" | ||
|
||
void uid_usage(void) { | ||
puts("Uniqueid Tool"); | ||
puts("Usage: uid [static|rand]"); | ||
puts(""); | ||
} | ||
|
||
int uid_cmd(int argc, char **argv) { | ||
(void)argc; | ||
(void)argv; | ||
|
||
if ((argc < 2) || (argc > 2) || (strcmp(argv[1], "help") == 0)) { | ||
uid_usage(); | ||
return 0; | ||
} | ||
|
||
if (strcmp(argv[1], "static") == 0) { | ||
puts("ToDo: return static id (cpu-based)"); | ||
} else if (strcmp(argv[1], "random") == 0) { | ||
puts("Todo: return random id"); | ||
} | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
include ../Makefile.tests_common | ||
|
||
USEMODULE += embunit | ||
USEMODULE += shell_extended | ||
|
||
include $(RIOTBASE)/Makefile.include |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
@defgroup tests_shell_extended Shell-Extended unit tests | ||
@ingroup tests | ||
@{ | ||
|
||
## Shell Extended Tests. | ||
|
||
@} | ||
|
||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Copyright (C) 2017 Freie Universität Berlin | ||
# | ||
# This file is subject to the terms and conditions of the GNU Lesser | ||
# General Public License v2.1. See the file LICENSE in the top level | ||
# directory for more details. | ||
|
||
import sys | ||
from testrunner import run_check_unittests | ||
|
||
if __name__ == "__main__": | ||
sys.exit(run_check_unittests()) |