onvif 笔记五(discovery client)

本文记录了关于ONVIF协议中Discovery客户端的实现,包括相关源码的使用和参考,帮助理解如何查找和连接ONVIF设备。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值