This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

DFU buttonless get correct handle for notify but not for write

Hallo

Im trying to get the system into DFU mode from a PC application (not the Nordic connect)

The DFU works perfectly with the Connect application and nordic tools

Im developping a PC GUI and Im able to control all other services,

However when trying to implement the Enter bootloader command I have a problem

it does get the 'enable notifications' correctly with handle 0x19 (which equal to the CCCD Handle)

but when sending a write command it receives it with a 0x18 handle for some reason,

aren't the handle the same ?

for my PC software Im using pygatt and both subscribe (for notification enable) and write use the same uuid - 8e400001-f315-4f60-9fb8-838830daea50

Would appreciate any inputs here

Thanks!

 

Parents Reply Children
  • Hi,

    Yes, the UUID seems to have changed from SDK 12 to SDK 13.

    Ron said:
    anyway how would the handle be different between enable notifications and write ?

    it does get the 'enable notifications' correctly with handle 0x19 (which equal to the CCCD Handle)

    but when sending a write command it receives it with a 0x18 handle for some reason,

    aren't the handle the same ?

    No, the handles are different, so that is as expected. Enable the notification(CCCD handle), and then write 1 to the DFU control point to enter DFU mode.

  • Hi,

    This is what I use for enable notifications and it works :
    device.subscribe('8e400001-f315-4f60-9fb8-838830daea50', callback=BlueGigaThread.dfu_event_handler)

    and this is what I use for writing :
    device.char_write('8e400001-f315-4f60-9fb8-838830daea50',bytearray([1]))
    I use the same UUID as I understand that's ok, anyway it doesn't work

    the same synatx worked for other services, but as I say here it arrived with a slightly different handle ..
    Any ideas ?
    Thanks !
  • it doesn't work

    Could you explain what happens when you do this? 

    You have programmed the bootloader as well, right?

    here it arrived with a slightly different handle

    So the write fails ?

    If you know the handle, could you try char_write_handle() instead ?

    Is wait_for_response set to true or false?

Related