mirror of
https://github.com/espressif/openthread.git
synced 2026-07-29 07:07:47 +00:00
[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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user