[diag] add gpio diag command support (#8316)

This commit is contained in:
Zhanglong Xia
2022-10-31 17:05:20 -07:00
committed by GitHub
parent 1d1e5d16e0
commit 11a24d111f
14 changed files with 369 additions and 23 deletions
+6 -1
View File
@@ -85,8 +85,13 @@ otError otDiagProcessCmd(otInstance *aInstance,
* @param[out] aOutput The diagnostics execution result.
* @param[in] aOutputMaxLen The output buffer size.
*
* @retval OT_ERROR_NONE The command is successfully process.
* @retval OT_ERROR_INVALID_ARGS The command is supported but invalid arguments provided.
* @retval OT_ERROR_NOT_IMPLEMENTED The command is not supported.
* @retval OT_ERROR_NO_BUFS The command string is too long.
*
*/
void otDiagProcessCmdLine(otInstance *aInstance, const char *aString, char *aOutput, size_t aOutputMaxLen);
otError otDiagProcessCmdLine(otInstance *aInstance, const char *aString, char *aOutput, size_t aOutputMaxLen);
/**
* This function indicates whether or not the factory diagnostics mode is enabled.
+1 -1
View File
@@ -53,7 +53,7 @@ extern "C" {
* @note This number versions both OpenThread platform and user APIs.
*
*/
#define OPENTHREAD_API_VERSION (256)
#define OPENTHREAD_API_VERSION (257)
/**
* @addtogroup api-instance
+26
View File
@@ -129,6 +129,32 @@ void otPlatDiagRadioReceived(otInstance *aInstance, otRadioFrame *aFrame, otErro
*/
void otPlatDiagAlarmCallback(otInstance *aInstance);
/**
* This function sets the gpio value.
*
* @param[in] aGpio The gpio number.
* @param[in] aValue true to set the gpio to high level, or false otherwise.
*
* @retval OT_ERROR_NONE Successfully set the gpio.
* @retval OT_ERROR_INVALID_ARGS @p aGpio is not supported.
* @retval OT_ERROR_NOT_IMPLEMENTED This function is not implemented on the platform.
*
*/
otError otPlatDiagGpioSet(uint32_t aGpio, bool aValue);
/**
* This function gets the gpio value.
*
* @param[in] aGpio The gpio number.
* @param[out] aValue A pointer where to put gpio value.
*
* @retval OT_ERROR_NONE Successfully got the gpio value.
* @retval OT_ERROR_INVALID_ARGS @p aGpio is not supported or @p aValue is NULL.
* @retval OT_ERROR_NOT_IMPLEMENTED This function is not implemented on the platform.
*
*/
otError otPlatDiagGpioGet(uint32_t aGpio, bool *aValue);
/**
* @}
*