📄 mykey_test(测试程序).c
字号:
#include <stdio.h>#include <stdlib.h>#include <asm/ioctl.h>#include <asm/errno.h>#include <linux/slab.h>#include <fcntl.h>#include <pthread.h>#include <string.h>#include <unistd.h>int fb;unsigned short value;int main(){ fb = open("/dev/my_key",O_RDWR); if(!fb) { printf("open device is fail !!! \n"); return 0; } while(1) { getchar(); read(fb,&value,sizeof(short)); printf("the key value is 0x%04x \n",value); getchar(); } close(fb); return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -