This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to use HANDLE RANGE correctly for Multiconnection ?

good time dear Engineers!

Please explain how to use correctly HANDLE RANGE in functions of discovering. I use CENTRAL with up to 8 possible connections to PERIPH, so pls explain following:

sd_ble_gattc_primary_services_discover(conn_handle, start_handle, &uuid);

WHAT IS start_handle if 8 Active Connections co-exist ? why it is always 0x0001 ?

sd_ble_gattc_characteristics_discover(conn_handle, p_handle_range);

WHAT is p_handle_range if 8 ACTIVE CONNECTIONS ? for example, for 2 connections: if conn_handle1=0x0 and conn_handle2=0x1 ?

sd_ble_gattc_descriptors_discover(conn_handle, p_handle_range);

for different connections handles (0x0,0x1,etc..), must p_handle_range be different too ? e.g.

conn_handle1=0x00: p_handle_range  = {0x10,0x15}
conn_handle2=0x01: p_handle_range  = {0x20,0x25}

etc.. ?

How to Manage Handle Ranges in case of Disconnecting -> Connencting -> Discovering again , etc... correctly (in this cases old handles must be re-assigned again) ?

I have one SERVICE (1666) two CHAR's (d5aa, d780) in this service and 4 Descriptors in each CHAR.

I found SERVICE, CHARS and store it's HANDLEs in my database according to the Photo. Q: how to find all descriptors in each CHAR's ? What valid handle_range I should use as PARAMETER to sd_ble_gattc_descriptors_discover(...) ?

image description

if I use handle_range of [e.g. 0x09 - 0x0E] means from service start_ handle to last char handle_value , seems it's OK, all the Attribute founds success.

Parents
  • The start_handle have to be the same for every connection. I guess you have got something wrong. Even if you have different connections, they will all communicate with the very same service and most likely will operate on the very same characteristic data.

    A handle is some kind of shortcut for an attribute and if all connections want to write to a specific characteristic, they all use the same handle.

  • ... sorry but seems a little misunderstanding, My Central does handles 8 connections to communicate with different services (peers).

    How do I should update p_handle_range right way in the mentioned functions xxx_discover (...) ? In ble_gattc.h I find the text : "...with an updated handle range to continue the discovery..."

    How to UPDATE these ranges numerically ? +=1, +=2 or maybe +=0x17 in case of 8 connections already established and I have to descovery all the Services & Chars and Descriptions ?

    and how I should use ble_gattc_char_t::handle_decl the Handle ?

Reply
  • ... sorry but seems a little misunderstanding, My Central does handles 8 connections to communicate with different services (peers).

    How do I should update p_handle_range right way in the mentioned functions xxx_discover (...) ? In ble_gattc.h I find the text : "...with an updated handle range to continue the discovery..."

    How to UPDATE these ranges numerically ? +=1, +=2 or maybe +=0x17 in case of 8 connections already established and I have to descovery all the Services & Chars and Descriptions ?

    and how I should use ble_gattc_char_t::handle_decl the Handle ?

Children
No Data
Related