mobile CCTV,mobile surveillance,police body worn cameras

标题: BVCU_SendCmd无回调 [打印本页]

author: Toba    time: 2018-3-5 11:15
标题: BVCU_SendCmd无回调
在使用BVCU_SendCmd的时候 result返回0  但是没有回调信息。




author: Toba    time: 2018-3-5 11:37
应该是返回了错误信息:BVCU_RESULT_E_UNAVAILABLE(-65512 无法获取。例如初始化Dialog时设备不在线 )
author: fanghj90    time: 2018-3-5 12:18
Toba post on2018-3-5 11:37
应该是返回了错误信息:BVCU_RESULT_E_UNAVAILABLE(-65512 无法获取。例如初始化Dialog时设备不在线 )

具体发送的命令是什么?还有参数值。
这个错误,一般是设备不在线。
author: Toba    time: 2018-3-5 15:58
int SendCmd::getZFYInfo(BVCU_HSession hSession, SendCmd_OnGetZFYInfo onEvent, char* puid)
{
        BVCU_Result result = QueryCmd(hSession, puid, NULL, sizeof(BVCU_PUCFG_ZFYInfo), INVALID_DEVICE, BVCU_SUBMETHOD_PU_ZFYINFO);
        if (BVCU_Result_SUCCEEDED(result))
        {
                m_proGetZFYInfo = onEvent;
        }
        return result;
}

BVCU_Result SendCmd:ueryCmd(BVCU_HSession hSession, char* puId, void* cmdData, int dataLen, int device, int subMethod)
{
        BVCU_Command cmd;
        memset(&cmd, 0, sizeof(BVCU_Command));
        cmd.iSize = sizeof(BVCU_Command);
        if (NULL != puId)
        {
                strcpy_s(cmd.szTargetID, puId);
        }
        cmd.OnEvent = SendCmd_OnEvent;
        if (NULL != cmdData)
        {
                memcpy(&cmd.stMsgContent, cmdData, sizeof(BVCU_CmdMsgContent));
        }
        cmd.iTargetIndex = device;
        cmd.iMethod = BVCU_METHOD_QUERY;
        cmd.iSubMethod = subMethod;
        return BVCU_SendCmd(hSession, &cmd);
}
author: Toba    time: 2018-3-5 15:59
Toba post on2018-3-5 11:37
应该是返回了错误信息:BVCU_RESULT_E_UNAVAILABLE(-65512 无法获取。例如初始化Dialog时设备不在线 )

int SendCmd::getZFYInfo(BVCU_HSession hSession, SendCmd_OnGetZFYInfo onEvent, char* puid)
{
        BVCU_Result result = QueryCmd(hSession, puid, NULL, sizeof(BVCU_PUCFG_ZFYInfo), INVALID_DEVICE, BVCU_SUBMETHOD_PU_ZFYINFO);
        if (BVCU_Result_SUCCEEDED(result))
        {
                m_proGetZFYInfo = onEvent;
        }
        return result;
}

BVCU_Result SendCmd:ueryCmd(BVCU_HSession hSession, char* puId, void* cmdData, int dataLen, int device, int subMethod)
{
        BVCU_Command cmd;
        memset(&cmd, 0, sizeof(BVCU_Command));
        cmd.iSize = sizeof(BVCU_Command);
        if (NULL != puId)
        {
                strcpy_s(cmd.szTargetID, puId);
        }
        cmd.OnEvent = SendCmd_OnEvent;
        if (NULL != cmdData)
        {
                memcpy(&cmd.stMsgContent, cmdData, sizeof(BVCU_CmdMsgContent));
        }
        cmd.iTargetIndex = device;
        cmd.iMethod = BVCU_METHOD_QUERY;
        cmd.iSubMethod = subMethod;
        return BVCU_SendCmd(hSession, &cmd);
}




欢迎光临 mobile CCTV,mobile surveillance,police body worn cameras (http://bbs.besovideo.com:8067/) Powered by Discuz! X3.2