当前位置:网站首页>Hisilicon [hi3531]onvif protocol is implemented based on gSOAP and OpenSSL_ Code article
Hisilicon [hi3531]onvif protocol is implemented based on gSOAP and OpenSSL_ Code article
2022-07-22 08:58:00 【I&You】
Hayes [Hi3531]onvif Protocol implementation is based on gsoap and openssl_ Code section
onvif Of openssl and gsoap You can refer to the previous article
Hayes [Hi3531]onvif Protocol implementation is based on gsoap and openssl
Write code
Attach directly main function code
int result = 0;
struct soap soap;
soap_init(&soap);
enum xsd__boolean ForceStorage;
//******************************************************************
char * ip;
char Mediaddr[256] = "";
char profile[256] = "";
struct _tds__GetCapabilities req;
struct _tds__GetCapabilitiesResponse rep;
req.Category = (enum tt__CapabilityCategory *)soap_malloc(&soap, sizeof(int));
// apply 4 Bytes of memory
req.__sizeCategory = 1;// Type of element sequence
*(req.Category) = (enum tt__CapabilityCategory)0;//0 Means to get the enumeration of all types of information
char endpoint[255];
memset(endpoint, '\0', 255);
if (argc > 1)
{
ip = argv[1];
}
else
{
ip = "192.168.1.18";
}
sprintf(endpoint, "http://%s/onvif/device_service", ip);
// Here, enter the address of the module you want to get information
soap_call___tds__GetCapabilities(&soap, endpoint, NULL, &req, &rep);
if (soap.error)
{
printf("[%s][%d]--->>> soap result: %d, %s, %s\n", __func__, __LINE__,
soap.error, *soap_faultcode(&soap),
*soap_faultstring(&soap));
}
else
{
printf("get capability success\n");
printf("Mediaddr_XAddr====%s\n", rep.Capabilities->Media->XAddr);
strcpy(Mediaddr, rep.Capabilities->Media->XAddr);
}
printf("\n");
return result;
Makefile Documentation
Makefile.inc The contents of the document :
SHELL = /bin/bash
CC := arm-hisiv500-linux-gcc
CPP := arm-hisiv500-linux-g++
LD := arm-hisiv500-linux-ld
AR := arm-hisiv500-linux-ar
STRIP := strip
CFLAGS += -c -g -Wall -DWITH_DOM -DWITH_OPENSSL -DDEBUG
CFLAGS += $(INCLUDE)
# openssl Directory name
OPENSSL_DIR = /usr/local/ssl
# Source file
SOURCES_ONVIF += \
../onvif/soapC.c \
../onvif/soapClient.c \
../onvif/stdsoap2.c \
../onvif/wsaapi.c \
../onvif/dom.c \
../onvif/mecevp.c \
../onvif/smdevp.c \
../onvif/threads.c \
../onvif/wsseapi.c \
../onvif/duration.c
# Target file
OBJECTS_ONVIF := $(patsubst %.c,$(TEMPDIR)%.o,$(filter %.c, $(SOURCES_ONVIF)))
# Header file path
INCLUDE += -I../onvif/ \
-I$(OPENSSL_DIR)/include \
# Static library Links OpenSSL
LDLIBS += $(OPENSSL_DIR)/lib/libssl.a \
$(OPENSSL_DIR)/lib/libcrypto.a \
-ldl -lm \
# Link library ( other )
LDLIBS += -lpthread
%.o: %.cpp
@echo " CPP " [email protected];
@$(CPP) $(CFLAGS) -c -o [email protected] $<
%.o: %.c
@echo " CC " [email protected];
@$(CC) $(CFLAGS) -c -o [email protected] $<
.PHONY: all clean
makefile The contents of the document :
include Makefile.inc
PROGRAM = PTZ
SOURCES += myptz.c
OBJECTS := $(patsubst %.c,$(TEMPDIR)%.o,$(filter %.c, $(SOURCES)))
all: $(OBJECTS_ONVIF) $(OBJECTS_COMM) $(OBJECTS)
$(CC) -o $(PROGRAM) $(OBJECTS_ONVIF) $(OBJECTS_COMM) $(OBJECTS) $(LDLIBS)
clean:
rm -f $(OBJECTS_ONVIF)
rm -f $(OBJECTS_COMM)
rm -f $(OBJECTS)
rm -f $(PROGRAM)
Burn program
After compilation, the execution file shown in the figure will be generated
If there is an Internet port, you can use nfs File system or tftp Transfer program , Use it if you don't have it SecureCRT Serial transmission
边栏推荐
- Self study golang [3.7map exercise code]
- 文件查找命令
- Self study the definition of golang [3.5go language array, range keyword] array, and use the for loop to traverse one-dimensional array
- C语言刷题笔记之基础不牢地动山摇 <一>
- Self study golang [3.3go language loop statement] for loop syntax structure, omit initial conditions, omit incremental conditions, omit the application of end conditions
- OSPF republish
- Shell exercise: Statistics of word frequency
- Typo in static class property declarationeslint
- 2021-09-23
- Fastjason, Jackson handling time and date issues precautions
猜你喜欢
Error: a connection was successfully established with the server, but
openlayers 使用canvas绘制圆形头像图标
Postman 配置全局变量 postman设置全局token
Self study golang [Chapter 1: basic knowledge of go language] Why do you want to learn go language? The relationship between go language and C language? Founder of go language? What are the characteri
Pointer summary
Self study golang [3.1 defining variables] use VaR keyword to define variables, use var() to define variables collectively, omit int keyword and VaR keyword, and use colon: to replace the definition
三星6818基于uboot的流水灯程序
指针总结篇
Linear table * sequential table (7000 words detailed explanation)
李宏毅《机器学习》丨5. Tips for neural network design(神经网络设计技巧)
随机推荐
JS object deep copy
Sharing the ultimate breakthrough strategy used by professional traders for many years (with a full set of trading templates)
RPA是什么?推荐让电商运营10倍提效的自动化工具
File operation and related functions
基于[海思Hi3516dv300]开发的内核定时器中断
[三星6818]gpio模拟spi信号编写门禁卡识别模块驱动
FastJson、JackJson处理时间、日期问题注意事项
[C语言] 文件操作《一》
JS时间和时间戳的转换
Self study golang [3.6 slice practice code] slice length, upper limit, copy, delete and increase
OSPF republish
How to build a smart park with 5g and mobile edge computing servers
文件操作《二》(5000字总结篇)
Self study the definition of golang [3.5go language array, range keyword] array, and use the for loop to traverse one-dimensional array
监督学习(回归、分类问题)与无监督学习(聚类问题)
mysql
去除tinymce中粘贴的样式
Weak foundation, shaking earth and mountains, Niu Ke brushes the title "II"
OSPF 重发布
RK3288关于LVDS信号配置和1080p视频信号的详解