HiveMind
ApplicationInterface.h
Go to the documentation of this file.
1 #ifndef APPLICATIONINTERFACE_H_
2 #define APPLICATIONINTERFACE_H_
3 
5 #include <IMutex.h>
6 #include <bsp/IUserInterface.h>
7 
9  public:
10  ApplicationInterface(IUserInterface& userInterface, IMutex& mutex);
11 
12  ~ApplicationInterface() override = default;
13 
14  void setSystemRemoteHandshaked(bool handshaked) override;
15 
16  void setSystemHostHandshaked(bool handshaked) override;
17 
18  void setSystemConnectionState(ConnectionState state) override;
19 
20  void setSystemDeviceState(DeviceState state) override;
21 
22  void setSystemButtonCallback(Button button,
23  buttonCallbackFunction_t callback,
24  void* context) override;
25 
26  void setUserLed(bool state) override;
27 
28  void setUserSegment(UserSegment segment) override;
29 
30  SystemStates getSystemStates() const override;
31 
32  UserStates getUserStates() const override;
33 
34  ApplicationStates getApplicationState() const override;
35 
36  static constexpr LED s_remoteLed = LED::LED_0;
37  static constexpr LED s_hostLed = LED::LED_1;
38  static constexpr LED s_userLed = LED::LED_2;
39 
40  private:
42  IMutex& m_mutex;
44 };
45 
46 #endif // APPLICATIONINTERFACE_H_
ApplicationInterface::setSystemDeviceState
void setSystemDeviceState(DeviceState state) override
set the system Connection state and set the seven segment accordingly
Definition: ApplicationInterface.cpp:41
IApplicationInterface.h
SystemStates
Definition: SystemStates.h:25
ApplicationInterface::s_remoteLed
static constexpr LED s_remoteLed
Definition: ApplicationInterface.h:36
ApplicationInterface::getUserStates
UserStates getUserStates() const override
get the user states
Definition: ApplicationInterface.cpp:76
LED
LED
LED present on the board.
Definition: IUserInterface.h:22
IApplicationInterface
Definition: IApplicationInterface.h:7
LED::LED_0
@ LED_0
UserStates
Definition: UserStates.h:23
ApplicationInterface::getApplicationState
ApplicationStates getApplicationState() const override
get the application states
Definition: ApplicationInterface.cpp:81
ApplicationStates
Definition: ApplicationStates.h:7
ApplicationInterface::ApplicationInterface
ApplicationInterface(IUserInterface &userInterface, IMutex &mutex)
Definition: ApplicationInterface.cpp:4
ApplicationInterface::setSystemHostHandshaked
void setSystemHostHandshaked(bool handshaked) override
set the system Host handshake and light the necessary LED
Definition: ApplicationInterface.cpp:13
ApplicationInterface::setSystemRemoteHandshaked
void setSystemRemoteHandshaked(bool handshaked) override
set the system Remote handshake and light the necessary LED
Definition: ApplicationInterface.cpp:7
Button
Button
Buttons present on the board.
Definition: IUserInterface.h:16
ApplicationInterface::setSystemButtonCallback
void setSystemButtonCallback(Button button, buttonCallbackFunction_t callback, void *context) override
set the systems button to a callback
Definition: ApplicationInterface.cpp:51
ApplicationInterface::getSystemStates
SystemStates getSystemStates() const override
set the system states
Definition: ApplicationInterface.cpp:71
ApplicationInterface::setUserSegment
void setUserSegment(UserSegment segment) override
set the user seven segment
Definition: ApplicationInterface.cpp:63
LED::LED_1
@ LED_1
IUserInterface.h
LED::LED_2
@ LED_2
ApplicationInterface::m_userInterface
IUserInterface & m_userInterface
Definition: ApplicationInterface.h:41
ApplicationInterface::s_userLed
static constexpr LED s_userLed
Definition: ApplicationInterface.h:38
ApplicationInterface::setUserLed
void setUserLed(bool state) override
set the user LED
Definition: ApplicationInterface.cpp:57
ApplicationInterface::setSystemConnectionState
void setSystemConnectionState(ConnectionState state) override
set the system Connection state and light the necessary LED the right color
Definition: ApplicationInterface.cpp:19
ConnectionState
ConnectionState
Definition: SystemStates.h:4
ApplicationInterface::m_mutex
IMutex & m_mutex
Definition: ApplicationInterface.h:42
ApplicationInterface::s_hostLed
static constexpr LED s_hostLed
Definition: ApplicationInterface.h:37
IUserInterface
Manages the user interface The user interface can consist of buttons, LED, serial print ports,...
Definition: IUserInterface.h:36
UserSegment
UserSegment
Definition: UserStates.h:4
ApplicationInterface::~ApplicationInterface
~ApplicationInterface() override=default
buttonCallbackFunction_t
void(* buttonCallbackFunction_t)(void *instance)
Prototype for a callback from a button press.
Definition: IUserInterface.h:28
DeviceState
DeviceState
Definition: SystemStates.h:6
ApplicationInterface::m_states
ApplicationStates m_states
Definition: ApplicationInterface.h:43
ApplicationInterface
Definition: ApplicationInterface.h:8