added remove api + small integratio test close #9

This commit is contained in:
prozessorkern
2020-02-03 21:35:20 +01:00
parent 1c294bb7d1
commit d1649e5e86
4 changed files with 140 additions and 1 deletions

View File

@@ -56,6 +56,16 @@ static shellmatta_retCode_t doSome(shellmatta_handle_t handle, const char *argum
}
shellmatta_cmd_t doSomeCmd = {"adoSome2", "adof2", "Function does something", "use me, please", doSome, NULL};
static shellmatta_retCode_t removeCmdFct(shellmatta_handle_t handle, const char *arguments, uint32_t length)
{
shellmatta_printf(handle, "removing command: %s\r\n", doSomeCmd.cmd);
shellmatta_removeCmd(handle, &doSomeCmd);
return SHELLMATTA_OK;
}
shellmatta_cmd_t removeCommand = {"remove", "r", "Function removes a command", "", removeCmdFct, NULL};
static shellmatta_retCode_t quit(shellmatta_handle_t handle, const char *arguments, uint32_t length)
{
@@ -101,6 +111,7 @@ int main(void)
shellmatta_addCmd(handle, &doSomethingCmd);
shellmatta_addCmd(handle, &doSomeCmd);
shellmatta_addCmd(handle, &quitCommand);
shellmatta_addCmd(handle, &removeCommand);
while(exitRequest == false)
{