parent
4665afc4ca
commit
1ea4401ac9
|
@ -6,9 +6,11 @@ import com.rusefi.core.Sensor;
|
|||
import com.rusefi.core.SensorCentral;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static com.devexperts.util.TimeUtil.SECOND;
|
||||
import static com.rusefi.IoUtil.sleepSeconds;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class MiscTest extends RusefiTestBase {
|
||||
|
@ -19,6 +21,17 @@ public class MiscTest extends RusefiTestBase {
|
|||
bp.burn();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetAllOutputs() throws InterruptedException {
|
||||
CountDownLatch responseLatch = new CountDownLatch(1);
|
||||
ecu.getLinkManager().execute(() -> {
|
||||
boolean result = ecu.getLinkManager().getBinaryProtocol().requestOutputChannels();
|
||||
System.out.println("requestOutputChannels=" + result);
|
||||
responseLatch.countDown();
|
||||
});
|
||||
responseLatch.await(1, TimeUnit.MINUTES);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMcuTemperature() throws InterruptedException {
|
||||
double mcuTemp = Double.NaN;
|
||||
|
|
|
@ -10,7 +10,7 @@ import java.util.concurrent.CountDownLatch;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class SerialSandbox {
|
||||
public static void main(String[] args) {
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
boolean textPull = false;
|
||||
long startTime = System.currentTimeMillis();
|
||||
|
||||
|
@ -32,5 +32,15 @@ public class SerialSandbox {
|
|||
} catch (InterruptedException e) {
|
||||
throw new IllegalStateException("Not connected in time");
|
||||
}
|
||||
CountDownLatch latch = new CountDownLatch(1);
|
||||
linkManager.execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
boolean result = linkManager.getBinaryProtocol().requestOutputChannels();
|
||||
System.out.println("requestOutputChannels=" + result);
|
||||
latch.countDown();
|
||||
}
|
||||
});
|
||||
latch.await(1, TimeUnit.MINUTES);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue