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

BLE Driver Unable to write to a characteristic

Hi ,

I am unable to write to discover all services and write to a characteristic too.

On discovering services:

Discovering primary services

Received service discovery response

UUID: 0xA100, start handle: 0x000C, end handle: 0x0015

Discovering characteristics

Received characteristic discovery response, characteristics count: 3

Handle: 0x000D, UUID: 0xA101

Handle: 0x0010, UUID: 0xA102

Handle: 0x0012, UUID: 0x2A38

Discovering descriptors

Received descriptor discovery response, descriptor count: 5

Handle: 0x000D, UUID: 0x2803

Handle: 0x000E, UUID: 0xA101

Handle: 0x000F, UUID: 0x2902

Handle: 0x0010, UUID: 0x2803

Handle: 0x0011, UUID: 0xA102

it is missing a fourth service with UUID 0xA103 and I actually want to write the characteristic with UUID 0xA102. I have tried to write to the handle 0x011(15) using the code given here by Stian.

devzone.nordicsemi.com/.../

Could someone let me know where I am going wrong please? I am just not able to discover the fourth service or write to the characteristic 0xA102 with handle 0x0011

Thanks and Regards, Neil

Parents
  • You haven't discovered all the characteristics. The service discovery shows handles all the way up to 0x0015. You've only discovered up to 0x0011. You need to do another discover descriptors starting at 0x0012 until you've exhausted the service. The payload for the underlying ATT find information request is of max size MTU-2, which is 21 bytes, which is 5 {Handle,value} pairs.

  • Ok I have done created a new method and manually specified the start handle for the descriptor discovery service.

    Received descriptor discovery response, descriptor count: 5

    on Discovery response Handle: 0x000D, UUID: 0x2803

    on Discovery response Handle: 0x000E, UUID: 0xA101

    on Discovery response Handle: 0x000F, UUID: 0x2902

    on Discovery response Handle: 0x0010, UUID: 0x2803

    on Discovery response Handle: 0x0011, UUID: 0x2A38

    Press enter to toggle notifications 1

    Discovering descriptorsvjhghgjh

    Received descriptor discovery response, descriptor count: 5

    on Discovery response Handle: 0x0011, UUID: 0x2A38

    on Discovery response Handle: 0x0012, UUID: 0x2803

    on Discovery response Handle: 0x0013, UUID: 0xA103

    on Discovery response Handle: 0x0014, UUID: 0x2803

    on Discovery response Handle: 0x0015, UUID: 0xA102

Reply
  • Ok I have done created a new method and manually specified the start handle for the descriptor discovery service.

    Received descriptor discovery response, descriptor count: 5

    on Discovery response Handle: 0x000D, UUID: 0x2803

    on Discovery response Handle: 0x000E, UUID: 0xA101

    on Discovery response Handle: 0x000F, UUID: 0x2902

    on Discovery response Handle: 0x0010, UUID: 0x2803

    on Discovery response Handle: 0x0011, UUID: 0x2A38

    Press enter to toggle notifications 1

    Discovering descriptorsvjhghgjh

    Received descriptor discovery response, descriptor count: 5

    on Discovery response Handle: 0x0011, UUID: 0x2A38

    on Discovery response Handle: 0x0012, UUID: 0x2803

    on Discovery response Handle: 0x0013, UUID: 0xA103

    on Discovery response Handle: 0x0014, UUID: 0x2803

    on Discovery response Handle: 0x0015, UUID: 0xA102

Children
No Data
Related