5 // The number of times to resend the same package index before going to RESYNC
6 #define SSENDER_MAX_MISSED_PACKETS 20
12 WAIT_UNTIL_NEXT_CONFIRM
,
14 RESYNC_THEN_SEND
, // perform a RESYNC then go to SENDING
15 } stubborn_sender_state_e
;
21 void setMaxPackageIndex(uint8_t maxPackageIndex
);
23 void UpdateTelemetryRate(uint16_t airRate
, uint8_t tlmRatio
, uint8_t tlmBurst
);
24 void SetDataToTransmit(uint8_t* dataToTransmit
, uint8_t lengthToTransmit
);
25 uint8_t GetCurrentPayload(uint8_t *outData
, uint8_t maxLen
);
26 void ConfirmCurrentPayload(bool telemetryConfirmValue
);
27 bool IsActive() const { return senderState
!= SENDER_IDLE
; }
28 uint16_t GetMaxPacketsBeforeResync() const { return maxWaitCount
; }
32 uint8_t currentOffset
;
33 uint8_t bytesLastPayload
;
34 uint8_t currentPackage
;
35 bool telemetryConfirmExpectedValue
;
37 uint16_t maxWaitCount
;
38 uint8_t maxPackageIndex
;
39 stubborn_sender_state_e senderState
;