added remove api + small integratio test close #9
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user