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