fix(gfsk): improve fixed-packet receive reliability

Use a longer preamble and 32-bit detector for the 100 kbps fixed 6-byte GMSK profile.

Read RX payloads from the RxStartBufferPointer returned by GetRxBufferStatus. The previous subtract-by-length adjustment could read the previous FIFO slot once the continuous RX buffer advanced, causing duplicate and missing packet IDs on the gateway.
This commit is contained in:
2026-05-19 18:38:59 +08:00
parent 2ab5617cf0
commit f8836dd1b1
2 changed files with 1882 additions and 1891 deletions
+3 -4
View File
@@ -490,8 +490,8 @@ struct gfsk_parameters_t {
}, },
.packet_params = .packet_params =
{ {
.preamble_bits = 32, .preamble_bits = 64,
.detector_length = GfskPreambleDetector::Bits16, .detector_length = GfskPreambleDetector::Bits32,
.sync_length_bits = 32, .sync_length_bits = 32,
.address_filtering = GfskAddressFiltering::Disabled, .address_filtering = GfskAddressFiltering::Disabled,
.packet_length_mode = GfskPacketLengthMode::Fixed, .packet_length_mode = GfskPacketLengthMode::Fixed,
@@ -1057,8 +1057,7 @@ namespace llcc68 = app::driver::llcc68;
} }
namespace std { namespace std {
template <> template <> struct is_error_code_enum<app::driver::llcc68::Errc> : true_type {};
struct is_error_code_enum<app::driver::llcc68::Errc> : true_type {};
} // namespace std } // namespace std
#endif /* ECC594CF_EDF0_42B5_8518_0EB3B3583727 */ #endif /* ECC594CF_EDF0_42B5_8518_0EB3B3583727 */
+4 -12
View File
@@ -430,10 +430,7 @@ LLCC68::read_rx_buffer_ref(timeout_ms_t busy_timeout) {
auto r = get_rx_buffer_status(busy_timeout); auto r = get_rx_buffer_status(busy_timeout);
APP_RADIO_RETURN_ERR_IGNORE_PROC_ERR(r); APP_RADIO_RETURN_ERR_IGNORE_PROC_ERR(r);
const auto [sz, ptr] = r.value(); const auto [sz, ptr] = r.value();
// the rx pointer would become 0x80 at first, so we need to adapt that return read_buffer_ref(ptr, sz, busy_timeout);
// behavior
const auto r_ptr = ptr - sz < DEFAULT_RX_BUFFER_ADDRESS ? ptr : ptr - sz;
return read_buffer_ref(r_ptr, sz, busy_timeout);
} }
expected<unit, error_code> expected<unit, error_code>
@@ -631,14 +628,9 @@ expected<ChipType, error_code> LLCC68::hal_get_chip_type() {
expected<unit, error_code> LLCC68::set_dio_irq_params(irq_params_t params) { expected<unit, error_code> LLCC68::set_dio_irq_params(irq_params_t params) {
const uint8_t data[8] = { const uint8_t data[8] = {
params.irqMask.msb(), params.irqMask.msb(), params.irqMask.lsb(), params.dio1Mask.msb(),
params.irqMask.lsb(), params.dio1Mask.lsb(), params.dio2Mask.msb(), params.dio2Mask.lsb(),
params.dio1Mask.msb(), params.dio3Mask.msb(), params.dio3Mask.lsb(),
params.dio1Mask.lsb(),
params.dio2Mask.msb(),
params.dio2Mask.lsb(),
params.dio3Mask.msb(),
params.dio3Mask.lsb(),
}; };
return write_stream(RADIOLIB_SX126X_CMD_SET_DIO_IRQ_PARAMS, data); return write_stream(RADIOLIB_SX126X_CMD_SET_DIO_IRQ_PARAMS, data);
} }