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.
2.2 KiB
2.2 KiB
ESP-NOW API v1 (enveloppe msg_id/seq/type/payload/ack)
Date: 2026-02-21
Scope: contrat d'échange entre RTC_BL_PHONE (A252) et la seconde carte.
1. Objectif
Normaliser les trames ESP-NOW pour:
- corréler requête/réponse,
- conserver compatibilité legacy,
- simplifier l'intégration du second repo.
2. Requête v1 (nouveau format recommandé)
{
"proto": "rtcbl/1",
"msg_id": "req-001",
"seq": 1,
"type": "command",
"ack": true,
"payload": {
"cmd": "STATUS",
"args": {}
}
}
Règles:
proto=rtcbl/1recommandé (toléré absent pour compat).msg_idsert à corréler la réponse.seqest un compteur local de trame (recommandé monotone par source).type=command|request|cmddéclenche l'exécution côté firmware.ack=truedemande une réponse corrélée.payload.cmdobligatoire pour une commande dispatcher.payload.argsoptionnel; sérialisé puis passé au dispatcher.
3. Réponse v1 (ack corrélée)
{
"proto": "rtcbl/1",
"msg_id": "req-001",
"seq": 1,
"type": "ack",
"ack": true,
"payload": {
"ok": true,
"code": "STATUS",
"data": {},
"error": ""
}
}
Règles:
msg_idetseqreprennent la requête.payload.ok=false=>payload.errornon vide.payload.datacontient le JSON de la commande si disponible.- fallback possible
payload.data_rawsi la réponse n'est pas JSON.
4. Compatibilité legacy
Le firmware continue d'accepter les formats existants:
{"cmd":"..."}{"raw":"..."}{"command":"..."}{"action":"..."}- variantes imbriquées via
event,message,payload - format historique
rtcbl/1:{"proto":"rtcbl/1","id":"...","cmd":"...","args":{}}
5. Commandes recommandées v1
STATUSRINGCALLHOOKLIST_FILESPLAY_FILEWIFI_STATUSMQTT_STATUSESPNOW_STATUSBT_STATUS
6. Intégration second repo
Checklist minimum côté seconde carte:
- Émettre
msg_idunique +seqmonotone. - Positionner
type=commandetack=truepour obtenir une réponse. - Implémenter timeout de réponse (2-5s) et corréler sur
msg_id. - Prévoir fallback legacy (
rtcbl/1+ formatscmd/raw/command/action) pour compat.