sss7modem/software/jna/SSS7Test.java

26 lines
432 B
Java
Raw Normal View History

2016-12-04 00:21:00 +01:00
/** Simple example of native C POSIX library declaration and usage. */
public class SSS7Test {
public static void main(String[] args) {
SSS7 bus = new SSS7("/dev/ttyUSB0");
bus.start();
2016-12-04 20:55:29 +01:00
while(!bus.canSend());
bus.send("Hallo Java".getBytes());
while(!bus.canSend());
while(!bus.hasReceived());
byte[] data = bus.getReceived();
String str = new String(data);
System.out.println(str);
bus.stop();
2016-12-04 00:21:00 +01:00
}
}