From f70cbbc6c01a26d4a3dfa6641122e573b4a3adea Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Sun, 27 Aug 2017 14:49:09 +0200 Subject: [PATCH] Try building against ruffy stable, 8dae0c0fedd5e371e85da3433a07aaab27b05db0 --- .../aidl/org/monkey/d/ruffy/ruffy/driver/IRuffyService.aidl | 6 +++++- .../main/java/de/jotomo/ruffyscripter/RuffyScripter.java | 4 +--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/main/aidl/org/monkey/d/ruffy/ruffy/driver/IRuffyService.aidl b/app/src/main/aidl/org/monkey/d/ruffy/ruffy/driver/IRuffyService.aidl index 6c988aa038..ded119c7b4 100644 --- a/app/src/main/aidl/org/monkey/d/ruffy/ruffy/driver/IRuffyService.aidl +++ b/app/src/main/aidl/org/monkey/d/ruffy/ruffy/driver/IRuffyService.aidl @@ -6,7 +6,8 @@ import org.monkey.d.ruffy.ruffy.driver.IRTHandler; interface IRuffyService { - void setHandler(IRTHandler handler); + void addHandler(IRTHandler handler); + void removeHandler(IRTHandler handler); /** Connect to the pump * @@ -17,7 +18,10 @@ interface IRuffyService { /** Disconnect from the pump */ void doRTDisconnect(); + /*What's the meaning of 'changed'? + * changed means if a button state has been changed, like btton pressed is a change and button release another*/ void rtSendKey(byte keyCode, boolean changed); void resetPairing(); boolean isConnected(); + boolean isBoundToPump(); } diff --git a/app/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java b/app/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java index 7630907160..17f17d8534 100644 --- a/app/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java +++ b/app/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java @@ -48,7 +48,6 @@ public class RuffyScripter { public void start(IRuffyService newService) { try { -/* if (ruffyService != null) { try { ruffyService.removeHandler(mHandler); @@ -56,7 +55,6 @@ public class RuffyScripter { // ignore } } -*/ if (newService != null) { this.ruffyService = newService; // TODO this'll be done better in v2 via ConnectionManager @@ -64,7 +62,7 @@ public class RuffyScripter { idleDisconnectMonitorThread.start(); } started = true; - newService.setHandler(mHandler); + newService.addHandler(mHandler); } } catch (Exception e) { log.error("Unhandled exception starting RuffyScripter", e);