OnvifClientPTZ onvif c++ 无法获取配置选项
OnvifClientPTZ onvif c++ unable to get configuration options
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 returns 值为 1 (#response)。
对象 #onvifDevice 似乎没问题(onvifDevice.hasPTZ returns true)。
我试过调试 onvifDevice.GetPTZUrl(strUrl) returns true 并将 strUrl 设置为 192.168.1.88:2000/device/services 这是 PtzProxy 对象的 soap_endpoint (ptzProxy.soap_endpoint = strUrl.c_str();) 似乎没问题。另外 soap_action 是 "www.onvif.org/ver20/ptz/wsdl/GetConfigurationOptions" 这似乎也不错。
我正在使用 https://github.com/xsmart/onvifcpplib.
在 PTZ 代理中 returns 此处:
tptz__GetConfigurationOptionsResponse->soap_get(soap, "tptz:GetConfigurationOptionsResponse", "");
if (soap->error)
return soap_recv_fault(soap, 0);
如有任何帮助,我们将不胜感激。
我找到了解决办法。问题出在这一行:
int response = PTZ.GetConfigurationOptions(tptz__GetConfigurationOptionsResponse, t->token);
OnvifPTZClient#GetConfigurationOptions 请求 PTZConfiguration 令牌,而不是配置文件令牌。所以正确的行是:
response = PTZ.GetConfigurationOptions(tptz__GetConfigurationOptionsResponse, tr->PTZConfiguration->token);
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 returns 值为 1 (#response)。 对象 #onvifDevice 似乎没问题(onvifDevice.hasPTZ returns true)。 我试过调试 onvifDevice.GetPTZUrl(strUrl) returns true 并将 strUrl 设置为 192.168.1.88:2000/device/services 这是 PtzProxy 对象的 soap_endpoint (ptzProxy.soap_endpoint = strUrl.c_str();) 似乎没问题。另外 soap_action 是 "www.onvif.org/ver20/ptz/wsdl/GetConfigurationOptions" 这似乎也不错。 我正在使用 https://github.com/xsmart/onvifcpplib.
在 PTZ 代理中 returns 此处:
tptz__GetConfigurationOptionsResponse->soap_get(soap, "tptz:GetConfigurationOptionsResponse", "");
if (soap->error)
return soap_recv_fault(soap, 0);
如有任何帮助,我们将不胜感激。
我找到了解决办法。问题出在这一行:
int response = PTZ.GetConfigurationOptions(tptz__GetConfigurationOptionsResponse, t->token);
OnvifPTZClient#GetConfigurationOptions 请求 PTZConfiguration 令牌,而不是配置文件令牌。所以正确的行是:
response = PTZ.GetConfigurationOptions(tptz__GetConfigurationOptionsResponse, tr->PTZConfiguration->token);