sss7modem/software/jna/SSS7Test.java

26 lines
440 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) {
2016-12-19 11:55:22 +01:00
SSS7 bus = SSS7.getInstance();
2016-12-04 00:21:00 +01:00
2016-12-19 11:55:22 +01:00
bus.start("/dev/ttyUSB0");
2016-12-04 00:21:00 +01:00
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
}
}