Package com.sun.jna

Examples of com.sun.jna.NativeLong


  public int read(int fd, byte[] buffer, int len) {
    return m_Clib.read(fd, ByteBuffer.wrap(buffer), new NativeLong(len)).intValue();
  }

  public int write(int fd, byte[] buffer, int len) {
    return m_Clib.write(fd, ByteBuffer.wrap(buffer), new NativeLong(len)).intValue();
  }
View Full Code Here


  public FDSet newFDSet() {
    return new FDSetImpl();
  }

  public int ioctl(int fd, int cmd, int[] data) {
    NativeLong[] dataL = { new NativeLong(data[0]) };
    int res = m_Clib.ioctl(fd, new NativeLong(0xFFFFFFFFL & cmd), dataL);
    data[0] = dataL[0].intValue();
    return res;
  }
View Full Code Here

    data[0] = dataL[0].intValue();
    return res;
  }

  public int ioctl(int fd, int cmd, NativeLong[] data) {
    return m_Clib.ioctl(fd, new NativeLong(0xFFFFFFFFL & cmd), data);
  }
View Full Code Here

    if (r == 0)
      r = tcsetattr(fd, TCSANOW, termios);
    if (r != 0) {
      // Darell Tan had patched RXTX with this sequence, so lets try this
      if (cfsetispeed(termios, B9600) == 0 && cfsetospeed(termios, B9600) == 0 && tcsetattr(fd, TCSANOW, termios) == 0) {
        NativeLong[] data = new NativeLong[] { new NativeLong(speed) };
        r = ioctl(fd, IOSSIOSPEED, data);
      }
    }
    return r;
  }
View Full Code Here

    return m_Clib.cfgetospeed(new Solaris_C_lib.termios(termios)).intValue();
  }

  public int cfsetispeed(Termios termios, int speed) {
    Solaris_C_lib.termios t = new Solaris_C_lib.termios(termios);
    int ret = m_Clib.cfsetispeed(t, new NativeLong(speed));
    t.update(termios);
    return ret;
  }
View Full Code Here

    return m_Clib.cfgetospeed(new FreeBSD_C_lib.termios(termios)).intValue();
  }

  public int cfsetispeed(Termios termios, int speed) {
    FreeBSD_C_lib.termios t = new FreeBSD_C_lib.termios(termios);
    int ret = m_Clib.cfsetispeed(t, new NativeLong(speed));
    t.update(termios);
    return ret;
  }
View Full Code Here

    return ret;
  }

  public int cfsetospeed(Termios termios, int speed) {
    Solaris_C_lib.termios t = new Solaris_C_lib.termios(termios);
    int ret = m_Clib.cfsetospeed(t, new NativeLong(speed));
    t.update(termios);
    return ret;
  }
View Full Code Here

    }
    return m_Clib.open(s, t);
  }

  public int read(int fd, byte[] buffer, int len) {
    return m_Clib.read(fd, ByteBuffer.wrap(buffer), new NativeLong(len)).intValue();
  }
View Full Code Here

    return ret;
  }

  public int cfsetospeed(Termios termios, int speed) {
    FreeBSD_C_lib.termios t = new FreeBSD_C_lib.termios(termios);
    int ret = m_Clib.cfsetospeed(t, new NativeLong(speed));
    t.update(termios);
    return ret;
  }
View Full Code Here

  public int read(int fd, byte[] buffer, int len) {
    return m_Clib.read(fd, ByteBuffer.wrap(buffer), new NativeLong(len)).intValue();
  }

  public int write(int fd, byte[] buffer, int len) {
    return m_Clib.write(fd, ByteBuffer.wrap(buffer), new NativeLong(len)).intValue();
  }
View Full Code Here

TOP

Related Classes of com.sun.jna.NativeLong

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.