123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
-
-
-
-
- import java.lang.Thread;
-
- public class SerialReadThread extends Thread {
-
- private short[] storage;
- private int length;
- private boolean dataReady = false;
-
- private static int idIndex = 0;
-
-
-
- public SerialReadThread(int length) {
- this.length = length;
- setName("Serial Reader " + idIndex++);
- }
-
-
-
- public void run() {
- storage = HelperUtility.readData(length);
- dataReady = true;
- }
-
-
-
- public boolean dataIsReady() {
- return dataReady;
- }
-
-
-
- public short[] getSerialData() {
- return storage;
- }
- }
|