[posix] fix inconsistent function definitions issue (#4950)

The arguments of the funtion `otPlatDiagProcess` in posix radio driver
is different from the one defined in the `diag.h`. It causes the diag
module uses the weak definition of the function `otPlatDiagProcess`.
This commit fixes this issue.
This commit is contained in:
Zhanglong Xia
2020-05-12 18:03:32 -07:00
committed by GitHub
parent b4a5df49e6
commit 8e84e05429
+7 -3
View File
@@ -380,7 +380,11 @@ exit:
#endif
#if OPENTHREAD_CONFIG_DIAG_ENABLE
otError otPlatDiagProcess(otInstance *aInstance, int argc, char *argv[], char *aOutput, size_t aOutputMaxLen)
otError otPlatDiagProcess(otInstance *aInstance,
uint8_t aArgsLength,
char * aArgs[],
char * aOutput,
size_t aOutputMaxLen)
{
// deliver the platform specific diags commands to radio only ncp.
OT_UNUSED_VARIABLE(aInstance);
@@ -388,9 +392,9 @@ otError otPlatDiagProcess(otInstance *aInstance, int argc, char *argv[], char *a
char *cur = cmd;
char *end = cmd + sizeof(cmd);
for (int index = 0; index < argc; index++)
for (uint8_t index = 0; index < aArgsLength; index++)
{
cur += snprintf(cur, static_cast<size_t>(end - cur), "%s ", argv[index]);
cur += snprintf(cur, static_cast<size_t>(end - cur), "%s ", aArgs[index]);
}
return sRadioSpinel.PlatDiagProcess(cmd, aOutput, aOutputMaxLen);