Guest User

Untitled

a guest
Sep 29th, 2022
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int main() {
  2.     int fd = open( "/dev/ttyS4", O_RDWR | O_CLOEXEC | O_NOCTTY | O_NONBLOCK );
  3.     if( fd < 0 ) {
  4.         perror( "open" );
  5.         return 1;
  6.     }
  7.     if( uart_enable_rs485( fd, true ) < 0 ) {
  8.         perror( "uart_enable_rs485" );
  9.         return 1;
  10.     }
  11.     close( fd );
  12.     return 0;
  13. }
  14.  
Advertisement
Add Comment
Please, Sign In to add comment