|
TB2026-YDS Firmware
|
Bluetooth settings: one combined screen listing paired and nearby devices. More...
#include "bluetooth_settings.h"#include "navigator.h"#include "status_bar.h"#include "gfx.h"#include "bluetooth.h"#include "player.h"#include "volume.h"#include <string.h>Macros | |
| #define | CONTENT_Y0 (STATUS_BAR_H + 2) |
| #define | LINE_H 14 |
| #define | CARET_X 3 |
| #define | TEXT_X 13 |
| #define | NAME_MAXCH 20 /* name chars drawn before the signal column */ |
| #define | SIGNAL_X 150 /* signal bars / connected dot, at the right margin */ |
| #define | REFRESH_MS 250 /* live re-render cadence while scanning/connecting */ |
| #define | ACCENT gfx_rgb(255, 0, 0) /* Settings identity colour (see root_menu) */ |
| #define | DIM gfx_rgb(110, 110, 110) |
| #define | ROW_Y(v) |
| #define | SHOWN(v) |
Enumerations | |
| enum | row_kind_t { ROW_KNOWN , ROW_SCAN , ROW_NEAR } |
Functions | |
| screen_t * | bluetooth_settings_screen (void) |
| Get the singleton Bluetooth settings screen, ready to push onto the navigator. | |
Bluetooth settings: one combined screen listing paired and nearby devices.
Layout (below the always-present status bar): a "KNOWN DEVICES" section from the persisted known list (most-recent first, so the last device sits on top), then a "NEARBY" section with a "Scan" action and the live scan results (signal shown as bars + dBm). A caret ">" marks the selection – no full white bar, which on this passive OLED lights OFF pixels across the line.
Power: the radio is off by default. Entering this screen shows the paired list straight from NVS with the radio down. It is powered up (bluetooth_init) only when the user scans or connects, and powered down again (bluetooth_shutdown) on exit unless a link is up – so it draws current only while scanning or connected, per the project's power rule. While the screen is open it also suppresses the service's auto power-down on link drop (see bluetooth_set_auto_shutdown), so a manual disconnect keeps the radio up for the next action; outside the screen the service powers itself down when the link drops.
Selecting a nearby device connects to it. Selecting a paired device opens a small popup with Connect/Disconnect and Forget.
| #define ACCENT gfx_rgb(255, 0, 0) /* Settings identity colour (see root_menu) */ |
| #define CARET_X 3 |
| #define CONTENT_Y0 (STATUS_BAR_H + 2) |
| #define DIM gfx_rgb(110, 110, 110) |
| #define LINE_H 14 |
| #define NAME_MAXCH 20 /* name chars drawn before the signal column */ |
| #define REFRESH_MS 250 /* live re-render cadence while scanning/connecting */ |
| #define ROW_Y | ( | v | ) |
| #define SHOWN | ( | v | ) |
| #define SIGNAL_X 150 /* signal bars / connected dot, at the right margin */ |
| #define TEXT_X 13 |
| enum row_kind_t |
| screen_t * bluetooth_settings_screen | ( | void | ) |
Get the singleton Bluetooth settings screen, ready to push onto the navigator.