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_.
Problem
alert_char_handle_is never assigned inble.cpp. Theadd_characteristics()function adds the alert characteristic but never setsalert_char_handle_. TheESP_GATTS_ADD_CHAR_EVThandler (line 411-421) only handles location and name characteristics - alert is missing.When
send_alert()is called, it uses the uninitializedalert_char_handle_, causing undefined behavior.Location
firmware/main/ble.cpp:254-259- alert characteristic added but handle never storedfirmware/main/ble.cpp:411-421- event handler missing alert caseSeverity
HIGH - Will cause crash or undefined behavior when sending BLE alert
Suggested Fix
Add handler for
BLE_CHAR_ALERT_UUIDinESP_GATTS_ADD_CHAR_EVTcase to storealert_char_handle_.