![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
嵌入式
文章平均质量分 81
disadministrator
这个作者很懒,什么都没留下…
展开
-
fork()小知识
fork小知识:进程创建方法:fork、exec、clone,父进程等待子进程结束是用wait等待。 ^^^^^fork^^^^^当前进程调用fork后,如果成功则fork函数返回0,另外返回子进程的进程号给父进程。其中父程序要等待子程序执行完才继续执行。^^^^^^exec^^^^^^在当先程序中执行exec会将exec指定的程序替换当前程序的,而进程号保持不变,但原来的堆栈等被原创 2014-09-17 20:10:32 · 586 阅读 · 0 评论 -
gettimeofday()函数
#include <stdio.h>#include <sys/time.h>int main(){ struct timeval tv,tv1; gettimeofday(&tv,NULL); printf("s:%d ms:%d\n",(int)(tv.tv_sec),(int)(tv.tv_usec)); gettimeofday(&tv1,NULL);原创 2018-04-23 14:37:06 · 6494 阅读 · 0 评论 -
长时间判断网络连接情况(小工具)
设备莫名奇妙的掉线过,但不知道是不是本身网络不稳定引起的,所以借鉴了网络上的一个小函数加工下来放设备里后台运行,判断设备掉线时间和此小东西判断的是否一致,如果是就说明是网络抖动原因,因为设备和服务器心跳为60s,所以我设置了50s。#include <stdio.h>#include <unistd.h>#include <string.h> #i...原创 2018-04-09 13:53:19 · 1019 阅读 · 0 评论 -
嵌入式使用小程序
判断是否链接网线:#define NETCARD "eth0"struct ethtool_value{ __uint32_t cmd; __uint32_t data; };int IsConnect_Router(void){ struct ethtool_value edata; //only pc h原创 2018-03-26 09:42:53 · 1207 阅读 · 0 评论 -
无名管道pipe简单使用
pipe.c#include <sys/types.h> #include <sys/stat.h> #include <sys/termios.h> /* for winsize */ #include <sys/ioctl.h> #include <stdio.h> /* for convenience */ #include <stdli原创 2018-02-27 11:56:45 · 477 阅读 · 0 评论 -
cJSON使用
#include "cJSON.h"#include #include int Parse_json( char *srcJson ){ cJSON *json , *json_data, *data , *user_id , *user ,*mac , *raw; json = cJSON_Parse(srcJson); if (!json){原创 2018-02-02 11:12:57 · 563 阅读 · 0 评论 -
Linux非阻塞读取串口数据
#include <stdio.h>#include<sys/stat.h>#include<fcntl.h>#include <stdlib.h>char *dev="/dev/ttyUSB0";int OpenDev(char *Dev){ int fd = open( Dev, O_RDWR | O_NOCTTY | O_NDELAY); if (-原创 2017-12-28 14:22:28 · 2383 阅读 · 0 评论 -
read()接受缓存覆盖(如果没有读取,下次覆盖)
#include <stdio.h>#include <sys/stat.h>#include <fcntl.h>#include <stdlib.h>#include <string.h>char *dev="/dev/ttyUSB0";int OpenDev(char *Dev){ int fd = open( Dev, O_RDWR | O_NOCTTY | O_NDELA原创 2018-01-11 14:11:11 · 796 阅读 · 0 评论 -
文章标题
转自:http://www.cnblogs.com/kuliuheng/p/4062941.html test1.c#include <pthread.h>#include <stdio.h>#include <stdlib.h>#include <string.h>void *thread_function(void *arg);void *thread_function1(void *转载 2017-07-21 10:03:26 · 230 阅读 · 0 评论 -
sprintf与snprintf区别
在GCC中,该函数名称就snprintf(),而在VC中称为_snprintf()。由于不是标准函数,没有一个统一的标准来规定该函数的行为,所以导致了各厂商间的实现版本可能会有差异。差异发生在参数 n。在GCC中,参数n是要向str写入3个字符,包括'\0'字符;在VC中,参数n是要写入的字符串的总字符数。在GCC中运行如下程序:#include int main(){转载 2017-07-06 09:32:14 · 378 阅读 · 0 评论 -
android使用USB抓log
转自: 大神的博客: http://blog.csdn.net/wzy_1988/article/details/42233611Log分类 Android日志主要分为kernel、radio、event、main这四种log。Kernel Log kernel log属于Linux内核的log ,可以通过读取/proc/kmsg转载 2017-05-04 10:21:43 · 1998 阅读 · 0 评论 -
android中打开串口打印
转自:http://blog.csdn.net/y_lang/article/details/46989801user版本打开uart如何在user版本中使用串口(uart)bootable/bootloader/lk/app/mt_boot/mt_boot.c582 #ifdef USER_BUILD 583转载 2017-04-07 10:56:49 · 4455 阅读 · 0 评论 -
一些笔记
make -C /usr/src/linux-2.6.33 -M /home/kylin/qudong/hello单独编译一个驱动指令,无须在Makefile中指定KERNEL_DIR转载 2014-12-11 17:54:09 · 515 阅读 · 0 评论 -
read-only file system
adb shell中执行rm -rf abc时出现:read-only file system 执行:#mount -o remount -o rw /system就可以解决。转载 2014-12-02 20:35:49 · 627 阅读 · 0 评论 -
mosquitto(windows)作为broker,paho作为client
环境: client :ubuntu broker:windows 32bit下载mosquitto 的exe版本,直接安装运行,如果不过,请自行上网搜索安装过程以及解决办法;本文主要讲解paho的demo过程,而且还是参考其他人的博客,博客地址:https://blog.csdn.net/qingdujun/article/details/71055759#mqtt-c-client%E5%AE...原创 2018-06-22 15:25:36 · 1079 阅读 · 0 评论