通过isapi协议抓拍图片

2023-05-16

PC端通过isapi协议抓拍摄像头图片

说明:
1、isapi协议类似于http协议
2、通过isapi协议抓拍图片要经过这几个步骤
2.1、先创建socket,再连接服务器(也就是摄像机)connect
2.2、发送没有认证得请求send
2.3、服务器响应401,根据www-Authenticate返回来得属性值,生成摘要认证
2.4、再次发送带有认证得请求
2.5、服务器响应400。

**以下是实现得代码:
tcpclient.cpp

#ifndef WINDOWS
#define WINDOWS
#endif

#ifdef WINDOWS
#include<WINSOCK2.H>
#include <WS2tcpip.h>  
#else
#include <iconv.h>
#include <netinet/in.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <string.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#endif 

#ifdef WINDOWS
#pragma warning(disable:4996) 
#pragma comment(lib, "WS2_32.lib")
#endif 

#include <errno.h>
#include <string.h>
#include "httpauth.h"

char * url = (char*)"/ISAPI/Streaming/channels/101/picture";
char * cmd = (char*)"GET";
const char * username_t = "admin";
const char * passworld_t = "znrt8899";
const char * realm_t = "DS-2CD7A27EWD-IZS";
const char * nonce_t = "4d6a46444d7a5a464e3045364e5449355a546c695932553d";
const char * nc_t = "00000001";
const char * cnonce_t = "8887920ea7e5c1c8";
const char * response_t = "5a9aa58fb654e667ad9d8e8adaa336df";
const char * qop_t = "auth";

FILE *fp = NULL;

void initialization();
int main(int argc, char * argv[])
{
	int sd, ret;
	char rcv_buf[1024*1024] = {0};
	struct sockaddr_in ser_sockaddr;
	int cnt = 0;
	
	httpauth_t auth;
	initialization();
	while (1)
	{
		//返回套接字描述符
		sd = socket(AF_INET, SOCK_STREAM, 0); //创建socket连接 选择IPV4的TCP协议数据包
		if (sd == -1)
		{
			printf("TCP套接字创建失败\r\n");
		}

		//设置sockaddr_in结构体中相关参数
		ser_sockaddr.sin_family = AF_INET;                                        //地址族 IPV4
	    ser_sockaddr.sin_port = htons(80);                                        //设置为要连接的服务器的端口号(short数据转化为网络数据)
		ser_sockaddr.sin_addr.s_addr = inet_addr("192.168.0.200");                //设置服务器的IP地址(字符串转化为整形)
        ret = connect(sd, (struct sockaddr *)&ser_sockaddr, sizeof(ser_sockaddr));//连接服务器
		if (ret == -1)
		{
			printf("连接服务器失败\r\n");
			return -1;
		}
		    printf("连接服务器成功\r\n");

			//struct timeval timeout = { 10, 0 };
		if (cnt == 0) 
		{
			httpauth_set_auth(&auth, username_t, passworld_t, realm_t, nonce_t, nc_t, cnonce_t, response_t, qop_t);
			request(sd, &auth, 0);
			recv(sd, rcv_buf, 1024, 0);
			printf("%s\r\n", rcv_buf);
			prase_response(rcv_buf, &auth);
		}
		else 
		{
			int rs = 1;
			int buflen = 0;
			int rev_pos = 0;
			int len;
			int jpeg_len;
			httpauth_get_response(&auth, cmd, url);
			memset(rcv_buf, 0, 1024);
			request(sd, &auth, 1);
			Sleep(1);

			len = sizeof(rcv_buf);
			while (rs)
			{
				buflen = recv(sd, &rcv_buf[rev_pos], len - rev_pos, 0);
				printf("%s\r\n", rcv_buf);
				printf("buflen is %d \r\n", buflen);
				printf("rcv_buf is %d \r\n", sizeof(rcv_buf));
				if (buflen < 0)
				{
					// 由于是非阻塞的模式,所以当buflen为EAGAIN时,表示当前缓冲区已无数据可读
					// 在这里就当作是该次事件已处理
					if (errno == EINTR)
						continue;
					else
						break;
				}
				else if (buflen == 0)
				{
					// 这里表示对端的socket已正常关闭.
					char *begin = NULL;
					begin = strstr(rcv_buf, "Content-Length:");
					jpeg_len = atoi(begin + 15);
					begin = strstr(rcv_buf, "\r\n\r\n");
					fp = fopen("./pic.JPEG", "wb");
					fwrite(begin + 4, jpeg_len, 1, fp);
	
				}

				if (buflen != 0)
					rs = 1;
				else
					rs = 0;
				    rev_pos += buflen;
			}
			   return 0;
		}

		closesocket(sd);
		cnt++;
		
	}
	return 0;
}
void initialization() {
	//初始化套接字库
	WORD w_req = MAKEWORD(2, 2);//版本号
	WSADATA wsadata;
	int err;
	err = WSAStartup(w_req, &wsadata);
	if (err != 0) {
		printf("初始化套接字库失败!");
	}
	else {
		printf("初始化套接字库成功!");
	}
	//检测版本号
	if (LOBYTE(wsadata.wVersion) != 2 || HIBYTE(wsadata.wHighVersion) != 2) {
		printf("套接字库版本号不符!");
		WSACleanup();
	}
	else {
		printf("套接字库版本正确!");
	}

}

