// This ioctl is Linux specific, so keep it private for now
 private int ioctl(int fd, int cmd, serial_struct data) {
   // Do the logging here as this does not go through the JTermios which normally does the logging
   log = log && log(5, "> ioctl(%d,%d,%s)\n", fd, cmd, data);
   int ret = m_Clib.ioctl(fd, cmd, data);
   log = log && log(3, "< tcsetattr(%d,%d,%s) => %d\n", fd, cmd, data, ret);
   return ret;
 }
 public int ioctl(int fd, int cmd, int[] data) {
   return m_Clib.ioctl(fd, cmd, data);
 }
 public int tcsetattr(int fd, int cmd, Termios termios) {
   return m_Clib.tcsetattr(fd, cmd, new termios(termios));
 }
 public int tcsendbreak(int fd, int duration) {
   // If duration is not zero, it sends zero-valued bits for duration*N seconds,
   // where N is at least 0.25, and not more than 0.5.
   return m_Clib.tcsendbreak(fd, duration / 250);
 }
 public void perror(String msg) {
   m_Clib.perror(msg);
 }
 public int tcgetattr(int fd, Termios termios) {
   termios t = new termios();
   int ret = m_Clib.tcgetattr(fd, t);
   t.update(termios);
   return ret;
 }
 public int tcflush(int fd, int b) {
   return m_Clib.tcflush(fd, b);
 }
 public int fcntl(int fd, int cmd, int arg) {
   return m_Clib.fcntl(fd, cmd, arg);
 }
 public int write(int fd, byte[] buffer, int len) {
   return m_Clib.write(fd, buffer, new NativeSize(len)).intValue();
 }
Esempio n. 10
0
 public int read(int fd, byte[] buffer, int len) {
   return m_Clib.read(fd, buffer, new NativeSize(len)).intValue();
 }
Esempio n. 11
0
 public int open(String s, int t) {
   if (s != null && !s.startsWith("/")) {
     s = DEVICE_DIR_PATH + s;
   }
   return m_Clib.open(s, t);
 }
Esempio n. 12
0
 public int cfsetospeed(Termios termios, int speed) {
   termios t = new termios(termios);
   int ret = m_Clib.cfsetospeed(t, speed);
   t.update(termios);
   return ret;
 }
Esempio n. 13
0
 public int cfgetospeed(Termios termios) {
   return m_Clib.cfgetospeed(new termios(termios));
 }
Esempio n. 14
0
 public int tcdrain(int fd) {
   return m_Clib.tcdrain(fd);
 }
Esempio n. 15
0
 public int close(int fd) {
   return m_Clib.close(fd);
 }
Esempio n. 16
0
 public int pipe(int[] fds) {
   return m_Clib.pipe(fds);
 }
Esempio n. 17
0
 public void cfmakeraw(Termios termios) {
   termios t = new termios(termios);
   m_Clib.cfmakeraw(t);
   t.update(termios);
 }