Combo: add reading MAC address to RuffyCommands.
This commit is contained in:
parent
9c8f99b331
commit
38bab84047
|
@ -20,4 +20,5 @@ interface IRuffyService {
|
|||
void rtSendKey(byte keyCode, boolean changed);
|
||||
void resetPairing();
|
||||
boolean isConnected();
|
||||
String getMacAddress();
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue