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:
Shu Chen
2016-08-18 18:00:06 -07:00
committed by Jonathan Hui
parent afaba6a7ff
commit 9ff00bdbae
8 changed files with 82 additions and 20 deletions
+2 -19
View File
@@ -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");
}