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

How to send the 128-bit base UUID

Hello,

I am developing on the nRF51 and soft device version 8.0.0.

I have created a new service that has a 128-bit UUID that is based on the base UUID: 00000000-0000-1000-8000-00805f9b34fb

I am trying to make the service discoverable with the full 128-bit service UUID, but it always just shows the 16-bit UUID.  Is there a way to show the whole UUID?  Here is my initialization code:

  const ble_uuid128_t service_uuid128 = {
    {
      0xFB, 0x34, 0x9B, 0x5F, 0x80, 0x00, 0x00, 0x80,
      0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
    }
  };

  BLE_UUID_BLE_ASSIGN(service_uuid, BLE_MY_GATT_SERVICE_UUID);

  err_code = sd_ble_uuid_vs_add(&service_uuid128, &(service_uuid.type));
  if (err_code != NRF_SUCCESS) {
      return err_code;
  }

  err_code = sd_ble_gatts_service_add(BLE_GATTS_SRVC_TYPE_PRIMARY,
                                      &service_uuid,
                                      &(p_my_service->service_handle));
  if (err_code != NRF_SUCCESS) {
    return err_code;
  }
 

Thanks

Related