Skip to content

Commit

Permalink
Add the missed test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ehsan Khamespanah committed Aug 15, 2023
1 parent 47d7f97 commit 0df8ecc
Showing 1 changed file with 57 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
env int BUFFER_SIZE = 4;

reactiveclass Sensor(3) {
statevars{
CompUnit cu;
}

Sensor(CompUnit cu1) {
cu = cu1;
self.gatherData();
}

msgsrv gatherData() {
cu.receiveData(0);
self.gatherData() after(?(1,2,3));
}
}


reactiveclass CompUnit(3) {
statevars {
Network network;
}

CompUnit(Network net) {
network = net;
}

msgsrv receiveData(byte data) {
network.send(data);
}

}

interface Network {
msgsrv send(byte data);
}

reactiveclass MACBNetwork implements Network(3) {
msgsrv send(byte data) {
// Send data according
// to the MACB protocol
}
}

reactiveclass TDMANetwork implements Network(3) {
msgsrv send(byte data) {
// Send data according
// to the TDMA protocol
}
}

main {
Sensor sensor():(cu);
CompUnit cu():(network);
TDMANetwork network():();
}

0 comments on commit 0df8ecc

Please sign in to comment.