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

S120 adding 2 uuids for 2 peripherals

Hello, I am working on S120 SD v2.1.0 for central and S110 v8.0 SD for peripheral and SDK9.0 and I am able to configure 1 single uuid on central and connect to multiple peripherals with the same UUID.

But now I am trying to configure different UUID for 2 different peripherals, and on the central side I added the UUID as follows:

	ble_uuid_t uuid;
uuid.type = m_base_uuid_type;
uuid.uuid = BLE_UUID_NUS_SERVICE;

err_code = ble_db_discovery_evt_register(&uuid, db_discovery_evt_handler);
APP_ERROR_CHECK(err_code);

uuid.type = m_base_uuid_type;
uuid.uuid = 0x0002;

err_code = ble_db_discovery_evt_register(&uuid, db_discovery_evt_handler);
APP_ERROR_CHECK(err_code);

i.e., one with NUS service and other with UUID = 0x0002. Now the issue I am facing is, the ID with 0x0002 is not able to connect. When the central connects to the device, I am getting BLE_DB_DISCOVERY_SRV_NOT_FOUND event . Since this is major requirement for my application, can anyone help me in configuring this? I'm I missing anything in configuration?

Regards,
Sowmya

Parents
  • You say "Now the issue I am facing is, the ID with 0x0002 is not able to connect. When the central connects to the device, I am getting BLE_DB_DISCOVERY_SRV_NOT_FOUND event ."

    This is confusing. First you say that you cannot connect, and then you say that you connect successfully but are unable to discover services?

    Since you look for both services on both devices, you should receive the BLE_DB_DISCOVERY_SRV_NOT_FOUND event on both devices (because they only have one each).

    I think you should make two db_discovery handlers, so that you more easily can know which service you are not finding.

    Given that you are connecting to both, you should get one BLE_DB_DISCOVERY_SRV_NOT_FOUND and one BLE_DB_DISCOVERY_COMPLETE per peripheral.

Reply
  • You say "Now the issue I am facing is, the ID with 0x0002 is not able to connect. When the central connects to the device, I am getting BLE_DB_DISCOVERY_SRV_NOT_FOUND event ."

    This is confusing. First you say that you cannot connect, and then you say that you connect successfully but are unable to discover services?

    Since you look for both services on both devices, you should receive the BLE_DB_DISCOVERY_SRV_NOT_FOUND event on both devices (because they only have one each).

    I think you should make two db_discovery handlers, so that you more easily can know which service you are not finding.

    Given that you are connecting to both, you should get one BLE_DB_DISCOVERY_SRV_NOT_FOUND and one BLE_DB_DISCOVERY_COMPLETE per peripheral.

Children
No Data