⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gprs.h

📁 嵌入式linux下的gprs代码
💻 H
字号:
/* * $Id$ * EAX-400 linux实验指导书配套实验代码 * 实验3.3 GPRS通信 * Copyright (c) 2006 Beijing EFLAG Technology Co.,LTD * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA  */#ifndef GPRS_H#define GPRS_H#include <termios.h>// 命令类型#define CT_ACCCUR	(0x01)	// 获得当前设置#define CT_SETPARM	(0x02)	// 设置值// qreadbuf中的数据按照:UTC,纬度,经度,卫星数,海拔排列#define UTCSZ		(16U)#define LATSZ		(16U)#define LONSZ		(16U)#define SATSZ		(8U)#define ALTSZ		(8U)struct qt_read_struct {	char utc[UTCSZ];	char latitude[LATSZ];	char longitude[LONSZ];	char satelites[SATSZ];	char altitude[ALTSZ];};struct gprs_stat {	char *name;		char *serialdev;			// 设备名, 采用非默认设置时必须初始化	int baudspeed;				// 波特率, 采用非默认设置时必须初始化	speed_t Bbaudspeed;	long timeout;				// 超时值	//struct cmd_operations *cmd;		// 保留	int fds;				// 串口的文件描述符	struct termios oldsterm;		// 旧串口的终端设置	char *rbuf;				// 从串口读数据的缓冲(原始数据)	char *sbuf;				// 向串口写的缓冲区(原始数据)	//struct qt_read_struct *qreadbuf;	// 从串口读数据的缓冲	//char *qwritebuf;			// 向串口写的缓冲区	//ssize_t nread;	};void sc_testgprs(int);void sc_start(int);void sc_stop(int);void sc_autostart(int, unsigned char, char *);void sc_sw(int, unsigned char, char *);void sc_hw(int, unsigned char, char *);void sc_syncmode(int, char *);void sc_pwrdown(int, unsigned char, char **);struct cmd_operations {	void (*testgprs)(int);	void (*start)(int);	void (*stop)(int);	void (*sw)(int, unsigned char, char *);	void (*hw)(int, unsigned char, char *);};	int read_from_serial(struct gprs_stat *);int write_to_serial(struct gprs_stat *);int recover_serial(struct gprs_stat *);int parse_cmd(char *);int parse_msg(struct gprs_stat *);//extern int parse_options(int, char **, struct gprs_stat *);#endif	/* GPRS_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -