1
0
mirror of https://github.com/ioacademy-jikim/device_driver synced 2025-06-07 16:06:08 +00:00
device_driver/05_day/jni/queue_app.c
ioacademy-jikim e92d98c6d0 first sample
2015-08-19 19:26:23 +09:00

22 lines
323 B
C

#if 1
#include <stdio.h>
#include <poll.h>
#include <fcntl.h>
int main()
{
int i;
int fd, ret;
int temp[64];
fd = open( "/dev/mydev", O_RDONLY );
while (ret = read( fd, temp, sizeof temp ))
{
for( i=0 ; i<(ret/(int)sizeof(int)); i++ )
printf("temp[%d] = %d\n", i, temp[i] );
}
close(fd);
return 0;
}
#endif