Enhance Bluetooth functionality and GUI integration
- Add Bluetooth device list management with discovery and pairing support - Implement volume control with AVRC integration - Add system event handling for GUI-to-Bluetooth communication - Enhance menu system with device selection and volume control pages - Improve memory management by making menu creation lazy - Add proper event subscription between GUI and Bluetooth modules - Update filter coefficient for improved audio clicking behavior 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include "esp_bt_defs.h"
|
||||
|
||||
/* log tag */
|
||||
#define BT_APP_CORE_TAG "BT_APP_CORE"
|
||||
@@ -67,4 +68,41 @@ void bt_app_task_shut_down(void);
|
||||
|
||||
void bt_app_init(void);
|
||||
|
||||
/* Bluetooth device management for GUI */
|
||||
#define MAX_BT_DEVICES 20
|
||||
#define MAX_BT_NAME_LEN 32
|
||||
|
||||
typedef struct {
|
||||
esp_bd_addr_t bda;
|
||||
char name[MAX_BT_NAME_LEN];
|
||||
bool is_paired;
|
||||
int rssi;
|
||||
} bt_device_info_t;
|
||||
|
||||
typedef struct {
|
||||
bt_device_info_t devices[MAX_BT_DEVICES];
|
||||
int count;1
|
||||
bool discovery_active;
|
||||
} bt_device_list_t;
|
||||
|
||||
/* Get current device list for GUI display */
|
||||
bt_device_list_t* bt_get_device_list(void);
|
||||
|
||||
/* Start device discovery */
|
||||
bool bt_start_discovery(void);
|
||||
|
||||
/* Stop device discovery */
|
||||
bool bt_stop_discovery(void);
|
||||
|
||||
/* Connect to specific device by index in device list */
|
||||
bool bt_connect_device(int device_index);
|
||||
|
||||
/* Clear discovered devices (keep paired devices) */
|
||||
void bt_clear_discovered_devices(void);
|
||||
|
||||
/* Volume control functions */
|
||||
void bt_volume_up(void);
|
||||
void bt_volume_down(void);
|
||||
int bt_get_current_volume(void);
|
||||
|
||||
#endif /* __BT_APP_CORE_H__ */
|
||||
|
||||
Reference in New Issue
Block a user