[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
+11 -1
View File
@@ -379,13 +379,23 @@ otLogLevel otGetDynamicLogLevel(otInstance *aInstance);
otError otSetDynamicLogLevel(otInstance *aInstance, otLogLevel aLogLevel);
/**
* Get the OpenThread version string.
* This function gets the OpenThread version string.
*
* @returns A pointer to the OpenThread version.
*
*/
OTAPI const char *OTCALL otGetVersionString(void);
/**
* This function gets the OpenThread radio version string.
*
* @param[in] aInstance A pointer to an OpenThread instance.
*
* @returns A pointer to the OpenThread radio version.
*
*/
const char *otGetRadioVersionString(otInstance *aInstance);
/**
* @}
*
+13
View File
@@ -634,6 +634,19 @@ int8_t otPlatRadioGetReceiveSensitivity(otInstance *aInstance);
*/
extern void otPlatRadioFrameUpdated(otInstance *aInstance, otRadioFrame *aFrame);
/**
* Get the radio version string.
*
* This is an optional radio driver platform function. If not provided by platform radio driver, OpenThread uses
* the OpenThread version instead (@sa otGetVersionString()).
*
* @param[in] aInstance The OpenThread instance structure.
*
* @returns A pointer to the OpenThread radio version.
*
*/
const char *otPlatRadioGetVersionString(otInstance *aInstance);
/**
* @}
*