3gdaemon.h
来自「linux系统下3G模块守护进程测试源代码」· C头文件 代码 · 共 92 行
H
92 行
/**************************************************************Description: head file of 3G Daemon.$Log: **************************************************************/#ifndef _LINUX_3GDAEMON_H#define _LINUX_3GDAEMON_H//===================================================// head files//===================================================#include <unistd.h>#include <stdio.h>#include <stdlib.h>#include <signal.h>#include <termio.h>#include <fcntl.h>#include <unistd.h>#include <string.h>#include <sys/time.h>#include <time.h>#include <sys/types.h>#include <sys/ioctl.h>#include <sys/wait.h>#include <sys/stat.h>#include <glib.h>#include <pthread.h> #include <semaphore.h> #include <dbus/dbus.h>#include <dbus/dbus-glib.h>//===================================================// global//===================================================//===================================================// macros define//===================================================#define LOCK_FILE "3GDaemon.lock"#define LOG_FILE "3GDaemon.log"// path of device node#define DEVICE_NAME "/dev/ttyHS0"//#define DEVICE_NAME "/dev/ttyUSB2"// value for return#define SUCCEED 0#define ERROR 1#define FAIL -1#define ZERO_LEN 0L#define BUFFER_LEN 1024// default baudrate#define BAUDRATE B115200 // time for timeout (us)#define DELAY_FOR_READ_TIME 500000#define DELAY_FOR_OTHER_TIME 1000// Buffer size#define BUF_MAX_SIZE 500#define BUF_MAX_NUM 20//===================================================// function declare//===================================================int OpenCom(const char *deviceName);int ReadCom(unsigned char *buffer, int readLen);int WriteCom(unsigned char *buffer);int SendAtCommand(char *comd);int ReceiveResponse(char *repBuffer); static void log_message(FILE *logfile, char *message){ if(!logfile) return; fprintf(logfile,"%s\n",message);}static int QueryCallMesg(void){ return 0;}#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?