Retransmits » Historie » Version 4
Maximilian Seesslen, 02.04.2025 17:05
1 | 3 | Maximilian Seesslen | h1. Modes |
---|---|---|---|
2 | |||
3 | 4 | Maximilian Seesslen | h2. Unrelated |
4 | 3 | Maximilian Seesslen | |
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 | 4 | Maximilian Seesslen | h2. Related |
11 | 3 | Maximilian Seesslen | |
12 | * Each package need an acknowledge |
||
13 | * Retransmitts are send if acknowledge is missing |
||
14 | 1 | Maximilian Seesslen | * Heavy traffic if nodes are blocking each other. |
15 | * Complex code, but ok |
||
16 | 4 | Maximilian Seesslen | * Order may not be guearanteed / optional |
17 | 1 | Maximilian Seesslen | |
18 | 4 | Maximilian Seesslen | h1. Related |
19 | 1 | Maximilian Seesslen | |
20 | 4 | Maximilian Seesslen | h2. Retransmits |
21 | |||
22 | 2 | Maximilian Seesslen | * In starting phase there is an auto-tune which requires traffic |
23 | * There are at least some CRC errors |
||
24 | |||
25 | 4 | Maximilian Seesslen | h2. Send package |
26 | 2 | Maximilian Seesslen | |
27 | * ringTransmitted.canPush()? |
||
28 | * store essage there |
||
29 | * Send it via RFM69 |
||
30 | |||
31 | h2. Receive package |
||
32 | |||
33 | * If type is "Acknowledge" |
||
34 | ** find corresponding message |
||
35 | ** mark slot as acked/nacked |
||
36 | |||
37 | * If regular message/resend |
||
38 | ** If resend: is the package older than the last?, drop it |
||
39 | ** is it not last+1? send NACK via RFM69 |
||
40 | ** fill it in the receive buffer |
||
41 | ** directly send acknowledge via RFM69 |
||
42 | |||
43 | h2. Loop |
||
44 | |||
45 | * iterate Slots |
||
46 | * If WAITing: is message is older than ??ms, perform an resend |
||
47 | * If ACKed, pop it from the ring. Not the first non-ACKed? Error |
||
48 | * If NACKed, resend it, if there is no WAITing before |
||
49 | |||
50 | h2. Open points |
||
51 | |||
52 | * Acknowledge gets lost; retransmit started |
||
53 | ** last-id for every net. Drop message if it matches |
||
54 | |||
55 | * RFM-Class receives messages in ISR as fast as possible. Sending acknowledge is done in the loop. |
||
56 | ** Order should be preserved. |
||
57 | ** Makes things super slow |