Skip to content

bug: BLE alert characteristic handle never set #38

@gdellis

Description

@gdellis

Problem

alert_char_handle_ is never assigned in ble.cpp. The add_characteristics() function adds the alert characteristic but never sets alert_char_handle_. The ESP_GATTS_ADD_CHAR_EVT handler (line 411-421) only handles location and name characteristics - alert is missing.

When send_alert() is called, it uses the uninitialized alert_char_handle_, causing undefined behavior.

Location

  • firmware/main/ble.cpp:254-259 - alert characteristic added but handle never stored
  • firmware/main/ble.cpp:411-421 - event handler missing alert case

Severity

HIGH - Will cause crash or undefined behavior when sending BLE alert

Suggested Fix

Add handler for BLE_CHAR_ALERT_UUID in ESP_GATTS_ADD_CHAR_EVT case to store alert_char_handle_.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions