Pass disable reason to the app

This commit is contained in:
Iscle 2023-05-16 02:10:42 +02:00
parent 173222774f
commit 01029501e2
3 changed files with 19 additions and 3 deletions

View File

@ -16,6 +16,8 @@ extern "C" {
#define PARAM_GET_CONVOLUTION_KERNEL_ID 5
#define PARAM_GET_DRIVER_VERSION_CODE 6
#define PARAM_GET_DRIVER_VERSION_NAME 7
#define PARAM_GET_DISABLE_REASON 8
#define PARAM_GET_DISABLE_REASON_MESSAGE 9
// Param set
#define PARAM_SET_UPDATE_STATUS 0x9002

View File

@ -214,6 +214,20 @@ int32_t ViperContext::handleGetParam(effect_param_t *pCmdParam, effect_param_t *
*pReplySize = sizeof(effect_param_t) + pReplyParam->psize + vOffset + pReplyParam->vsize;
return 0;
}
case PARAM_GET_DISABLE_REASON: {
pReplyParam->status = 0;
pReplyParam->vsize = sizeof(int32_t);
*(int32_t *) (pReplyParam->data + vOffset) = static_cast<int32_t>(disableReason);
*pReplySize = sizeof(effect_param_t) + pReplyParam->psize + vOffset + pReplyParam->vsize;
return 0;
}
case PARAM_GET_DISABLE_REASON_MESSAGE: {
pReplyParam->status = 0;
pReplyParam->vsize = disableReasonMessage.size();
memcpy(pReplyParam->data + vOffset, disableReasonMessage.c_str(), pReplyParam->vsize);
*pReplySize = sizeof(effect_param_t) + pReplyParam->psize + vOffset + pReplyParam->vsize;
return 0;
}
default: {
return -EINVAL;
}

View File

@ -8,9 +8,9 @@
class ViperContext {
public:
enum class DisableReason {
NONE,
UNKNOWN,
enum class DisableReason : int32_t {
UNKNOWN = -1,
NONE = 0,
INVALID_FRAME_COUNT,
INVALID_SAMPLING_RATE,
INVALID_CHANNEL_COUNT,