Advertisement
Guest User

Sample code

a guest
Mar 4th, 2015
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <fcntl.h>
  2. #include <stdio.h>
  3. #include <unistd.h>
  4. int main()
  5. {
  6. int fd = open("/dev/ttyS1", O_RDWR);
  7. char test;
  8. if(fd<0)
  9. {
  10. printf("Error\n");
  11. return -1;
  12. }
  13. else
  14. {
  15. read(fd,&test,1);
  16. }
  17. close(fd);
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement