2016-05-22 123 views
1
tt__Profile *t = profiles.Profiles.at(0); 

OnvifClientPTZ PTZ(onvifDevice); 

_tptz__GetConfigurationOptions tptz__GetConfigurationOptions; 
_tptz__GetConfigurationOptionsResponse tptz__GetConfigurationOptionsResponse; 
tt__PTZConfigurationOptions *options; 

int response = PTZ.GetConfigurationOptions(tptz__GetConfigurationOptionsResponse, t->token); 

问题是PTZ#GetConfigurationOptions返回值为1(#response)。 对象#onvifDevice似乎没事(onvifDevice.hasPTZ返回true)。 我试过调试和onvifDevice.GetPTZUrl(strUrl)返回true并将strUrl设置为192.168.1.88:2000/device/services这是PtzProxy对象(ptzProxy.soap_endpoint = strUrl.c_str();)的soap_endpoint并且它似乎没事的。另外soap_action是“www.onvif.org/ver20/ptz/wsdl/GetConfigurationOptions”,这似乎也很好。 我正在使用https://github.com/xsmart/onvifcpplibOnvifClientPTZ onvif C++无法获取配置选项

在PTZ代理返回这里:

tptz__GetConfigurationOptionsResponse->soap_get(soap, "tptz:GetConfigurationOptionsResponse", ""); 
if (soap->error) 
    return soap_recv_fault(soap, 0); 

任何帮助,将不胜感激。

回答

0

我找到了解决方案。问题出现在这一行:

int response = PTZ.GetConfigurationOptions(tptz__GetConfigurationOptionsResponse, t->token); 

OnvifPTZClient#GetConfigurationOptions请求PTZConfiguration令牌,而不是配置文件令牌。所以正确的行将是:

response = PTZ.GetConfigurationOptions(tptz__GetConfigurationOptionsResponse, tr->PTZConfiguration->token);