diff --git a/combo/src/main/aidl/org/monkey/d/ruffy/ruffy/driver/IRuffyService.aidl b/combo/src/main/aidl/org/monkey/d/ruffy/ruffy/driver/IRuffyService.aidl index 6c988aa038..8861938f8a 100644 --- a/combo/src/main/aidl/org/monkey/d/ruffy/ruffy/driver/IRuffyService.aidl +++ b/combo/src/main/aidl/org/monkey/d/ruffy/ruffy/driver/IRuffyService.aidl @@ -20,4 +20,5 @@ interface IRuffyService { void rtSendKey(byte keyCode, boolean changed); void resetPairing(); boolean isConnected(); + String getMacAddress(); } diff --git a/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ruffyscripter/RuffyCommands.java b/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ruffyscripter/RuffyCommands.java index 0567e1cb12..1b9b5414ec 100644 --- a/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ruffyscripter/RuffyCommands.java +++ b/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ruffyscripter/RuffyCommands.java @@ -1,5 +1,6 @@ package info.nightscout.androidaps.plugins.pump.combo.ruffyscripter; +import androidx.annotation.Nullable; import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.PumpHistoryRequest; public interface RuffyCommands { @@ -45,5 +46,8 @@ public interface RuffyCommands { CommandResult getDateAndTime(); CommandResult setDateAndTime(); + + @Nullable + String getMacAddress(); } diff --git a/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ruffyscripter/RuffyScripter.java b/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ruffyscripter/RuffyScripter.java index c60fca36a9..a8d9ab025b 100644 --- a/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ruffyscripter/RuffyScripter.java +++ b/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ruffyscripter/RuffyScripter.java @@ -822,6 +822,16 @@ public class RuffyScripter implements RuffyCommands { throw new RuntimeException("Not supported"); } + @Nullable + public String getMacAddress() { + try { + return ruffyService.getMacAddress(); + } catch (RemoteException e) { + // ignore; ruffy version is probably old and doesn't support reading MAC address yet + return null; + } + } + /** * Confirms and dismisses the given alert if it's raised before the timeout */