Guest User

Untitled

a guest
Jul 15th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. stty -F /dev/ttyO0 speed 115200
  2. stty -F /dev/ttyO0 raw
  3. stty -F /dev/ttyO0 speed 115200
  4. stty -F /dev/ttyO0 -echo
  5.  
  6. #define TIOCGRS485 0x542e
  7. #define TIOCSRS485 0x542f
  8.  
  9. struct serial_rs485 rs485conf;
  10. if ((ttydev = open( argv[i + 1], O_RDWR | O_NOCTTY | O_NONBLOCK)) < 0)
  11. errOut( "\nERROR parsevil: TTY device could not be opened: %s\n\n", argv[i + 1]);
  12.  
  13. rs485conf.flags |= SER_RS485_ENABLED;
  14. rs485conf.flags |= SER_RS485_RTS_ON_SEND;
  15. if (ioctl (ttydev, TIOCSRS485, &rs485conf) < 0)
  16. {
  17. printf("ioctrl Error handling. See errno. \n");
  18. }else
  19. {
  20. printf("set rs485 ok\n");
  21. }
Add Comment
Please, Sign In to add comment