mirror of
https://github.com/mattintech/pyBTMCP.git
synced 2026-07-11 12:01:53 +00:00
Firmware: - Fixed WiFi reconnection bug after power cycle by adding WiFi.persistent(false) and disabling auto-connect/auto-reconnect - Fixed AP mode not broadcasting by properly handling WIFI_AP_STA mode transitions - Refactored to service-oriented architecture: - device_state: Central state management with event callbacks - config_service: NVS persistence (renamed from config_manager) - wifi_service: WiFi STA/AP management (extracted from main.cpp) - mqtt_service: MQTT client and message routing (extracted from main.cpp) - ble_service: BLE GATT services (renamed from ble_services) - web_service: HTTP configuration portal (renamed from web_portal) - main.cpp reduced from ~470 lines to ~60 lines (thin orchestrator) - Each service is self-contained with setup()/loop() pattern Backend: - Added heart rate variation endpoint - UI improvements Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
38 lines
1.3 KiB
C
38 lines
1.3 KiB
C
#ifndef CONFIG_H
|
|
#define CONFIG_H
|
|
|
|
// ============================================
|
|
// Firmware Version
|
|
// ============================================
|
|
#define FIRMWARE_VERSION "1.0.6"
|
|
|
|
// ============================================
|
|
// AP Mode Configuration
|
|
// ============================================
|
|
#define AP_SSID_PREFIX "BLE-Sim-" // Will append chip ID for uniqueness
|
|
#define AP_PASSWORD "" // Open network (or set a password)
|
|
#define AP_IP IPAddress(192, 168, 4, 1)
|
|
#define AP_GATEWAY IPAddress(192, 168, 4, 1)
|
|
#define AP_SUBNET IPAddress(255, 255, 255, 0)
|
|
|
|
// ============================================
|
|
// Default Values (used until configured)
|
|
// ============================================
|
|
#define DEFAULT_MQTT_PORT 1883
|
|
#define DEFAULT_DEVICE_ID_PREFIX "esp32-"
|
|
|
|
// ============================================
|
|
// Timing Configuration
|
|
// ============================================
|
|
#define BLE_NOTIFY_INTERVAL 1000 // BLE notification interval (ms)
|
|
#define MQTT_RECONNECT_INTERVAL 5000 // MQTT reconnect attempt interval (ms)
|
|
#define STATUS_REPORT_INTERVAL 10000 // Status report to MQTT (ms)
|
|
#define WIFI_CONNECT_TIMEOUT 15000 // WiFi connection timeout (ms)
|
|
|
|
// ============================================
|
|
// NVS Configuration Keys
|
|
// ============================================
|
|
#define NVS_NAMESPACE "ble-sim"
|
|
|
|
#endif // CONFIG_H
|