Skip to content
This repository was archived by the owner on Jan 17, 2023. It is now read-only.

Commit 6e09f79

Browse files
authored
Merge pull request #92 from NordicSemiconductor/buttonless_service_changed_fix
Fixed issue where service changed characteristic was enabled when not…
2 parents 032d631 + e523e38 commit 6e09f79

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

nordicsemi/dfu/dfu_transport_ble.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,9 @@ def jump_from_buttonless_mode_to_bootloader(self, buttonless_uuid):
187187
# Enable indication for Buttonless DFU Service
188188
self.adapter.enable_indication(self.conn_handle, buttonless_uuid)
189189

190-
# Enable indication for Service changed Service
191-
self.adapter.enable_indication(self.conn_handle, DFUAdapter.SERVICE_CHANGED_UUID)
190+
# Enable indication for Service changed Service, if present.
191+
if self.adapter.db_conns[self.conn_handle].get_char_handle(DFUAdapter.SERVICE_CHANGED_UUID):
192+
self.adapter.enable_indication(self.conn_handle, DFUAdapter.SERVICE_CHANGED_UUID)
192193

193194
# Enter DFU mode
194195
self.adapter.write_req(self.conn_handle, buttonless_uuid, [0x01])

0 commit comments

Comments
 (0)