httpauth.h

#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#define ISspace(x) isspace((int)(x)) 
#define USERLEN 33
#define REALMLEN 64
#define QOPLEN   32
typedef struct httpauth_t {
	char username[USERLEN], password[USERLEN];
	char qop[QOPLEN], realm[QOPLEN], nc[QOPLEN];
	char cnonce[REALMLEN], response[REALMLEN], nonce[REALMLEN];
}httpauth_t;

void to_hex(char *in, int len, unsigned char *out);
void md5(const uint8_t *initial_msg, size_t initial_len, uint8_t *digest);

int httpauth_set_auth(httpauth_t *auth, const char* username, const char* password, const char* realm, const char* nonce, const char* nc, const char* cnonce, const char* response, const char* qop);
int httpauth_get_response(httpauth_t *auth, char *cmd, char *url);
void request(int socket_fd, httpauth_t *auth, int flag);
int prase_response(char * response_buf, httpauth_t *auth);

httpauth.cpp

#include "httpauth.h"

#ifndef WINDOWS
#define WINDOWS
#endif

#ifdef WINDOWS
#include<WINSOCK2.H>
#include <WS2tcpip.h>  
#else
#include <iconv.h>
#include <netinet/in.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <string.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>

#endif // WINDOWS

#ifdef WINDOWS
#pragma warning(disable:4996) 
#pragma comment(lib, "WS2_32.lib")
#endif // WINDOWS
const uint32_t k[64] = {
	0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee ,
	0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501 ,
	0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be ,
	0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821 ,
	0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa ,
	0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8 ,
	0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed ,
	0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a ,
	0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c ,
	0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70 ,
	0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x04881d05 ,
	0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665 ,
	0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039 ,
	0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1 ,
	0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1 ,
	0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391 };

// r specifies the per-round shift amounts
const uint32_t r[] = {
	7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22,
	5,  9, 14, 20, 5,  9, 14, 20, 5,  9, 14, 20, 5,  9, 14, 20,
	4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23,
	6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21
};


// leftrotate function definition
#define LEFTROTATE(x, c) (((x) << (c)) | ((x) >> (32 - (c))))




void to_bytes(uint32_t val, uint8_t *bytes)
{
	bytes[0] = (uint8_t)val;
	bytes[1] = (uint8_t)(val >> 8);
	bytes[2] = (uint8_t)(val >> 16);
	bytes[3] = (uint8_t)(val >> 24);
}

uint32_t to_int32(const uint8_t *bytes)
{
	return (uint32_t)bytes[0]
		| ((uint32_t)bytes[1] << 8)
		| ((uint32_t)bytes[2] << 16)
		| ((uint32_t)bytes[3] << 24);
}

