<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[轮子工厂]]></title><description><![CDATA[物有本末，事有终始，知所先后，则近道矣。]]></description><link>https://blog.youkuaiyun.com/faihung</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; faihung]]></copyright><item><title><![CDATA[Linux通过系统函数设置系统时间]]></title><link>https://blog.youkuaiyun.com/faihung/article/details/119326077</link><guid>https://blog.youkuaiyun.com/faihung/article/details/119326077</guid><author>faihung</author><pubDate>Tue, 10 Aug 2021 20:04:15 +0800</pubDate><description><![CDATA[一、描述

通过settimeofday()函数来设置系统时间，这个函数设置的精度可以精确到微秒。


#include &lt;time.h&gt;

int settimeofday(const struct timeval *tv , const struct timezone *tz);

struct timeval {
    time_t      tv_sec;     /* seconds */
    suseconds_t tv_usec;    /* microseconds */
]]></description><category></category></item><item><title><![CDATA[sscanf函数使用详解]]></title><link>https://blog.youkuaiyun.com/faihung/article/details/119325390</link><guid>https://blog.youkuaiyun.com/faihung/article/details/119325390</guid><author>faihung</author><pubDate>Wed, 04 Aug 2021 23:09:16 +0800</pubDate><description><![CDATA[一、描述

sscanf通常被用来解析并转换字符串，其格式定义灵活多变，可以实现很强大的字符串解析功能。

sscanf的原型


#include &lt;stdio.h&gt;
int sscanf(const char *str, const char *format, ...);

str:待解析的字符串;

format:字符串格式描述;

其后是一序列数目不定的指针参数，存储解析后的数据.

二、示例用法

1. sscanf的基本用法

整形数转换


int year, month, day]]></description><category></category></item><item><title><![CDATA[popen使用方法及场景]]></title><link>https://blog.youkuaiyun.com/faihung/article/details/119324978</link><guid>https://blog.youkuaiyun.com/faihung/article/details/119324978</guid><author>faihung</author><pubDate>Mon, 02 Aug 2021 23:06:03 +0800</pubDate><description><![CDATA[1. popen的应用场景

popen应用于执行shell命令，并读取此命令的返值，或者与执行的命令进行交互。

2. popen的实现

popen()函数通过创建一个管道，调用fork()产生一个子进程，执行一个shell以运行命令来开启一个进程。可以通过这个管道执行标准输入输出操作。这个管道必须由pclose()函数关闭，必须由pclose()函数关闭，必须由pclose()函数关闭，而不是fclose()函数（若使用fclose则会产生僵尸进程）。pclose()函数关闭标准I/O流，等待命令执行]]></description><category></category></item><item><title><![CDATA[Linux中的popen函数和system函数]]></title><link>https://blog.youkuaiyun.com/faihung/article/details/119281149</link><guid>https://blog.youkuaiyun.com/faihung/article/details/119281149</guid><author>faihung</author><pubDate>Sat, 31 Jul 2021 20:47:27 +0800</pubDate><description><![CDATA[说在前面，在实际编程中尽量减少使用system函数。


int system(const char *command);

说明：

system()通过调用/bin/sh -c命令执行命令中指定的命令，并在命令完成后返回。在执行该命令期间，SIGCHLD将被阻塞，并且SIGINT和SIGQUIT将被忽略。

返回值：

实际上system调用了三个函数：fork()、exec()、waitpid()。因此有三种返回值：
1. fork()失败或者waitpid()返回除了EINTR之外的出错，则sys.]]></description><category></category></item><item><title><![CDATA[Linux的system和popen的差异]]></title><link>https://blog.youkuaiyun.com/faihung/article/details/119236419</link><guid>https://blog.youkuaiyun.com/faihung/article/details/119236419</guid><author>faihung</author><pubDate>Fri, 30 Jul 2021 23:24:06 +0800</pubDate><description><![CDATA[1. system()和popen()简介

在linux中我们可以通过system()来执行一个shell命令，popen()也是执行shell命令并且通过管道和shell命令进行通信。

system()、popen()给我们处理了fork、exec、waitpid等一系列的处理流程，让我们只需要关注最后的返回结果(函数的返回值)即可。

2. system()、popen()源码

首先我们来看一下这两个函数在源码(伪代码)上面的差异。


