How do I discover multiple services via ble?

I have a device which advertises some services, I want to discover those services and write to those characteristics. However I can only find one service and not multiple.

I have the following code that registers one service:

static void db_discovery_init(void)
{
	uint32_t err_code = ble_db_discovery_init(db_disc_handler);
	APP_ERROR_CHECK(err_code);
	ble_uuid_t    auth_uuid;
	ble_uuid128_t auth_base_uuid = {{0xa0, 0xde, 0xbc, 0x9a, 0x78, 0x56, 0x34, 0x13, 0x78, 0x56, 0x34, 0x12, 0x78, 0x56, 0x34, 0x13}};

	auth_uuid.type = 1;
	auth_uuid.uuid = 0x5678;

	err_code = sd_ble_uuid_vs_add(&auth_base_uuid, &auth_uuid.type);
	if (err_code != NRF_SUCCESS)
	{
		NRF_LOG_INFO("err: %d\n", err_code);
		return;
	}

	err_code = ble_db_discovery_evt_register(&auth_uuid);
	APP_ERROR_CHECK(err_code);
}

But I also have the following service that I want to discover:

ble_uuid128_t other_service_base_uuid = {{0xf3, 0xde, 0xbc, 0x9a, 0x78, 0x56, 0x34, 0x13, 0x78, 0x56, 0x34, 0x12, 0x78, 0x56, 0x34, 0x13}}; which has the same 0x5678 uuid as the other.

I'm thinking maybe there is a way to register a service based on the full uuid, rather than two bytes.

I use sdk 12.3.0 for my nrf51802 with s130.

Related