Implementatie van de opdracht Round Robin

Dependencies:   C12832

Committer:
benboydens
Date:
Tue Nov 03 15:41:06 2020 +0000
Revision:
1:0016a14c76bb
Parent:
0:825bd2920b6d
Round Robin complete

Who changed what in which revision?

UserRevisionLine numberNew contents of line
benboydens 0:825bd2920b6d 1 #ifndef STATEMACHINE_H
benboydens 0:825bd2920b6d 2 #define STATEMACHINE_H
benboydens 0:825bd2920b6d 3 #include "EthernetInterface.h"
benboydens 0:825bd2920b6d 4 #include "mbed.h"
benboydens 0:825bd2920b6d 5
benboydens 0:825bd2920b6d 6 #define MAX_BUFFER_SIZE 64
benboydens 0:825bd2920b6d 7
benboydens 0:825bd2920b6d 8 enum State{INIT, TRANSMIT, RECEIVE, END, CERROR};
benboydens 0:825bd2920b6d 9
benboydens 0:825bd2920b6d 10 class StateMachine {
benboydens 0:825bd2920b6d 11 private:
benboydens 0:825bd2920b6d 12 State currentState;
benboydens 0:825bd2920b6d 13 State startState;
benboydens 0:825bd2920b6d 14 void actionInit();
benboydens 0:825bd2920b6d 15 void actionTransmit();
benboydens 0:825bd2920b6d 16 void actionReceive();
benboydens 0:825bd2920b6d 17 EthernetInterface *eth;
benboydens 0:825bd2920b6d 18 char ipbytes[4];
benboydens 0:825bd2920b6d 19 char rbuffer[MAX_BUFFER_SIZE];
benboydens 0:825bd2920b6d 20 int rcount;
benboydens 0:825bd2920b6d 21
benboydens 0:825bd2920b6d 22 public:
benboydens 0:825bd2920b6d 23 StateMachine();
benboydens 0:825bd2920b6d 24 ~StateMachine();
benboydens 0:825bd2920b6d 25 void start();
benboydens 0:825bd2920b6d 26 };
benboydens 0:825bd2920b6d 27
benboydens 0:825bd2920b6d 28 #endif