How solomai/esp32-tapgate works
TapGate combines an ESP32 gate-control device with a MAUI client. A client discovers/connects or configures a transport, then sends secured protocol messages; firmware receives them through the channel manager, handles enrollment and authorized commands, and can actuate the gate. BLE, Wi-Fi AP, and MQTT are distinct transport branches; client service management and firmware client/device state are supporting layers. The excerpts show channel dispatch, client persistence, and client transport management, but not the full message-validation or relay path, so uncertain links are omitted or marked unverified.
Main entry points: channel_manager.cpp Channel manager · main.cpp Message handler · ServiceManager.cs Service manager · ble_channel.cpp BLE channel
Components 18
Mobile client
- Mobile app UI
tapgate_client/MobileClientMAUI/UI/MainPage.xaml.cs - Service manager
tapgate_client/MobileClientMAUI/Core/Services/ServiceManager.cs
Client transports
- BLE client
tapgate_client/MobileClientMAUI/Core/Services/BT/BleService.cs - AP client
tapgate_client/MobileClientMAUI/Core/Services/AP/ApService.cs - MQTT client
tapgate_client/MobileClientMAUI/Core/Services/mqtt/MqttService.cs
Device transports
- Channel manager
tapgate_firmware/main/channels/channel_manager.cpp - BLE channel
tapgate_firmware/main/channels/ble/ble_channel.cpp - AP channel
tapgate_firmware/main/channels/ap/ap_channel.cpp - MQTT channel
tapgate_firmware/main/channels/mqtt/mqtt_channel.cpp
Device core
- Message handler
tapgate_firmware/main/main.cpp - Enrolled clients
tapgate_firmware/main/ctx_client/clients_manager.cpp - Device context
tapgate_firmware/main/ctx_device/device_ctx.cpp - Persistent storage
tapgate_firmware/main/common/nvm/nvm.cpp
Protocol and security
- Protocol messages
tapgate_firmware/main/messages/transport_message.h - ECIES security
tapgate_firmware/components/ecies_crypto/ecies.c
Other components
- Gate user
- Gate controller
- MQTT broker
Connections 22
- Gate user → Mobile app UI: controls
README.md - Mobile app UI → Service manager: uses services
- Service manager → BLE client: routes frames
tapgate_client/MobileClientMAUI/Core/Services/ServiceManager.cs - Service manager → AP client: routes frames
tapgate_client/MobileClientMAUI/Core/Services/ServiceManager.cs - Service manager → MQTT client: routes frames
tapgate_client/MobileClientMAUI/Core/Services/ServiceManager.cs - BLE client → BLE channel: exchanges frames
README.md - AP client → AP channel: exchanges frames
README.md - MQTT client → MQTT broker: publishes frames
README.md - MQTT broker → MQTT channel: delivers frames
README.md - Channel manager → BLE channel: starts and sends
tapgate_firmware/main/channels/channel_manager.cpp - Channel manager → AP channel: starts and sends
tapgate_firmware/main/channels/channel_manager.cpp - Channel manager → MQTT channel: starts and sends
tapgate_firmware/main/channels/channel_manager.cpp - BLE channel → Channel manager: queues received
tapgate_firmware/main/channels/channel_manager.cpp - AP channel → Channel manager: queues received
tapgate_firmware/main/channels/channel_manager.cpp - MQTT channel → Channel manager: queues received
tapgate_firmware/main/channels/channel_manager.cpp - Message handler → Channel manager: initializes channels
tapgate_firmware/main/main.cpp - Message handler → Enrolled clients: initializes and enrolls
tapgate_firmware/main/main.cpp - Message handler → Device context: initializes context
tapgate_firmware/main/main.cpp - Enrolled clients → Persistent storage: reads and writes
tapgate_firmware/main/ctx_client/clients_manager.cpp - Message handler → Protocol messages: handles messages
tapgate_firmware/main/main.cpp - Message handler → ECIES security: secures messages
- Message handler → Gate controller: triggers action