Inject dependencies in SetPreamble RL command
This commit is contained in:
parent
817ec086a1
commit
1172aa753e
2 changed files with 3 additions and 2 deletions
|
@ -388,7 +388,7 @@ public class RFSpy {
|
|||
try {
|
||||
resp = writeToData(new SetPreamble(injector, preamble), EXPECTED_MAX_BLUETOOTH_LATENCY_MS);
|
||||
} catch (Exception e) {
|
||||
e.toString();
|
||||
aapsLogger.error("Failed to set preamble", e);
|
||||
}
|
||||
return resp;
|
||||
}
|
||||
|
|
|
@ -17,10 +17,11 @@ public class SetPreamble extends RileyLinkCommand {
|
|||
|
||||
private int preamble;
|
||||
|
||||
|
||||
public SetPreamble(HasAndroidInjector injector, int preamble) throws Exception {
|
||||
super();
|
||||
|
||||
injector.androidInjector().inject(this);
|
||||
|
||||
// this command was not supported before 2.0
|
||||
if (!rileyLinkServiceData.firmwareVersion.isSameVersion(RileyLinkFirmwareVersion.Version2AndHigher)) {
|
||||
throw new NotImplementedException("Old firmware does not support SetPreamble command");
|
||||
|
|
Loading…
Reference in a new issue