int system(const char *command]]></description><category></category></item><item><title><![CDATA[简单的rtsp交互过程]]></title><link>https://blog.youkuaiyun.com/faihung/article/details/119222610</link><guid>https://blog.youkuaiyun.com/faihung/article/details/119222610</guid><author>faihung</author><pubDate>Thu, 29 Jul 2021 22:46:05 +0800</pubDate><description><![CDATA[这里C表示rtsp客户端,S表示rtsp服务端。

C-&gt;:发送流媒体数据前的准备

- C-&gt;S:OPTION request //询问S有哪些方法可用
- S-&gt;C:OPTION response //S回应信息中包括提供的所有可用方法


- C-&gt;S:DESCRIBE request //要求得到S提供的媒体初始化描述信息
- S-&gt;C:DESCRIBE response //S回应媒体初始化描述信息，主要是sdp


- C-&gt;S:SETUP re...]]></description><category></category></item><item><title><![CDATA[工具-虚拟机VMware与Windows主机共享文件介绍]]></title><link>https://blog.youkuaiyun.com/faihung/article/details/119191505</link><guid>https://blog.youkuaiyun.com/faihung/article/details/119191505</guid><author>faihung</author><pubDate>Wed, 28 Jul 2021 22:22:28 +0800</pubDate><description><![CDATA[一、设置共享文件夹功能

虚拟机VMware提供了在宿主机与虚拟机系统之间交换文件的共享文件夹（Shared Folder）功能。不管虚拟机操作系统是Linux还是Windows都可用。你可以通过设置（ Settings）&gt;共享文件夹（Shared Folder）来设置。但是此功能选项必须要安装虚拟机工具（VMware Tools），否则如下所示，否则该功能选项不可用。



二、安装虚拟机工具步骤如下所示：

1. 在对应虚拟机的设置选项（Settings)下，为虚拟机光驱指定虚拟机系统的镜像文件。]]></description><category></category></item><item><title><![CDATA[Ubuntu配置NFS及其挂载设备]]></title><link>https://blog.youkuaiyun.com/faihung/article/details/119155776</link><guid>https://blog.youkuaiyun.com/faihung/article/details/119155776</guid><author>faihung</author><pubDate>Wed, 28 Jul 2021 00:33:49 +0800</pubDate><description><![CDATA[1.在Ubuntu系统中安装NFS

执行命令：


sudo apt-get install nfs-kernel-server

同时会有两个软件包nfs-common和portmap被安装上，如果没有安装成功多安装几次。

2.在Ubuntu系统中的/mnt下建立共享项目nfs_shared


# mkdir nfs_shared 
# chmod 777 -R nfs_shared/

保证使用者都能够读、写、执行。如图



3.在Ubuntu系统中修改NFS配置文件

执行命令：


...]]></description><category></category></item><item><title><![CDATA[Source Insight 使用技巧整理]]></title><link>https://blog.youkuaiyun.com/faihung/article/details/119155624</link><guid>https://blog.youkuaiyun.com/faihung/article/details/119155624</guid><author>faihung</author><pubDate>Tue, 27 Jul 2021 23:18:11 +0800</pubDate><description><![CDATA[通用设置

Options - File Type Options:
- 显示行号：勾选Show line mumbers
- 选中自动高亮：勾选Hightlight references to selected sysmbol
- 转换tab成空格：勾选Expand tabs to spaces，设置Tab width：4

高亮选中符号：F8

代码折叠：View --&gt; Show Outlining

代码默认字体大小：Ctrl + 滑动鼠标滑轮，可以增大缩小代码字体大小


对所有代码文...]]></description><category></category></item><item><title><![CDATA[工具-虚拟机的桥接模式和NAT模式的区别]]></title><link>https://blog.youkuaiyun.com/faihung/article/details/119121095</link><guid>https://blog.youkuaiyun.com/faihung/article/details/119121095</guid><author>faihung</author><pubDate>Mon, 26 Jul 2021 23:37:09 +0800</pubDate><description><![CDATA[1.桥接模式

通过使用物理机的网卡，有自己的IP地址，就像在电脑上虚拟出来另一台主机，它可以访问网内任何一台主机，需要手工为其配置IP地址、子网掩码、需要和宿主机器处于同一个网段，这样虚拟机才能和宿主机器进行通信。同时，由于这个虚拟系统是局域网中的一个独立主机系统，就可以手工配置他的TCP\IP信息，实现通过局域网的网关或路由进行互联网访问。

弊端:

1. Ip地址可能会发生变化 192.150.1.100/192.168.1.101
2. 如果这时传递文件时需要依靠交换机/路由器



