Projekt

Allgemein

Profil

Retransmits » Historie » Version 3

Maximilian Seesslen, 02.04.2025 11:39

1 3 Maximilian Seesslen
h1. Modes
2
3
h2. Stubborn
4
5
* Send CAN messages as Broadcast messages; fire and forget
6
* Good enough for sensor values
7
* Robust code, not much that can fail
8
* Not good enough for e.g. Flashing firmware on remote device or even scanning nodes.
9
10
h2. Guaranteed
11
12
* Each package need an acknowledge
13
* Retransmitts are send if acknowledge is missing
14
* Heavy traffic if nodes are blocking each other.
15
* Complex code, but ok
16
17 1 Maximilian Seesslen
h1. Retransmits
18 2 Maximilian Seesslen
19
* In starting phase there is an auto-tune which requires traffic
20
* There are at least some CRC errors
21
22
h1. Send package
23
24
* ringTransmitted.canPush()?
25
* store essage there
26
* Send it via RFM69
27
28
h2. Receive package
29
30
* If type is "Acknowledge"
31
** find corresponding message
32
** mark slot as acked/nacked
33
34
* If regular message/resend
35
** If resend: is the package older than the last?, drop it
36
** is it not last+1? send NACK via RFM69
37
** fill it in the receive buffer
38
** directly send acknowledge via RFM69
39
40
h2. Loop
41
42
* iterate Slots
43
* If WAITing: is message is older than ??ms, perform an resend
44
* If ACKed, pop it from the ring. Not the first non-ACKed? Error
45
* If NACKed, resend it, if there is no WAITing before 
46
47
h2. Open points
48
49
* Acknowledge gets lost; retransmit started
50
** last-id for every net. Drop message if it matches
51
52
* RFM-Class receives messages in ISR as fast as possible. Sending acknowledge is done in the loop. 
53
** Order should be preserved.
54
** Makes things super slow