|
我现在想获取一下群组的列表,这是我的代码,麻烦帮忙看一下,或者是你提供一下示例给我也行。
void OnRequestGroupCallBack(BVCSP_HSession hSession, BVCSP_Command* pCommand, BVCSP_Event_SessionCmd* pParam)
{
printf("********************iDataCount[%d]*********************\n", pParam->stContent.iDataCount);
}
void puRequestGroupList()
{
printf("***********************puRequestGroupList*****************************\n");
BVCSP_Command pCommand;
pCommand.iSize = sizeof(BVCSP_Command);
pCommand.iMethod = BVCU_METHOD_QUERY;
pCommand.iTargetIndex = 0;
pCommand.iSubMethod = BVCU_SUBMETHOD_CONF_LIST;
pCommand.OnEvent = OnRequestGroupCallBack;
int ret = BVCSP_SendCmd(g_hSession, &pCommand);
printf("BVCSP_SendCmd ret[%0X] BVCU_RESULT_E_INVALIDARG[%0X]\n", ret, BVCU_RESULT_E_INVALIDARG);
}
void OnEvent(BVCSP_HSession hSession, int iEventCode, void* pParam)
{
int iResult = (intptr_t )(pParam);
printf("session event hSession:%p iEventCode:%d result:%0X \n", hSession, iEventCode, iResult);
if (BVCSP_EVENT_SESSION_OPEN == iEventCode && iResult == BVCU_RESULT_S_OK)
{ // 登录成功,注册解码器信息。
printf("***********************login success*******************************\n");
puRequestGroupList();
}
else if(BVCSP_EVENT_SESSION_OPEN == iEventCode && iResult == BVCU_RESULT_E_AUTHORIZE_FAILED)
{
printf("***********************authorize failed*******************************\n");
}
else
g_hSession = NULL;
} |
|