📄 app.c
字号:
//app.c for t500usb USB module testing#include <stdio.h>#include <fcntl.h>#include <sys/types.h>#include <sys/stat.h>#include <linux/types.h>#include <string.h>int main(int argc, char* argv[]){ char* str; int i, j; int fd = open("/dev/usb/t500usb", O_RDWR); if(fd == -1) { printf("Open BA-T500USB port failed!\n"); return -1; } str = "a123456789b123456789\x0a c123456789d123456789\x0a e123456789f123456789\x0a g123456789\x0a"; j = write(fd, str, strlen(str)); //if str include "\x0", you should use like this: write(fd, str, 77); printf("%d=%s", j, str); close(fd);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -