3 Star 11 Fork 5

流风葬落花 / HikvisionISAPI

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
main.cpp 1.87 KB
一键复制 编辑 原始数据 按行查看 历史
流风葬落花 提交于 2022-07-22 10:21 . init
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <unistd.h>
#include "app/functions/md5.h"
#include "app/cJSON/cJSON.h"
#include "app/camera/hikvision.h"
#include "app/functions/tinyxml2.h"
#include "app/web/httpserver.h"
using namespace tinyxml2;
/*线程池*/
pthread_t tid[11] = { 0 };
int main()
{
HikCamera::getInstance()->init("192.168.1.64", 80, "admin", "hik123456");
//HikCamera::getInstance()->devInfo();
int now_t = Timer::get_unix_timestamp();
int rValue = Functions::random2(10, 99, now_t);
std::string filePath = "./";
filePath.append(std::to_string(now_t));
filePath.append("_");
filePath.append(std::to_string(rValue));
filePath.append(".jpg");
HikCamera::getInstance()->putCapture(1, filePath.c_str());
//线程管理
//int ret0 = pthread_create(&tid[0], NULL, HttpServer::http_server_pthread, NULL); //WEB线程
// pthread_exit(NULL); //等待所有线程完毕
return 0;
}
int main2()
{
/*printf("%s 向你问好!\n", "Hikvision");
char md5_str[50] = { 0 };
char md5_src[] = "19870214";
Md5::md5(md5_src, strlen(md5_src), md5_str);
printf("md5_test1:%s\r\n", md5_str);
char testchr[] = "qop=\"auth\", realm=\"IP Camera(J3036)\", nonce=\"326265323a31616638343838383a615bf81ef820463399cc83e705158951\", stale=\"FALSE\"";
char nonceHeadChr[] = "nonce=\"";
char* p = strstr(testchr, nonceHeadChr);
if (p == NULL) { return -1; }
p += strlen(nonceHeadChr);
if (strlen(p) < 60) { return -1; }
char nonceChr[61] = { 0 };
memcpy(nonceChr, p, 60);
std::cout << nonceChr << std::endl;
return 0;*/
}
//std::string Char2Hex(char a)
//{
// std::string str = "";
// int n = a;
// for (int i = 2 * sizeof(char) - 1; i >= 0; i--)
// {
// str += "0123456789ABCDEF"[((n >> i * 4) & 0xF)];
// }
// return str;
//}
C++
1
https://gitee.com/cqnews/hikvision-isapi.git
git@gitee.com:cqnews/hikvision-isapi.git
cqnews
hikvision-isapi
HikvisionISAPI
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891