Exit gate controller with state machine.
More...
#include <ExitGateController.h>
Exit gate controller with state machine.
Handles exit sequence:
- Car arrives (detected via IGate)
- Validate ticket (simulated - assumes paid)
- Open barrier via IGate interface
- Wait for car to pass through
- Close barrier via IGate interface
Uses pure Dependency Injection - all dependencies are injected via constructor.
◆ ExitGateController() [1/2]
| ExitGateController::ExitGateController |
( |
IEventBus & |
eventBus, |
|
|
IGate & |
gate, |
|
|
ITicketService & |
ticketService, |
|
|
uint32_t |
barrierTimeoutMs = 2000, |
|
|
uint32_t |
validationTimeMs = 500 |
|
) |
| |
Construct exit gate controller with injected dependencies.
- Parameters
-
| eventBus | Event bus for publishing/subscribing |
| gate | Gate abstraction (barrier + light barrier) |
| ticketService | Ticket service |
| barrierTimeoutMs | Barrier open/close timeout in ms |
| validationTimeMs | Ticket validation simulation time in ms |
◆ ~ExitGateController()
| ExitGateController::~ExitGateController |
( |
| ) |
|
◆ ExitGateController() [2/2]
◆ getGate()
| IGate & ExitGateController::getGate |
( |
| ) |
|
|
inline |
Get gate reference (for debugging/console commands)
◆ getState()
◆ getStateString()
| const char * ExitGateController::getStateString |
( |
| ) |
const |
◆ operator=()
◆ reset()
| void ExitGateController::reset |
( |
| ) |
|
Reset controller to initial state Stops timers, resets state to Idle, clears current ticket, closes barrier.
◆ setupGpioInterrupts()
| void ExitGateController::setupGpioInterrupts |
( |
| ) |
|
Setup GPIO interrupts Call this after construction to enable hardware interrupts.
◆ validateTicketManually()
| bool ExitGateController::validateTicketManually |
( |
uint32_t |
ticketId | ) |
|
Manually validate ticket (for console commands)
- Parameters
-
- Returns
- true if validation successful
The documentation for this class was generated from the following files: