资源简介
目前网络上能找到的onvif开发实例源码很少,希望该代码能有助于各位大侠进行onvif开发
代码片段和文件信息
#include
#include
#include
//#include
//#include
#include “soapH.h“
#include “soapStub.h“
int main(int argc char *argv[])
{
//struct soap discovery_soap;
struct soap *soap;
int result = 0;
struct d__ProbeType req;
struct d__ProbeMatchesType resp;
struct d__ScopesType sScope;
struct SOAP_ENV__Header header;
int count = 0;
// struct SOAP_ENV__Header header;
// char guid_string[100];
// uuid_t uuid;
UUID uuid;
unsigned char *uuid_cstr = NULL;
UuidCreate(&uuid);
UuidToStringA(&uuid &uuid_cstr);
//soap_init(&discovery_soap);
//soap = &discovery_soap;
soap = soap_new();
if(soap==NULL)
return -1;
////////////////////////////////////////////////////////////////////////////
// discovery test
// uuid_generate(uuid);
// uuid_unparse(uuid guid_string);
// soap_omode(soap SOAP_IO_FLUSH|SOAP_IO_STORE);
soap_set_namespaces(soap namespaces);
//超过5秒钟没有数据就退出
soap->recv_timeout = 5;
soap_default_SOAP_ENV__Header(soap &header);
header.wsa__MessageID = (LPCSTR)uuid_cstr;
RpcStringFreeA(&uuid_cstr);
header.wsa__To = “urn:schemas-xmlsoap-org:ws:2005:04:discovery“;
header.wsa__Action = “http://schemas.xmllocal_soap.org/ws/2005/04/discovery/Probe“;
soap->header = &header;
soap_default_d__ScopesType(soap &sScope);
sScope.__item = ““;
//sScope.__item = “onvif://www.onvif.org“;
soap_default_d__ProbeType(soap &req);
req.Scopes = &sScope;
req.Types = ““;
//req.Types = “dn:NetworkVideoTransmitter“;
do
{
soap_call___dndl__Probe(soap “soap.udp://239.255.255.250:3702/“ NULL &req &resp);
if (soap->error) {
printf(“soap error: %d %s %s\n“ soap->error *soap_faultcode(soap) *soap_faultstring(soap));
result = soap->error;
break;
}
else
{
printf(“soap_call___dndl__Probe __sizeProbeMatch=%d\r\n“resp.__sizeProbeMatch);
printf(“Target EP Address : %s\r\n“ resp.ProbeMatch[0].wsa__EndpointReference.Address);
printf(“Target Type : %s\r\n“ resp.ProbeMatch[0].Types);
printf(“Target Service Address : %s\r\n“ resp.ProbeMatch[0].XAddrs);
printf(“Target metadata Version : %d\r\n“ resp.ProbeMatch[0].metadataVersion);
printf(“Target Scopes Address : %s\r\n“ resp.ProbeMatch[0].Scopes->__item);
}
}while(0);
soap_destroy(soap); // remove deserialized class instances (C++ only)
soap_end(soap); // clean up and remove deserialized data
////////////////////////////////////////////////////////////////////////////
failed:
soap_free(soap);//detach and free runtime context
soap_done(soap); // detach context (last use and no longer in scope)
return result;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2821 2011-09-08 11:15 discovery_cs\discovery-nvc.c
文件 3736 2011-09-08 10:50 discovery_cs\discovery-nvt.c
文件 167 2011-08-18 13:50 discovery_cs\gen.bat
文件 1278 2011-08-18 17:53 discovery_cs\Makefile
文件 1467 2011-09-08 10:44 discovery_cs\Makefile.win
文件 39 2011-08-18 17:02 discovery_cs\namespaces.c
文件 220449 2011-08-18 17:56 discovery_cs\nvc
文件 221253 2011-08-18 17:56 discovery_cs\nvt
文件 5077 2011-09-08 14:12 discovery_cs\onvif_dis.dsp
文件 541 2011-09-07 21:56 discovery_cs\onvif_dis.dsw
文件 189440 2011-09-08 14:12 discovery_cs\onvif_dis.ncb
文件 680448 2011-09-08 14:12 discovery_cs\onvif_dis.opt
文件 1912 2011-09-08 11:15 discovery_cs\onvif_dis.plg
文件 2142 2011-09-08 10:43 discovery_cs\Project1.dev
文件 47269 2011-08-18 13:50 discovery_cs\remotediscovery.h
文件 5625 2011-08-12 11:42 discovery_cs\remotediscovery.wsdl
文件 901 2011-08-18 13:50 discovery_cs\RemoteDiscoveryBinding.nsmap
文件 203771 2011-08-18 13:50 discovery_cs\soapC.c
文件 6418 2011-09-08 11:01 discovery_cs\soapClient.c
文件 466944 2011-08-10 13:44 discovery_cs\soapcpp2.exe
文件 87607 2011-08-18 13:50 discovery_cs\soapH.h
文件 6398 2011-08-18 13:50 discovery_cs\soapServer.c
文件 19493 2011-08-18 13:50 discovery_cs\soapStub.h
文件 486128 2011-08-16 12:09 discovery_cs\stdsoap2.c
文件 88790 2011-08-09 13:24 discovery_cs\stdsoap2.h
文件 11689 2011-08-18 09:00 discovery_cs\WS-typemap.dat
目录 0 2011-09-08 15:40 discovery_cs
----------- --------- ---------- ----- ----
2761803 27
............此处省略0个文件信息
- 上一篇:图像亮度调整源代码
- 下一篇:downloadli
nk.txt
评论
共有 条评论