2.NAT模]]></description><category></category></item><item><title><![CDATA[工具-如何配置Windows、虚拟机、开发板的网络]]></title><link>https://blog.youkuaiyun.com/faihung/article/details/119120994</link><guid>https://blog.youkuaiyun.com/faihung/article/details/119120994</guid><author>faihung</author><pubDate>Mon, 26 Jul 2021 23:30:39 +0800</pubDate><description><![CDATA[烧录软件和方便调试先要保证电脑windos操作系统、虚拟机linuxr操作系统
和开发板三者之间相互Ping通，要做到这些其实很简单：

1. 打开windows网络和共享中心更改适配器设置



2. 打开这三个的属性，把VMware Bridge Protocol都勾上，如图



3. 打开本地连接的属性再打开IPV4的属性选择使用手动IP如下图所示



4. 点击VMware的虚拟机-&gt; 设置 网络选择桥接如下图所示



网络选择桥接如下图所示



5.1 点击VMware的编...]]></description><category></category></item><item><title><![CDATA[cURL-09_使用curl库进行http通信(转)]]></title><link>https://blog.youkuaiyun.com/faihung/article/details/118979136</link><guid>https://blog.youkuaiyun.com/faihung/article/details/118979136</guid><author>faihung</author><pubDate>Wed, 21 Jul 2021 23:52:21 +0800</pubDate><description><![CDATA[一、LibCurl基本编程框架

关于libcurl，前面已经有了很多介绍，这里就不详西描述了。

在基于LibCurl的程序里，主要采用callback function （回调函数）的形式完成传输任务，用户在启动传输前设置好各类参数和回调函数，当满足条件时libcurl将调用用户的回调函数实现特定功能。

下面是利用libcurl完成传输任务的流程：

1. 调用curl_global_init()初始化libcurl
2. 调用curl_easy_init()函数得到 easy interface .]]></description><category></category></item><item><title><![CDATA[cURL-08_ARM交叉编译]]></title><link>https://blog.youkuaiyun.com/faihung/article/details/118885325</link><guid>https://blog.youkuaiyun.com/faihung/article/details/118885325</guid><author>faihung</author><pubDate>Sun, 18 Jul 2021 23:17:47 +0800</pubDate><description><![CDATA[前面提到过libcurl在Ubuntu环境下的编译安装，本章主要是嵌入式环境下的ARM交叉编译。

执行前面的操作之后，进行arm的交叉编译


./configure --host=arm-himix200-linux CC=arm-himix200-linux-gcc CXX=arm-himix200-linux-g++ 

交叉编译，说实话整了好几个小时没怎么明白，不知道为什么不行。

但是，我把原有工程的的cURL模块拆分出来，修改了Makefile之后，可以交叉编译可以在设备中运行。

目前关于c]]></description><category></category></item><item><title><![CDATA[cURL-07_Linux下使用libcurl实现FTP文件上传下载功能]]></title><link>https://blog.youkuaiyun.com/faihung/article/details/118768254</link><guid>https://blog.youkuaiyun.com/faihung/article/details/118768254</guid><author>faihung</author><pubDate>Thu, 15 Jul 2021 20:42:21 +0800</pubDate><description><![CDATA[Linux下使用libcurl实现FTP单个文件或者压缩包上传下载功能


一、关于FTP

参考：在WIN10上搭建Ftp服务器

二、FTP上传

该FTP上传代码为官网上的demo例程代码，若要为己所用，只需将宏定义修改并准备一个要上传的文件即可。当然，该函数只能上传一个文件或者压缩包至FTP服务器，若要上传多个文件，可以在此例程上进行修改。


#include &lt;stdio.h&gt;
#include &lt;string.h&gt;

#include &lt;curl/curl.h&.]]></description><category></category></item><item><title><![CDATA[工具-在WIN10上搭建Ftp服务器（转）]]></title><link>https://blog.youkuaiyun.com/faihung/article/details/118739638</link><guid>https://blog.youkuaiyun.com/faihung/article/details/118739638</guid><author>faihung</author><pubDate>Wed, 14 Jul 2021 23:12:19 +0800</pubDate><description><![CDATA[在windows10上面搭建你的FTP服务器，正在学服务器这门课程，刚好学到搭建Ftp服务器。所以就在自己电脑上也搭建了一个Ftp服务器。我的电脑是win10的，所以本教程也是在win10上面搭建Ftp服务器。希望能帮到有需要的同学！


