原创 c 語言中級篇

1.struct的用法2.函數指針的用法3.const 作用 const 修飾它前面的量,如果const在最前面則把const往後移一位的最用是一樣的。 4.#*的作用 # 空指令,無任何效果

原创 linux 清空串口緩存

http://blog.chinaunix.net/uid-20564848-id-74763.html tcflush(int fd, int queue_selector)   //對以寫但未發出,或已接收但未讀數據的flus

原创 linux vim 的使用

1. 暫時顯示/取消行號: 使用Vim打開文件後,在Normal模式下輸入 :set number(或 :set nu)顯示行號 :set nonumber (或 :set nonu)取消行號 2. 永久顯示行號 查找Vim設定

原创 mysql環境搭建 實例:1

1.mysql 命令  sudo service mysql restart  Usage: /etc/init.d/mysql start|stop|restart|reload|force-reload|status 2.mysql

原创 藍牙cc2540 開發問題

http://blog.csdn.net/jiangjunjie_2005/article/details/9001517     1.    問:什麼是藍牙通信? 答:藍牙通訊最初設計初衷是方便移動電話(手機)與配件之間進行低

原创 Linux http post 請求 實例

nclude <stdio.h> #include <stdlib.h> #include <unistd.h> #include "../include/tuobao_tcpclient.h" int http_post(tuobao_

原创 Linux多線程與進程之間通信 實例2

/* ************************************************************************ * Description: main.c * Version: 1.0 * Revi

原创 Linux 多線程與進程間通信 實例 1

#include <unistd.h> #include <stdio.h> #include <stdlib.h> int main() { pid_t pc, pr; pc = fork(); if(pc==0) //子進程 { wh

原创 tcp udp 實例

/* ***********************************************************************

原创 Linux 實現DHCP自動獲取IP地址

1.  在內核中添加以下選項: Networking  --->    Networking support          Networking options  --->              Packet socket    

原创 shell 腳本 修改系統時間

#!/bin/bash if [ ! -n "$1" ] ;then     echo usage date.sh HHMMSS for examp

原创 cc2540 實戰1

//service 註冊服務,提供數據 GATTServApp_RegisterService() //client獲取服務handle值,一個服務

原创 獲取文件屬性函數

stat函數 表頭文件:    #include <sys/stat.h> 函數定義:    int stat(const char *file_name, struct stat *buf); 函數說明:    通過文件名fi

原创 crc 校驗

1-1:crc8 算法 /**  * crc8 校驗  *初始值 00 異或值 00  */ uint8 xCal_crc(uint8 *ptr,uint32 len)  {uint8 crc,i;  crc = 0x00;     //

原创 Linux 建立samba用戶

實例1:配置賬號密碼登錄 安裝samba服務器 創建共享目錄 sudo apt-get install samba samba-common sudo mkdir /home/share sudo chmod 777 /home/shar