teste.c

来自「It is a software to decode information r」· C语言 代码 · 共 36 行

C
36
字号
#include <termios.h> #include <string.h>                                                        #include <stdio.h>  #include <stdlib.h>                                                         #include <unistd.h>                                                          #include <fcntl.h>                                                           #include <sys/signal.h>                                                      #include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <errno.h>#include "garmin_api.h"#include "connect.h"char port[30];int baudrate=19200;int main(void){	int fd, tam;	char buf[1000];	strcpy(port,"/dev/ttyUSB0");	init_port(&fd,&port[0],baudrate);		while(1)	{		read_port(&fd,&buf[0],&tam);		buf[tam]=0;				printf("%s",buf);	}		return 0 ;}

⌨️ 快捷键说明

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