MCPcopy Create free account
hub / github.com/XCSoar/XCSoar / run

Method run

android/src/Voltage.java:99–115  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

97 }
98
99 @Override public void run() {
100 try {
101 boolean led = false;
102 while (true) {
103 int v = -1; int t = -1;
104 if (h_volt != null) v = (int)(h_volt.read() * 1024);
105 if (h_temp != null) t = (int)(h_temp.read() * 1024);
106 if (h_led != null) { h_led.write(led); led = !led; }
107 listener.onVoltageValues(t, 0, v);
108 sleep(sleeptime);
109 }
110 } catch (InterruptedException e) {
111 } catch (Exception e) {
112 listener.onSensorError(e.getMessage());
113 // TODO make GlueVoltage.getState() return STATE_FAILED
114 }
115 }
116}

Callers

nothing calls this directly

Calls 3

writeMethod · 0.65
onVoltageValuesMethod · 0.65
onSensorErrorMethod · 0.65

Tested by

no test coverage detected