Context
BleServer methods that return esp_err_t can have their return values ignored silently. If a caller forgets to check the error, failures go undetected.
Suggested Fix
Add [[nodiscard]] attribute to methods returning esp_err_t:
[[nodiscard]] esp_err_t init ();
[[nodiscard]] esp_err_t start ();
[[nodiscard]] esp_err_t stop ();
[[nodiscard]] esp_err_t update_location (const BleLocationData& location);
[[nodiscard]] esp_err_t send_alert (const BleAlertData& alert);
[[nodiscard]] esp_err_t set_device_name (const char* name);
This causes compiler warnings when return values are ignored.
Priority
Low - defensive coding improvement
Context
BleServermethods that returnesp_err_tcan have their return values ignored silently. If a caller forgets to check the error, failures go undetected.Suggested Fix
Add
[[nodiscard]]attribute to methods returningesp_err_t:This causes compiler warnings when return values are ignored.
Priority
Low - defensive coding improvement