* else if destination == self: hand package to layer4;
* else relay message;
*
*
*
* A CRC-check is not performed at the intermediate-nodes between the sender and the receiver.
* The frame is received andread until the destination-address.
* If the destination differs from the own address, the ATMega can begin relaying the read Bytes to the next node, while still receiving the remaining ones.
* No CRC-check at the intermediate-nodes between the sender and the receiver.
* If the destination differs from self, begin relaying the read Bytes to the next node, while still receiving the remaining ones.
* -> An communication-error can be detected on the receivers end
*/
#include"lay3.h"
voidbroadcast_successful(){
puts("Broadcast successful.\n");
return;
}
bytel3_action(bytedest,bytesrc){
if(dest==0x00){
if(src==SELF){
return0;
}
}
elseif(dest==SELF)
return1;//receive, to layer 4
else
return2;//relay
}
voidl3_exec(byteaction,byte*frame){
puts("l3_exec: ");
switch(action){
case0:
broadcast_successful();
break;
case1:
puts("Handing package to layer 4.\n");
break;
case2:
fillSend(frame+6,frame[5]);
default:
break;
}
}
/* Ich muss noch die Funktion meines Sendebuffers erweitern. Ich möchte byteweise senden können, damit ich relayen kann, ohne viel zwischenzuspeichern.
*
*/
/*
* Priorities
* ==========
* Packages that need to be relayed should be handled with a higher priority than own sending-wishes of the node.
* Sending-wishes should be handled in order of arrival. This ensures, that own sending-wishes may not block the ring and congestions should not occur.
* If the node has no time to prepare its own sending-wishes, it cannot generate additional load onto the network.
* Also prioritizing packages from other nodes helps them holding their time-constraints.