void md5(const uint8_t *initial_msg, size_t initial_len, uint8_t *digest) {
	// These vars will contain the hash
	uint32_t h0, h1, h2, h3;

	// Message (to prepare)
	uint8_t *msg = NULL;

	size_t new_len, offset;
	uint32_t w[16];
	uint32_t a, b, c, d, i, f, g, temp;

	// Initialize variables - simple count in nibbles:
	h0 = 0x67452301;
	h1 = 0xefcdab89;
	h2 = 0x98badcfe;
	h3 = 0x10325476;

	//Pre-processing:
	//append "1" bit to message    
	//append "0" bits until message length in bits � 448 (mod 512)
	//append length mod (2^64) to message

	for (new_len = initial_len + 1; new_len % (512 / 8) != 448 / 8; new_len++)
		;

	msg = (uint8_t*)malloc(new_len + 8);
	memcpy(msg, initial_msg, initial_len);
	msg[initial_len] = 0x80; // append the "1" bit; most significant bit is "first"
	for (offset = initial_len + 1; offset < new_len; offset++)
	msg[offset] = 0; // append "0" bits

	// append the len in bits at the end of the buffer.
	to_bytes(initial_len * 8, msg + new_len);
	// initial_len>>29 == initial_len*8>>32, but avoids overflow.
	to_bytes(initial_len >> 29, msg + new_len + 4);

	// Process the message in successive 512-bit chunks:
	//for each 512-bit chunk of message:
	for (offset = 0; offset < new_len; offset += (512 / 8)) {
		// break chunk into sixteen 32-bit words w[j], 0 � j � 15
		for (i = 0; i < 16; i++)
			w[i] = to_int32(msg + offset + i * 4);

		// Initialize hash value for this chunk:
		a = h0;
		b = h1;
		c = h2;
		d = h3;

		// Main loop:
		for (i = 0; i < 64; i++) {
			if (i < 16) {
				f = (b & c) | ((~b) & d);
				g = i;
			}
			else if (i < 32) {
				f = (d & b) | ((~d) & c);
				g = (5 * i + 1) % 16;
			}
			else if (i < 48) {
				f = b ^ c ^ d;
				g = (3 * i + 5) % 16;
			}
			else {
				f = c ^ (b | (~d));
				g = (7 * i) % 16;
			}

			temp = d;
			d = c;
			c = b;
			b = b + LEFTROTATE((a + f + k[i] + w[g]), r[i]);
			a = temp;
		}

		// Add this chunk's hash to result so far:
		h0 += a;
		h1 += b;
		h2 += c;
		h3 += d;
	}

	// cleanup
	free(msg);

	//var char digest[16] := h0 append h1 append h2 append h3 //(Output is in little-endian)
	to_bytes(h0, digest);
	to_bytes(h1, digest + 4);
	to_bytes(h2, digest + 8);
	to_bytes(h3, digest + 12);
}

void to_hex(char *in, int len, unsigned char *out)
{
	static char const hex[] = "0123456789abcdef";
	unsigned i;

	memset(out, 0, len * 2 + 1);

	for (i = 0;i < len;i++)
	{
		out[2 * i] = hex[(in[i] >> 4) & 0x0F];
		out[2 * i + 1] = hex[(in[i] & 0x0F)];
		//printf("%d#%2.2x##%2.2x###%2.2x\n",i,in[i],out[2*i],out[2*i+1]);
	}
}

int httpauth_set_auth(httpauth_t *auth, const char* username, const char* password, const char* realm, const char* nonce, const char* nc, const char* cnonce, const char* response, const char* qop)
{
	strcpy(auth->username, username);
	strcpy(auth->password, password);
	strcpy(auth->realm, realm);
	strcpy(auth->nonce, nonce);
	strcpy(auth->nc, nc);
	strcpy(auth->cnonce, cnonce);
	strcpy(auth->response, response);
	strcpy(auth->qop, qop);
	return 0;
}

