mirror of
https://github.com/espressif/openthread.git
synced 2026-07-29 15:17:47 +00:00
ncp-spinel: Add STREAM_MFG property for diagnostics module (#403)
It's a generic stream property which doesn't take care of the diagnostics feature details - get diags commands from the property with VALUE_SET command - return diags output to the property with VALUE_IS command
This commit is contained in:
@@ -155,28 +155,11 @@ void TestDiag()
|
||||
for (unsigned int i = 0; i < sizeof(tests) / sizeof(tests[0]); i++)
|
||||
{
|
||||
char string[50];
|
||||
int length = strlen(tests[i].command);
|
||||
char *cmd;
|
||||
char *output = NULL;
|
||||
|
||||
argc = 0;
|
||||
memcpy(string, tests[i].command, strlen(tests[i].command) + 1);
|
||||
|
||||
memcpy(string, tests[i].command, length + 1);
|
||||
|
||||
for (cmd = string + 1; (cmd < string + length) && (cmd != NULL); ++cmd)
|
||||
{
|
||||
if (*cmd == ' ' || *cmd == '\r' || *cmd == '\n')
|
||||
{
|
||||
*cmd = '\0';
|
||||
}
|
||||
|
||||
if (*(cmd - 1) == '\0' && *cmd != ' ')
|
||||
{
|
||||
argv[argc++] = cmd;
|
||||
}
|
||||
}
|
||||
|
||||
output = diagProcessCmd(argc, argv);
|
||||
output = diagProcessCmdLine(string);
|
||||
VerifyOrQuit(memcmp(output, tests[i].output, strlen(tests[i].output)) == 0,
|
||||
"Test Diagnostics module failed\r\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user