7da6ea37e7
- Added AudioEngine integration to BluetoothManager for audio handling. - Implemented auto-reconnect functionality with enabling/disabling options. - Introduced methods for managing audio state and HFP events. - Updated BluetoothManager's internal state management for better audio handling. refactor: Update A252ConfigStore to improve pin validation logic - Renamed critical_pins to required_pins for clarity. - Added optional legacy line-enable pin validation. - Improved error handling for pin conflicts and invalid ranges. fix: Adjust default volume and slic_line configuration in A252ConfigStore - Set default slic_line to -1 to indicate retirement. - Increased default audio volume from 80 to 90. feat: Implement audio amplifier control in main application - Added commands to enable/disable audio amplifier via GPIO. - Integrated audio amplifier control into the setup process. fix: Improve ESP-NOW and WiFi coexistence policies - Enforced modem sleep for better coexistence between WiFi and Bluetooth. - Added checks to ensure proper WiFi mode before enforcing coexistence. feat: Enhance TelephonyService with DTMF and pulse dialing support - Added DTMF capture and processing capabilities. - Implemented rotary pulse dialing logic with state management. - Introduced callbacks for dialing and answering actions. feat: Add real-time event publishing to WebServerManager - Enabled real-time status updates via SSE. - Improved status caching and thread safety with critical sections. fix: General code cleanup and optimizations across modules - Refactored various methods for better readability and maintainability. - Improved error handling and logging for better debugging.
3.7 KiB
3.7 KiB
Audit Audio / BT / RTOS — état et plan d'enchaînement
État validé (run local USB /dev/cu.usbserial-0001)
- Boot stable: audio + codec + web server OK.
- Capture audio: arbitrage multi-clients en place (
TELEPHONY,BLUETOOTH,GENERIC). - Bluetooth HFP:
- plus de crash immédiat au boot.
- plus d'auto-connect agressif au boot (pair bond restauré, connexion sur demande).
- dial peut rester en queue (
pending_dial_number) si SLC non prêt. - Coexistence WiFi/BT:
- erreurs fatales/abort au boot réduites après déport d'actions callback vers
tick().
Correctifs clés appliqués
AudioEngine:requestCapture/releaseCapturethread-safe.- task audio avec backoff idle (charge RTOS réduite).
TelephonyService/BluetoothManager:- plus de
startCapture/stopCaptureconcurrents. - utilisation des clients de capture dédiés.
BluetoothManager:- déport de
applyDiscoverablePolicy/publishBleStatushors callbacks. - suppression d’auto-reconnect HFP au boot.
- timeout SLC en mode backoff (sans disconnect agressif).
- désactivation
AgentSupervisorcôté BT pour retirer allocations C++ en callback.
Plan exécutable (skills coordonnés)
Track 1 — esp32-rtos-coex-triage (en cours)
- Objectif: zéro reboot/assert sur séquence boot + WiFi STA + BT activé.
- Actions:
- garder le BT callback-safe (déjà fait).
- surveiller
wifi: fail to alloc timersur endurance. - livrer un rapport de stabilité sur 10 min.
Track 2 — esp32-bt-hfp-stability (prochaine étape)
- Objectif: connexion GSM stable, SLC up, dial auto depuis buffer len10.
- Actions:
- test live:
BT_HFP_CONNECT,BT_STATUS, appel sortant/entrant. - valider transition
pending_dial_number -> dial requestedquand SLC connecté. - verrouiller comportement discoverable auto si non connecté.
Track 3 — esp32-audio-runtime-gating (prochaine étape)
- Objectif: tonalité et audio call sans glitch ni coupure.
- Actions:
- vérifier arrêt instant tonalité au 1er digit.
- vérifier arrêt tonalité immédiat au raccroché.
- valider chemin HFP audio I2S en appel actif.
Critères de sortie
- Aucun
abort/assertpendant test run. - Aucun
vQueueDelete queue.cobservé. - Numérotation 10 chiffres pulse/DTMF déclenche
BT_DIALavec succès quand SLC monte. - Appel entrant GSM: ring, décroché, audio duplex.
Plan autonome coordonné (skills + agents)
- Skill utilisé pour cadrage spec->implémentation:
notion-spec-to-implementation(adapté en mode repo local). - Agent
bt-hfp-stability:- garantir
DIAL => queue + connect HFP + auto-dial post-SLC. - garder
discoverable=truesi aucun client BT connecté.
- garantir
- Agent
rtos-coex-wifi-bt:- forcer
WIFI_PS_MIN_MODEMen STA/APSTA pour coexistence WiFi+BT. - supprimer les reboots
Should enable WiFi modem sleep ....
- forcer
- Agent
telephony-call-routing:- appel entrant HFP (
ringing) => sonnerie RTC. - décroché RTC en sonnerie =>
BT_ANSWER.
- appel entrant HFP (
- Gate de validation utilisateur (bench USB):
- confirmer logs
dial_trigger ... ok=truepuishfp_slc_connected/hfp_dial_requested. - confirmer appel entrant GSM => sonnerie RTC immédiate.
- confirmer logs
Exécution autonome (batch courant)
main.cpp:- ordre de boot ajusté pour réduire contention WiFi/BT (
WiFi/ESP-NOWavantBT begin). - commandes runtime ajoutées:
BT_AUTO_RECONNECT_ON,BT_AUTO_RECONNECT_OFF.
- ordre de boot ajusté pour réduire contention WiFi/BT (
BluetoothManager:- flag runtime
auto_reconnect_enabledexposé dansBT_STATUS. - reconnexion auto conditionnée par policy + queue dial.
- flag runtime
WebServerManager+ WebUI:- SSE réactivé (
/api/events) + fallback polling navigateur. - endpoint ajouté:
/api/bluetooth/hfp/auto.
- SSE réactivé (
EspNowBridge:- init WiFi coex durci (mode préservé + modem sleep policy).