|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
Bluetooth UI flow for toggling BLE, status display, and device scanning. More...
#include "AppUiInternal.h"#include "cdc_os_ui/views/BlePairingView.h"#include "cdc_hal/IBluetoothController.h"#include "cdc_msg/MessageTransfer.h"#include "cdc_views/RenderHelpers.h"#include "cdc_log.h"#include <cstdio>#include <cstring>#include "freertos/FreeRTOS.h"#include "freertos/task.h"#include "esp_timer.h"Go to the source code of this file.
Classes | |
| class | cdc::ui::BleScanView |
| ListView for the BLE scan results that drives async name resolution while visible and cancels it when the view closes. More... | |
Namespaces | |
| namespace | cdc |
| namespace | cdc::ui |
| Centralized key-code constants for cdc_views. | |
Typedefs | |
| using | cdc::ui::BleListenerToken = hal::IBluetoothController::ListenerToken |
Enumerations | |
| enum | cdc::ui::BluetoothMenuIdx { cdc::ui::BT_IDX_ENABLE = 0 , cdc::ui::BT_IDX_PAIR , cdc::ui::BT_IDX_PAIRED , cdc::ui::BT_IDX_STATUS , cdc::ui::BT_IDX_SCAN , cdc::ui::BT_IDX_BEACON , cdc::ui::BT_IDX_FORGET_BONDS , cdc::ui::BT_IDX_FIXED_COUNT } |
| Bluetooth fixed menu indices and capacity limits. More... | |
| enum class | cdc::ui::BleResolvePhase : uint8_t { cdc::ui::Idle , cdc::ui::Begin , cdc::ui::Connecting , cdc::ui::Discovering , cdc::ui::Reading , cdc::ui::Settle } |
Functions | |
| static void | cdc::ui::onBluetoothMenuSelect (uint16_t index, void *userData) |
| Handles Bluetooth menu selection. | |
| static void | cdc::ui::toggleBluetoothEnable () |
| Toggles BLE controller enabled state. | |
| static void | cdc::ui::showBluetoothStatus () |
| Shows BLE status and adapter information. | |
| static void | cdc::ui::startBluetoothScan () |
| Starts BLE scan and opens result list. | |
| static void | cdc::ui::showPairedDevices () |
| Shows the list of paired (bonded) devices. | |
| static bool | cdc::ui::renderBleRow (Gdey029T94 *gfx, const ListItem &item, uint16_t index, int x, int y, int w, int h, bool selected, void *userCtx) |
| Renders one BLE scan row with signal bars and RSSI text. | |
| static void | cdc::ui::sortBleScanResults () |
| Sorts BLE scan results by RSSI descending. | |
| void | cdc::ui::rebuildBluetoothMenu () |
| Rebuilds Bluetooth menu entries and dynamic module items. | |
| void | cdc::ui::showBluetoothMenu () |
| Shows top-level Bluetooth menu. | |
| static void | cdc::ui::bleResolveStop () |
| static void | cdc::ui::bleResolveBeginNext (uint32_t nowMs) |
| Starts resolving the next device that still shows its MAC. | |
| static void | cdc::ui::bleResolveMac (const hal::BleScanResult &d, char *out, size_t n) |
| Formats a scan result's MAC the same way as the no-name fallback. | |
| static bool | cdc::ui::bleDeviceNeedsName (uint8_t i) |
| True when the row still shows the MAC fallback (no name yet). | |
| static void | cdc::ui::bleResolveClearEvents () |
| static void | cdc::ui::rOnConnect (uint16_t connHandle) |
| static void | cdc::ui::rOnDisconnect (uint16_t connHandle, int) |
| static void | cdc::ui::rOnServiceDiscovered (uint16_t connHandle, const hal::IBluetoothController::DiscoveredService *svc, bool complete) |
| static void | cdc::ui::rOnCharRead (uint16_t connHandle, uint16_t, const uint8_t *data, uint16_t len) |
| static void | cdc::ui::bleResolveCleanupToSettle (uint32_t nowMs) |
| Tears down the current attempt and waits briefly for a clean stack. | |
| static void | cdc::ui::bleResolveStart () |
| static void | cdc::ui::bleResolveTick (uint32_t nowMs) |
| static void | cdc::ui::rebuildPairedList () |
| Rebuilds the paired-device list from the current bond store. | |
| static void | cdc::ui::onForgetConfirm (void *) |
| Confirmed-forget handler: unpairs the selected device and refreshes. | |
| static void | cdc::ui::onPairedSelect (uint16_t index, void *userData) |
| Asks for confirmation to forget the selected paired device. | |
Bluetooth UI flow for toggling BLE, status display, and device scanning.
Definition in file BluetoothMenuUi.cpp.