📄 netdaq.h.bak
字号:
#include <sys/stat.h>#include <sys/types.h>#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <sys/time.h>#include <fcntl.h> #include <string.h>#include <errno.h>#include <time.h>#include <malloc.h>#include <signal.h>#include <netdb.h>#include <netinet/in.h>#include <sys/socket.h>#include <net/if.h>#include <pthread.h>#include <sys/ioctl.h>#include <math.h>#define MULIT_CONST 10000#define BR_PORT 6666#define DEV_NAME "/dev/netdaq"#define MAJOR_NUM 100#define IOCTL_SET_PARAM _IOR(MAJOR_NUM, 0, char *)#define DSP_DO_FLAG 0x5A#define GP_FLAG 0xAA //#define BC_FLAG 0x55 //#define CH_NUM 8#define GP_SAM_LEN 1050 //每通道光谱采样数#define BC_SAM_LEN 119 //每通道波长采样数#define GP_BUF_LEN (CH_NUM*GP_SAM_LEN*2) //光谱数据缓存长度#define BC_BUF_LEN (CH_NUM*BC_SAM_LEN*2) //波长数据缓存长度typedef unsigned int u32;typedef unsigned short u16;typedef unsigned char u8;int daq_dev;int send_sock = 0;struct sockaddr_in broadcastaddr;int aliving = 0;char data_buf[3000];int data_len;u16 gp_buf[CH_NUM][GP_SAM_LEN];u16 bc_buf[CH_NUM][BC_SAM_LEN];pthread_mutex_t mutex;int can_send = 0;void wait_for_exit(void);void create_socket(void);void do_daq(void);void send_data(void);int send_to(char *buf, int len);void delay(int count);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -