Home > Net >  Excuse me everybody ONVIF protocol detection equipment soap_recv___wsdd__ProbeMatches (function retu
Excuse me everybody ONVIF protocol detection equipment soap_recv___wsdd__ProbeMatches (function retu

Time:10-16

I use gSOAP generated the ONVIF protocol framework of C code, I am ready to realize the first step, device discovery, but call result=soap_recv___wsdd__ProbeMatches (soap, & amp; Rep); , the return value result=1, don't know what's the matter, I have changed the username and password,
The code is as follows:
SOAP_ASSERT (NULL!=(soap=ONVIF_soap_new (SOAP_SOCK_TIMEOUT)));

ONVIF_init_header (soap);//set the header description
ONVIF_init_ProbeType (soap, & amp; The req);//set for the scope and type of equipment
Result=soap_send___wsdd__Probe (soap, SOAP_MCAST_ADDR, NULL, & amp; The req);//to the multicast address broadcast the Probe message
While (SOAP_OK==result)//cycle receiving equipment sent message
{
Memset (& amp; Rep, 0 x00, sizeof (rep));
Result= soap_recv___wsdd__ProbeMatches (soap, & amp; Rep);
If (SOAP_OK==result) {
If (soap - & gt; The error) {
Soap_perror (soap, "ProbeMatches");
} else {//reply message successfully received the equipment
Dump__wsdd__ProbeMatches (& amp; Rep);

If (NULL!=rep. Wsdd__ProbeMatches) {
The count +=rep. Wsdd__ProbeMatches - & gt; __sizeProbeMatch;
for(i=0; i ProbeMatch=rep. Wsdd__ProbeMatches - & gt; ProbeMatch + I;
If (NULL! Cb)={
Cb (probeMatch - & gt; XAddrs);//use service address device to perform functions callback
}
}
}
}
} else if (soap - & gt; The error) {
break;
}
}
  • Related