請教各位大神,使用gSoap工具生成的ONVIF協議的C代碼,想實作攝像頭的AbsoluteMove,我用ONVIF Device Test Tool工具測驗,我的攝像頭是支持AbsoluteMove的,但是我呼叫soap_call___tptz__AbsoluteMove方法時,回傳值永遠是12,攝像頭也沒有動,
有大神知道是什么原因嗎?
這是我的代碼
struct _tptz__AbsoluteMove *AbsoluteMove;
struct _tptz__AbsoluteMoveResponse *AbsoluteMoveResponse;
AbsoluteMove = (_tptz__AbsoluteMove*)soap_malloc(soap, sizeof(struct _tptz__AbsoluteMove));
AbsoluteMoveResponse = (_tptz__AbsoluteMoveResponse*)soap_malloc(soap, sizeof(struct _tptz__AbsoluteMoveResponse));
soap_default__tptz__AbsoluteMove(soap, AbsoluteMove);//記憶體清零
soap_default__tptz__AbsoluteMoveResponse(soap, AbsoluteMoveResponse);
AbsoluteMove->ProfileToken = trt__GetProfilesResponse.Profiles->token;
AbsoluteMove->Position = (tt__PTZVector*)soap_malloc(soap, sizeof(struct tt__PTZVector));
AbsoluteMove->Position->PanTilt = (tt__Vector2D*)soap_malloc(soap, sizeof(struct tt__Vector2D));
AbsoluteMove->Position->PanTilt->x = -0.9798;//P這里是隨便寫的幾個數
AbsoluteMove->Position->PanTilt->y = 0.6768;//T
AbsoluteMove->Position->PanTilt->space = (char*)soap_malloc(soap, 128);
strcpy(AbsoluteMove->Position->PanTilt->space, "http://www.onvif.org/ver10/schema");
AbsoluteMove->Speed = (tt__PTZSpeed*)soap_malloc(soap, sizeof(struct tt__PTZSpeed));
AbsoluteMove->Speed->PanTilt = (tt__Vector2D*)soap_malloc(soap, sizeof(struct tt__Vector2D));;
AbsoluteMove->Speed->PanTilt->x = 1.0;//P方向轉速
AbsoluteMove->Speed->PanTilt->y = 1.0;//T方向轉速
AbsoluteMove->Speed->PanTilt->space = (char*)soap_malloc(soap, 128);
strcpy(AbsoluteMove->Speed->PanTilt->space, "http://www.onvif.org/ver10/schema");
AbsoluteMove->Position->Zoom = (tt__Vector1D*)soap_malloc(soap, sizeof(struct tt__Vector1D));
AbsoluteMove->Position->Zoom->x = 0.7646;//Z
AbsoluteMove->Position->Zoom->space = (char*)soap_malloc(soap, 128);
strcpy(AbsoluteMove->Position->Zoom->space, "http://www.onvif.org/ver10/schema");
AbsoluteMove->Speed->Zoom = (tt__Vector1D*)soap_malloc(soap, sizeof(struct tt__Vector1D));;
AbsoluteMove->Speed->Zoom->x = 1.0;//Z縮放速度
AbsoluteMove->Speed->Zoom->space = (char*)soap_malloc(soap, 128);
strcpy(AbsoluteMove->Speed->Zoom->space, "http://www.onvif.org/ver10/schema");
soap_wsse_add_UsernameTokenDigest(soap, "", UserName.c_str(), PassWord.c_str());
int ret = soap_call___tptz__AbsoluteMove(soap, capa_resp.Capabilities->PTZ->XAddr, NULL, AbsoluteMove, AbsoluteMoveResponse);
if (ret == SOAP_OK)
{
printf("AbsoluteMove----OK\n");
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/186631.html
標籤:其它技術問題
上一篇:哪位大神幫我看看哪錯了,感謝!
