View: 10460|Reply: 1

application program code for driver development of orange pi win

[Copy link]

4

threads

5

posts

42

credits

Novice

Rank: 1

credits
42
Published in 2017-12-25 14:48:31 | Show all floors |Read mode
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;
}

4

threads

5

posts

42

credits

Novice

Rank: 1

credits
42
 Author| Published in 2017-12-26 20:53:26 | Show all floors
thank u......
Reply

Use magic report

You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list