int httpauth_get_response(httpauth_t *auth, char *cmd, char *url)
{
	uint8_t strH1[512], strH2[512];
	uint8_t md5_h1[33], md5_h2[33];
	uint8_t result[16], result2[16];
	size_t len;

	//md5(md5(<username>:<realm>:<password>):<nonce>:md5(<cmd>:<url>))
	memset(strH1, 0, 512);
	sprintf((char*)strH1, "%s:%s:%s", auth->username, auth->realm, auth->password);
	len = strlen((char*)strH1);
	md5(strH1, len, result);
	to_hex((char*)result, 16, md5_h1);
    memset(strH2, 0, 512);
	sprintf((char*)strH2, "%s:%s", cmd, url);
	len = strlen((char*)strH2);
	md5(strH2, len, result2);
	to_hex((char*)result2, 16, md5_h2);


	memset(strH1, 0, 512);
	sprintf((char*)strH1, "%s:%s:%s:%s:%s:%s", md5_h1, auth->nonce, auth->nc, auth->cnonce, auth->qop, md5_h2);
	//	printf("response %s\r\n",strH1);
	len = strlen((char*)strH1);
	md5(strH1, len, result);
	to_hex((char*)result, 16, (unsigned char *)auth->response);
	//	printf("response = %s\r\n",auth->response);
    return 0;
}

/**********************************************************************/
/* send a no authentication request */
/**********************************************************************/
void request(int socket_fd, httpauth_t *auth, int flag)
{
	char buf[2048];
	int pos = 0;
    pos = sprintf(&buf[pos], "GET /ISAPI/Streaming/channels/101/picture HTTP/1.1\r\n");
	pos += sprintf(&buf[pos], "Host:192.168.0.200\r\n");
	pos += sprintf(&buf[pos], "Connection: keep-alive\r\n");
	pos += sprintf(&buf[pos], "Cache-Control: max-age=0\r\n");
	if (1 == flag)
	{
		pos += sprintf(&buf[pos], "Authorization: Digest username=\"%s\", realm=\"%s\", nonce=\"%s\", uri=\"/ISAPI/Streaming/channels/101/picture\", response=\"%s\", qop=auth, nc=00000001, cnonce=\"%s\"\r\n", auth->username, auth->realm, auth->nonce, auth->response, auth->cnonce);
	}
	    pos += sprintf(&buf[pos], "Upgrade-Insecure-Requests: 1\r\n");
	    pos += sprintf(&buf[pos], "User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36\r\n");
	    pos += sprintf(&buf[pos], "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\r\n");
	    pos += sprintf(&buf[pos], "Accept-Encoding: gzip, deflate, sdch\r\n");
	    pos += sprintf(&buf[pos], "Accept-Language: zh-CN,zh;q=0.9\r\n");
	    pos += sprintf(&buf[pos], "Cookie: language=zh\r\n");
	    pos += sprintf(&buf[pos], "\r\n");
	    printf("%s\r\n", buf);
	    int len = send(socket_fd, buf, strlen(buf), 0);
	    printf("发送长度是%d", len);
	

}

/**********************************************************************
int prase_response(char * response_buf )
**********************************************************************/

int prase_response(char * response_buf, httpauth_t *auth)
{
	    char * begin = NULL, *end = NULL;
	   if (strstr(response_buf, "401") != NULL)
	   {
			begin = strstr(response_buf, "\"");
			end = strstr(begin + 1, "\"");
			memcpy(auth->qop, begin + 1, end - begin - 1);
			auth->qop[end - begin - 1] = 0;
			begin = strstr(end + 1, "\"");
			end = strstr(begin + 1, "\"");
			memcpy(auth->realm, begin + 1, end - begin - 1);
			auth->realm[end - begin - 1] = 0;
			begin = strstr(end + 1, "\"");
			end = strstr(begin + 1, "\"");
			memcpy(auth->nonce, begin + 1, end - begin - 1);
			memcpy(auth->cnonce, auth->nonce, 16);
	   }
		
	
	else if (strstr(response_buf, "200") != NULL)
		printf("the servers return 200 ok\r\n");

	return 0;

}


