-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcard_controller.h
More file actions
41 lines (31 loc) · 1021 Bytes
/
card_controller.h
File metadata and controls
41 lines (31 loc) · 1021 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
/*
* card_controller.h
*
* Description:
* The controller is serving the cards (devices) by providing them means
* to register to the controller with their SM and giving each a unique id for communication.
*
* regCard() is used for card registration.
* run() is used for running the controller, usually in it's own task in an endless loop,
* blocking on recv messages.
*
* Created on: Nov 16, 2014
* Author: edwardh
*/
#ifndef STATE_MACHINE_CARD_CONTROLLER_H_
#define STATE_MACHINE_CARD_CONTROLLER_H_
#include "dynamic_state_machine.h"
class CardController
{
public:
CardController();
virtual ~CardController(){}
enum eventID {EV_NONE, EV_EXIST, EV_INIT_SUCCESS, EV_INIT_FAIL, EV_PROV_SUCCESS, EV_PROV_FAIL, EV_COUNT};
int regCard(DStateMachine *sm);
virtual void run();
static const int MAX_SUPPORTED_CARDS = 32;
protected:
DStateMachine *cardSM[MAX_SUPPORTED_CARDS];
int number_of_registered_cards;
};
#endif /* STATE_MACHINE_CARD_CONTROLLER_H_ */