This is the application program code for driver development of orange pi win ...can anyone explain the logic of the program #include<stdio.h> #include<sys/types.h> #include<sys/stat.h> #include<fcntl.h> #include<string.h> int main(int argc, char *argv[]) { int cnt, fd; char buf[32]= {0}; if(argc !=2) { Printf(“Usage : %s</dev/xxx>\r\n”, argv[0]); Return -1; } fd = open (argv[1], 0_RDWR); if(fd < 0) { printf(“APP Error pen device is Failed!\r\n”); return -1; } read(fd, buf, sizeof(buf)); printf(“buf = %s\r\n”, buf); close(fd); return 0; }
|