一、在windows10中搭建Ftp服务器主要用的是IIS管理器管理控制台

1. 在控制面板里面打开程序功能里面的FTP服务器和web管理工具

二、打开IIS管理器平台，不知道在哪打开的可以直接搜索IIS打开

1.在网站那里右键“添加FTP站点”



2. 输入.]]></description><category></category></item><item><title><![CDATA[cURL-06_cURL和libcurl的安装的安装途径]]></title><link>https://blog.youkuaiyun.com/faihung/article/details/118713856</link><guid>https://blog.youkuaiyun.com/faihung/article/details/118713856</guid><author>faihung</author><pubDate>Tue, 13 Jul 2021 23:48:24 +0800</pubDate><description><![CDATA[cURL的安装一般有三种方式:

一、ubuntu16.04 安装curl，一般用于命令行工具操作

1. 直接安装


sudo apt install curl

2. 或者是下载软件压缩包安装-Ubuntu下安装cURL库用于libcurl开发

2.1 下载curl包

可以在这个网站上找最新的版本 http://curl.haxx.se/download/




wget https://curl.haxx.se/download/curl-7.55.1.tar.gz

2.2 解压


tar]]></description><category></category></item><item><title><![CDATA[cURL-05_curl和libcurl的区别简介(转)]]></title><link>https://blog.youkuaiyun.com/faihung/article/details/118685007</link><guid>https://blog.youkuaiyun.com/faihung/article/details/118685007</guid><author>faihung</author><pubDate>Mon, 12 Jul 2021 22:06:55 +0800</pubDate><description><![CDATA[curl简介

curl是利用URL语法在命令行方式下工作的开源文件传输工具。
它支持很多协议：DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, Telnet and TFTP。

curl同样支持SSL证书,HTTP POST, HTTP PUT,FTP上传，基于表单的HTTP上传，代理(proxies)、cookies]]></description><category></category></item><item><title><![CDATA[shell-shell命令监测程序运行状态]]></title><link>https://blog.youkuaiyun.com/faihung/article/details/118661427</link><guid>https://blog.youkuaiyun.com/faihung/article/details/118661427</guid><author>faihung</author><pubDate>Sun, 11 Jul 2021 22:36:55 +0800</pubDate><description><![CDATA[在系统没有断电的前提下，监控脚本一直处于运行中


1.将av_streamer -i input_stream.so -o output_app.so 后台重定向到无底洞中去或者是运行在后台中
2.检测程序运行的命令


ps |grep -w av_streamer  |grep -v grep|wc -l

监测到运行程序返回1，没有监测到则返回0

3.根据检测到的状态决定是否启动程序
返回0启动程序 av_streamer -i input_stream.so -o output_app.so..]]></description><category></category></item><item><title><![CDATA[makefile-1.2 程序的编译和链接]]></title><link>https://blog.youkuaiyun.com/faihung/article/details/118642113</link><guid>https://blog.youkuaiyun.com/faihung/article/details/118642113</guid><author>faihung</author><pubDate>Sat, 10 Jul 2021 22:49:11 +0800</pubDate><description><![CDATA[一、程序的存储与运行



1.1 程序的存储


.text:  代码段

.data: 已初始化的全局变量，已初始化的静态变量。数组、结构体也是（它们也属于变量）。

.rodata: const变量；字符串

.bss:  未初始化或初始化为0的全局变量;未初始化或初始化为0静态变量。数组、结构体也是（属于变量）。

stack:  函数括弧“{}”中定义的变量（但不包括static声明的变量，static意味着在数据段中存放变量）。

除此以外，在函数被调用时，其参数也会被压入发起调用的进程栈中，并]]></description><category></category></item><item><title><![CDATA[makefile-1.1-Makefile基本概念]]></title><link>https://blog.youkuaiyun.com/faihung/article/details/118641589</link><guid>https://blog.youkuaiyun.com/faihung/article/details/118641589</guid><author>faihung</author><pubDate>Sat, 10 Jul 2021 22:23:42 +0800</pubDate><description><![CDATA[一、一个示例

先看一个代码演示：


#include&lt;stdio.h&gt;
int main()
{
	printf("hello world!\n");
	printf("hello maekfile\n");
	return 0;
}

makefile


hello:helloworld.o
	gcc -o hello helloworld.o
helloworld.o:helloworld.c
	gcc -o helloworld.o -c helloworld.c
clean:
	r]]></description><category></category></item></channel></rss>