-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcard_controller.cpp
More file actions
45 lines (37 loc) · 903 Bytes
/
card_controller.cpp
File metadata and controls
45 lines (37 loc) · 903 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
* card_controller.cpp
*
* Created on: Nov 16, 2014
* Author: edwardh
*/
#include "card_controller.h"
#include <string.h>
#ifndef FOREVER
#define FOREVER() for(;;)
#endif
CardController::CardController() : number_of_registered_cards(0)
{
memset(this->cardSM, 0, MAX_SUPPORTED_CARDS);
}
int CardController::regCard(DStateMachine *sm)
{
this->cardSM[number_of_registered_cards] = sm;
return number_of_registered_cards++;
}
void CardController::run()
{
// Do here some Init stuff...
// Enter the main loop, receive messages from Device/s (Cards),
// identify the sender by devID and lookup his SM.
// We are left with executing the event on the SM.
//
// FOREVER()
// {
// msg = recv_msg();
// switch (msg->event)
// {
// case EV_EXIST:
// this->cardSM[msg->devID]->execEvent(...event...);
// }
// }
}