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 can i get 128bit service uuid from peripheral

Hi. I'm trying to get 128bit service uuid as referring to "ble_app_hrs_c" source code.(S130) And my test peripheral device provides GAP, DEVICE Information and User service UUID(128bit). When I define uuid and type as below, hrs_uuid.type = BLE_UUID_TYPE_BLE; hrs_uuid.uuid = BLE_UUID_DEVICE_INFORMATION_SERVICE; it works really well.

But i don't know how can I get user service uuid(128bit). Maybe, the solution could be hrs_uuid.type = BLE_UUID_TYPE_VENDOR_BEGIN; hrs_uuid.uuid128 ????

But there is no way to set "ble_db_discovery_evt_register".

I want your help. Thank you.

Parents
  • FormerMember
    0 FormerMember

    The ble_app_hrs_c example in the SDK implements the central side of the heart rate profile defined by Bluetooth SIG. Profiles defined by Bluetooth SIG use a 16-bit UUID instead of a 128-bit UUID like what proprietary profiles have to use.

    Since ble_app_hrs_c only uses 16-bit UUIDs, it is not the very best example for you. Instead you can look at ble_app_uart_c, it is the central side of the UART example and uses a 128-bit UUID. I think taking a look at it will solve most of your problems.

    Update 02.03.16 The function sd_ble_uuid_vs_add(..) is as you know used to add a vendor specific/custom UUID. The out paramter of that function, p_uuid_type, is an index to a table where the base UUID is being stored. As you can see here, the two first indices are reserved, and the index 0x02 and upwards are for custom UUIDS. That way, the UUID type tells which base UUID that is in question.

    In sd_ble_gattc_primary_services_discover(..) the parameter ble_uuid_t includes the full service UUID; the base UUID (ble_uuid.type) and the bytes 12 and 13 (ble_uuid.uuid).

    Update 04.03.16: If you want to extract an unknown 128-bit UUID, a UUID that has not been added to the system using sd_ble_uuid_vs_add(..), you can use the function sd_ble_gattc_attr_info_discover(..). That function does only exist in S130 v2.0.0 alpha, S130 v2.0.0, and S132 (nRF52)

  • FormerMember
    0 FormerMember in reply to FormerMember

    I have updated my answer to answer your question. Let me know it is still not clear.

Reply Children
No Data
Related