[posix-app] get RCP (NCP in radio mode) version (#3140)

This commit contains the following changes:

- It adds `otPlatRadioGetVersionString()` as an optional radio
  platform API. If the radio platform does not implement this
  function, OpenThread core provides a default weak implementation
  of this function which return the OpenThread version.

- A public OpenThread API `otGetRadioVersionString()` is added which
  provides the radio version string.

- POSIX App is updated to get the version from its RCP and provide
  `otPlatRadioGetVersionString()`

- A new spinel capability `SPINEL_CAP_POSIX_APP` is added which
  corresponds to `ENABLE_POSIX_APP` configuration.

- A new spinel property `SPINEL_PROP_RCP_VERSION` (only available
  in POSIX_APP) is added which gets the RCP version.
This commit is contained in:
Abtin Keshavarzian
2018-10-12 10:40:57 -07:00
committed by Jonathan Hui
parent 2457aa1864
commit 7c8a37263b
11 changed files with 103 additions and 4 deletions
+12
View File
@@ -37,6 +37,7 @@
#include <openthread/instance.h>
#include <openthread/platform/misc.h>
#include <openthread/platform/radio.h>
#include "common/instance.hpp"
#include "common/logging.hpp"
@@ -183,3 +184,14 @@ const char *otGetVersionString(void)
return sVersion;
}
const char *otGetRadioVersionString(otInstance *aInstance)
{
return otPlatRadioGetVersionString(aInstance);
}
OT_TOOL_WEAK const char *otPlatRadioGetVersionString(otInstance *aInstance)
{
OT_UNUSED_VARIABLE(aInstance);
return otGetVersionString();
}