程序源码百分之九十来自这里 github :https://github.com/kyhkl/hivisoion_projcet.git

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

通过isapi协议抓拍图片 的相关文章

  • STM8S 功耗总结

    http blog sina com cn s blog 542bad910101ral2 html STM8S103 STM8S003 PA1脚虽可以用外部中断唤醒CPU xff0c 但功耗过大 xff0c 有300uA电流 xff0c
  • ESP32四轴飞控硬件设计

    一 前言 目前许多入门级开源飞控都是基于STM32系列的 xff0c 基于此系列的有非常严重的短板 xff0c 例如说通信方面 xff0c 需要外置通信模块 ESP32本身带有WIFI和蓝牙 xff0c 在通信方面有着一定的优势 xff0c
  • C++弹窗拦截程序,弹窗广告怎么关闭?不用问,我教你怎么屏蔽!

    现在大家使用电脑的频率越来越高 xff0c 上课写作业 上班做工作 娱乐生活 在家购物等 xff0c 我们使用电脑的时间越来越长 相信很多人都和小编一样 xff0c 经常遇到电脑的右下角出现出现弹窗广告的问题 要去叉掉就很麻烦 而且有时候想
  • VNC远程桌面使用方法

    参考 xff1a https blog csdn net weixin 41803874 article details 81233789 一共两台电脑 xff0c 分别为服务端和客户端 xff0c 为与场景联系方便 xff0c 我们将需要
  • 激光雷达闭环检测/地点识别算法OverlapTransformer/SeqOT(2022)

    最新激光雷达闭环检测 地点识别算法 OverlapTransformer已经完整开源 xff0c 相关论文已经被RAL IROS 2022收录 https github com haomo ai OverlapTransformer Ove
  • 我的创作纪念日

    初心未改 xff0c 继续向前
  • 最新激光雷达闭环检测/地点识别算法CVTNet(2023)

    CVTNet以激光点云多类投影生成的二维图为输入 xff0c 利用cross transformer将多类信息交叉融合 xff0c 为激光点云提取强特异性描述子 xff0c 实现SLAM闭环检测或全局定位功能 此外 xff0c CVTNet
  • python使用ffmpeg推流出现OSError: [Errno 2] No such file or directory

    python使用ffmpeg推流出现OSError Errno 2 No such file or directory 具体错误如下 xff1a Traceback span class token punctuation span mos
  • GDB调式工具学习笔记---单步执行和跟踪函数调用

    GDB调式工具学习笔记 单步执行和跟踪函数调用 简介1 单步执行和跟踪函数调用1 1 示例程序1 2 常用命令1 2 1 help1 2 2 list l 1 2 3 quit1 2 4 start1 2 5 next xff08 n xf
  • GDB调式工具学习笔记---断点

    GDB调式工具学习笔记 断点 2 断点2 1 示例代码2 2 常用命令2 2 1 display和undisplay2 2 2 break b 2 2 3 continue xff08 c xff09 2 2 4 disable2 2 6
  • C语言网络编程——UDP

    C语言网络编程 UDP 2 1 基于UDP的网络编程2 2 1 服务端实现2 2 2 客户端实现 2 1 基于UDP的网络编程 2 2 1 服务端实现 使用socket函数 xff0c 创建一个socket使用bind 函数 xff0c 绑
  • STM8S电源管理-重点活跃停机模式

    http blog sina com cn s blog 542bad910101qkru html
  • 多态的定义

    多态是什么 xff1f 多态 polymorphism 是面向对象编程 OOP object oriented programming 的一个重要特征 xff0c 顾名思义为多种形态 xff0c 详细解释为一个接口 xff0c 多种实现 x
  • 虚函数实现多态的原理

    1 C 43 43 中如何实现多态 基类中先声明一个虚函数至少有一个继承该基类的子类 2 虚函数实现多态的原理 当一个类中出现虚函数或着子类继承了虚函数时 xff0c 就会在该类中产生一个虚函数表 xff08 virtual table x
  • 停车场车牌识别项目

    停车场车牌识别项目 简介开发环境技术栈1 Sqlite2 TTS3 摄像头使用教程 实现效果图源码 简介 该项目的应用场景为停车场 xff0c 记录车辆的进出时间 xff0c 对车辆进行收费 开发环境 Windows 下的 QT 技术栈 Q
  • STM32串口输出字符串

    目录 串口步骤1 确定 IO 口并初始化2 初始化 UATR3 UART 中断配置4 编写 UART 中断服务函数5 1 方法一 xff1a 重定向 fputc 5 2 方法二 xff1a 将字符串分割成一个一个字符发送出去 效果附源码 串
  • 常用Linux命令

    目录 Shell常用Shell命令1 目录操作类2 文本操作类3 用户管理4 文件权限类5 磁盘管理类6 网络操作类7 控制终端类8 开关机类 Shell小技巧 Shell shell是一个应用程序 xff0c 作为用户与内核信息传递的桥梁
  • VSCode与Keil联合开发STM32

    目录 1 为什么要联合开发2 配置VSCode的环境1 安装c c 43 43 2 安装Embedded IDE3 设置编译工具4 导入 STM32 工程5 配置编译器选项6 烧录工具选择 3 附 1 为什么要联合开发 Keil容易出现中文
  • 8.类的继承

    目录 1 继承的定义2 继承的作用3 继承的语法4 类继承成员属性的访问权限5 利用参数列表 xff0c 初始化父类的私有成员6 继承中的构造函数与析构函数7 总结共继承的权限问题8 类中的隐藏问题9 类中的多继承10 类中多级继承11 菱
  • 14.数据成员属性

    目录 1 静态属性 xff1a 2 类中的静态成员 xff1a 3 类中的静态函数 xff1a 4 类中的const成员5 类中的常量成员6 类中的常量函数 xff1a 7 常量对象 xff1a 1 静态属性 xff1a 回顾C语言的静态变

