Hi everyone,
I'm working with a Silicon Labs BGM121 microcontroller using Simplicity Studio, and developing in C.
Problem:
When I establish a BLE connection and then disconnect the client improperly (e.g., by turning off Bluetooth on the phone or Raspberry Pi), the gecko_evt_le_connection_closed_id event does not trigger on the marker.
As a result:
What’s the best practice to detect and handle unexpected client disconnects (such as power off or Bluetooth off) on a BLE GATT server using BGM121 and the Gecko stack?
Would appreciate any advice or pointers — thanks!
I'm working with a Silicon Labs BGM121 microcontroller using Simplicity Studio, and developing in C.
- Server: My BGM121-based device (referred to as "marker") that streams raw sensor data over BLE.
- Client: Either the Silicon Labs Si Connect app on a phone or a Raspberry Pi 5 running a Python BLE script.
Problem:
When I establish a BLE connection and then disconnect the client improperly (e.g., by turning off Bluetooth on the phone or Raspberry Pi), the gecko_evt_le_connection_closed_id event does not trigger on the marker.
As a result:
- The marker continues attempting to send notifications via gecko_cmd_gatt_server_send_characteristic_notification.
- The system doesn’t reset the connection state or return to advertising mode as expected.
What’s the best practice to detect and handle unexpected client disconnects (such as power off or Bluetooth off) on a BLE GATT server using BGM121 and the Gecko stack?
Would appreciate any advice or pointers — thanks!