diff --git a/src/ViPER4Android.h b/src/ViPER4Android.h index 42f9a16..c4aed03 100644 --- a/src/ViPER4Android.h +++ b/src/ViPER4Android.h @@ -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 diff --git a/src/ViperContext.cpp b/src/ViperContext.cpp index 97ab4e8..8b0639a 100644 --- a/src/ViperContext.cpp +++ b/src/ViperContext.cpp @@ -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(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; } diff --git a/src/ViperContext.h b/src/ViperContext.h index faa4a17..815f00b 100644 --- a/src/ViperContext.h +++ b/src/ViperContext.h @@ -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,