随机推荐

  • 15.异常处理

    目录 1 为什么需要异常处理 xff1f 2 在c 43 43 中异常处理的方法 xff1f xff1f 3 异常的抛出4 异常的类型捕捉5 系统预定义的异常类型6 异常的再抛出 1 为什么需要异常处理 xff1f 用 new 运算符动态分
  • 我的创作纪念日

    一周年纪念
  • SD卡无法格式化怎么办的解决方法

    SD卡无法格式化怎么办的解决方法 http www upantool com jiaocheng neicunka 5399 html 每次SD卡受损都要格卡的朋友 xff0c 一大堆游戏 相片 视频 xff0c 还有导航地图要重新上传 x
  • cmake --Cannot specify link libraries for target" XX" which is not built by this project.

    cmake Cannot specify link libraries for target 34 XX 34 which is not built by this project 原CMakeLists txt内容 xff1a find
  • cmake & CMakeLists.txt

    文章目录 前言先从体验开始1 一个最简单的例子 xff1a 2 例子升级 xff0c 将hello c生成为一个库 xff1a 3 例子升级 xff0c 将源代码和库分开放 xff1a 4 让可执行文件在 bin 目录 xff0c 库文件在
  • 配置Jetson XAVIER NX串口通信,不使用union传递浮点数

    下载minicom span class token function sudo span span class token function apt get span span class token function install s
  • C语言实现大写字母与小写字母之间的互转

    思路 咋一看 xff0c 好像没什么思路 其实我们只需要知道ASCII值就行 xff0c 65和97这两个数字作为程序员必须牢记于心 xff0c 因为这两个数字分别是ASCII表中字母 a 和 A 的十进制值 xff01 xff01 xff
  • 实时显示电脑当前网速和CPU利用率等信息 && 设置软件开机自启动

    相信不少朋友在平时看实时网速时 xff0c 用的都是360那个悬浮窗 xff0c 或者其它杀毒软件提供的 而今天就介绍一款绿 xff08 逼 xff09 色 xff08 格 xff09 更高的用于显示当前网速 CPU及内存利用率的桌面悬浮窗
  • Win10只能安装GPT磁盘的解决办法

    最近帮同事重装系统时 xff0c 遇到了之前没遇到过的问题 无论是微软官方的U盘制作工具还是MSDN下载的镜像加上rufus都无法解决的问题 xff0c 那就是在选择安装磁盘时会提示无法安装 xff0c 点击错误详细会出现下面的提示框 xf
  • C语言中常用运算符

    C语言中常用到的运算符主要有算数运算符 逻辑运算符 位运算发 关系运算符和其它的 一 算数运算符 主要是我们在数学运算中使用的一些加减乘除运算符 xff0c 但是有几个运算符与我们数学中的不 太一样 xff08 以下会说明 xff09 xf
  • 如何下载Ubuntu 20.04并运行在VM虚拟机上

    第一步 下载Ubuntu镜像文件 下载Ubuntu的镜像 xff0c 我们首先想到的就是去官网下载 xff0c 但是由于服务器在国外 xff0c 下载速度可能只有几KB S 甚至压根就下载不了 其实我们有更好的选择 那就是选择我们国内的一些
  • Unbutntu18.04 caffe在make编译时出现对‘cv::imread(cv::String const&, int)’未定义的引用 解决方案

    在CAFFE编译时会出现如下错误 xff1a CXX LD o build release tools caffe bin build release lib libcaffe so xff1a 对 cv imread cv String
  • yolov5返回坐标

    yolov5返回坐标 yolov5目前已更新到v6版 xff0c 上面up主的文章是以前的版本 xff0c 代码对应不上 xff0c 所以特地在此更新一下 xff1a 参考链接 xff1a https blog csdn net weixi
  • ISD9160学习笔记02_搭建NuMicro开发环境

    http blog csdn net iotisan article details 53166357 所谓学习笔记 xff0c 不能免俗地总会讲到开发环境 嵌入式这一行就是这样 xff0c 每做一个新方案 xff0c 就得学习它的CPU
  • RS232不能通信的问题

    RS232不能通信 xff0c 根据PCB图检查了硬件电路是否导通 xff0c 短路状态使用串口工具发送消息收到消息可以收发 xff0c 编程方面大概率无误 由原理图可见 xff0c 地 TXD和RXD设计错误 xff0c 没有反着接 用杜
  • NRF24L01+实现一对一数据双向传输

    NRF24L01 43 实现一对一数据双向传输 目录说明带负载数据ACK的双向通信配置NRF24L01 43 的收发程序收发双方数据的处理测试代码和结果 目录 说明 最近在diy四轴飞行器的时候 xff0c 需要实现四轴和遥控器之间的双向通
  • RT-Thread开启串口.中断和DMA接收(手把手教学)

    1 串口介绍 串口是指数据一位一位地顺序传送 xff0c 其特点是通讯线路简单 xff0c 只要一对传输线就可以实现双向通信 xff08 可以直接利用电话线作为传输线 xff09 xff0c 从而大大降低了成本 xff0c 特别适用于远距离
  • stm32使用MPU6050读取温度值验证I2C

    通过MPU6050测温来进行I2C的验证学习 关于MPU6050寄存器相关可以参考https blog csdn net he yuan article details 76559569 I2C时序很多 xff0c 我是直接以原子I2C的程
  • String的长度限制

    String的长度 是有限制的 String存储 String其实是使用的一个char类型的数组来存储字符串中的字符的 看看字符串返回长度的方法 返回值类型是int类型 其长度最大限制为2 31 1 xff0c 那么说明了数组的长度是0 2
  • 通过isapi协议抓拍图片

    PC端通过isapi协议抓拍摄像头图片 说明 xff1a 1 isapi协议类似于http协议 2 通过isapi协议抓拍图片要经过这几个步骤 2 1 先创建socket xff0c 再连接服务器 xff08 也就是摄像机 xff09 co