kopia lustrzana https://github.com/sh123/esp32_loraprs
Set implicit header mode for sf = 6
rodzic
b1a78bbf00
commit
2f7bdb2261
|
@ -117,6 +117,8 @@ void Service::setupLora(long loraFreq, long bw, int sf, int cr, int pwr, int syn
|
||||||
Serial.print(sync, 16); Serial.print(", ");
|
Serial.print(sync, 16); Serial.print(", ");
|
||||||
Serial.print(enableCrc); Serial.print("...");
|
Serial.print(enableCrc); Serial.print("...");
|
||||||
|
|
||||||
|
isImplicitHeaderMode_ = sf == 6;
|
||||||
|
|
||||||
LoRa.setPins(config_.LoraPinSs, config_.LoraPinRst, config_.LoraPinDio0);
|
LoRa.setPins(config_.LoraPinSs, config_.LoraPinRst, config_.LoraPinDio0);
|
||||||
|
|
||||||
while (!LoRa.begin(loraFreq)) {
|
while (!LoRa.begin(loraFreq)) {
|
||||||
|
@ -124,7 +126,6 @@ void Service::setupLora(long loraFreq, long bw, int sf, int cr, int pwr, int syn
|
||||||
delay(CfgConnRetryMs);
|
delay(CfgConnRetryMs);
|
||||||
}
|
}
|
||||||
LoRa.setSyncWord(sync);
|
LoRa.setSyncWord(sync);
|
||||||
if (sf == 6) LoRa.implicitHeaderMode();
|
|
||||||
LoRa.setSpreadingFactor(sf);
|
LoRa.setSpreadingFactor(sf);
|
||||||
LoRa.setSignalBandwidth(bw);
|
LoRa.setSignalBandwidth(bw);
|
||||||
LoRa.setCodingRate4(cr);
|
LoRa.setCodingRate4(cr);
|
||||||
|
@ -381,7 +382,7 @@ bool Service::onRigTxBegin()
|
||||||
} else {
|
} else {
|
||||||
delay(CfgPollDelayMs);
|
delay(CfgPollDelayMs);
|
||||||
}
|
}
|
||||||
return (LoRa.beginPacket() == 1);
|
return (LoRa.beginPacket(isImplicitHeaderMode_) == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Service::onRigTx(byte b)
|
void Service::onRigTx(byte b)
|
||||||
|
|
|
@ -97,6 +97,7 @@ private:
|
||||||
Config config_;
|
Config config_;
|
||||||
String aprsLoginCommand_;
|
String aprsLoginCommand_;
|
||||||
AX25::Callsign ownCallsign_;
|
AX25::Callsign ownCallsign_;
|
||||||
|
bool isImplicitHeaderMode_;
|
||||||
|
|
||||||
// csma
|
// csma
|
||||||
byte csmaP_;
|
byte csmaP_;
|
||||||
|
|
Ładowanie…
Reference in New Issue