onvif discovery 客户端
其他部分源码参见之前的博文。
#include <sys/time.h>
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <string.h>
#include "soapH.h"
#include "soapStub.h"
static char uuid[128] = {0};
static char probeType[128] = {0};
static char wsaTo[128] = {0};
static char wsaAction[128] = {0};
SOAP_FMAC5 int SOAP_FMAC6 soap_discovery_start(struct soap *soap, const char *soap_endpoint, const char *soap_action, struct d__ProbeType *d__Probe)
{
struct __dndl__Probe soap_tmp___dndl__Probe;
if (!soap_action)
soap_action = "http://www.onvif.org/ver10/network/wsdl/Probe";
soap->encodingStyle = NULL;
soap_tmp___dndl__Probe.d__Probe = d__Probe;
soap_begin(soap);
soap_serializeheader(soap);
soap_serialize___dndl__Probe(soap, &soap_tmp___dndl__Probe);
if (soap_begin_count(soap))
return soap->error;
if (soap->mode & SOAP_IO_LENGTH)
{
if (soap_envelope_begin_out(soap)
|| soap_putheader(soap)
|| soap_body_begin_out(soap)
|| soap_put___dndl__Probe(soap, &soap_tmp___dndl__Probe, "-dndl:Probe", NULL)
|| soap_body_end_out(soap)
|| soap_envelope_end_out(soap))
return soap->error;
}
if (soap_end_count(soap))
return soap->error;
if (soap_connect(soap, soap_endpoint, soap_ac