5 // The number of times to resend the same package index before going to RESYNC
6 #define SSENDER_MAX_MISSED_PACKETS 20
11 WAIT_UNTIL_NEXT_CONFIRM
,
13 RESYNC_THEN_SEND
, // perform a RESYNC then go to SENDING
14 } stubborn_sender_state_s
;
19 StubbornSender(uint8_t maxPackageIndex
);
21 void UpdateTelemetryRate(uint16_t airRate
, uint8_t tlmRatio
, uint8_t tlmBurst
);
22 void SetDataToTransmit(uint8_t lengthToTransmit
, uint8_t* dataToTransmit
, uint8_t bytesPerCall
);
23 void GetCurrentPayload(uint8_t *packageIndex
, uint8_t *count
, uint8_t **currentData
);
24 void ConfirmCurrentPayload(bool telemetryConfirmValue
);
26 uint16_t GetMaxPacketsBeforeResync() const { return maxWaitCount
; }
31 uint8_t currentOffset
;
32 uint8_t currentPackage
;
33 bool waitUntilTelemetryConfirm
;
36 uint16_t maxWaitCount
;
37 uint8_t maxPackageIndex
;
38 volatile stubborn_sender_state_s senderState
;