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

Problems with ble_discovery_start() when adding 2 vendor specific UUID

Hello,

I´ve got a problem with the primary services discovery when register more than 1 vendor specific UUID. I´m actually connecting one Cadence Sensor and one Motion Sensor using NUS with runs fine.

Now i wanted to add a Ti SensorTag which also has a vendor specific UUID. As a standalone application the sensor is running. However if i add the SensorTag to my project with the other two sensors the sensor using a vendor specific uuid which get´s initialized second can´t be discovered. This is due to the fact that in ble_discovery_start() the second initialized with a vendor specific uuid get´s wrong data, i.e. the data of the first initialized vendor specific uuid sensor. To give an example if the Ti Sensortag (vendor specific UUID) get´s initialized after the motion sensor (NUS=vendor specific UUID), the SensorTag receives in the ble_discovery_start() the data which belongs to the NUS. Viceversa the problem is the same.

p_srv_being_discovered = &(p_db_discovery->services[p_db_discovery->curr_srv_ind]);
p_srv_being_discovered->srv_uuid = m_registered_handlers[p_db_discovery->curr_srv_ind];

How can i solve this?

  • Maybe i can already give an answer by myself:

    I saw this in the multilink example:

    // Stack checks first if there are still entries in the table before checking if a vendor
    // specific UUID is already in the table thus to be able to call sd_ble_uuid_vs_add several
    // times with the same entry, vs_uuid_count has to be 1 bigger than what is actually needed.
        ble_enable_params.common_enable_params.vs_uuid_count = 2;
    

    I did set this value to 2. This allowed me to connect two vs uuid´s but for some reason the second connected get´s wrong discovery data (from the first). Now after changing to 3 the application works with both vs uuid peripherals correctly. I didn´t really understand the comment from the multilink example and i have no time to understand it but i hope this helps others if they have the same issue.

  • It is correct to increase vs_uuid_count, but if you add 2 UUID bases, setting it to 2 should be enough. Increasing it will increase the RAM required by the SoftDevice, have you increased it? What SDK and SoftDevice version are you using?

  • I use the SDK 12 and the SoftDevice S130 2.0.1

    Setting the vs_uuid_count to 2 was enough to connect both vs uuid peripherals but the second initialized couldn´t be discovered properly as i described above. Changing the order of initialization of the 2 sensors showed that the error was changing between the sensor discoveries too. Setting the vs_uuid_count to 3 solved the problem (which i tried due to the comment from the multilink example "vs_uuid_count has to be 1 bigger than what is actually needed").

  • I didn't read the comment. I'm pretty sure that it is incorrect, if you add 2 bases, setting vs_uuid_count to 2 should be sufficient. I'm not sure why it solved your issue though.

  • I too have 2 vendor specific services and facing a similar problem but, setting vs_uuid_count to 3 doesn't solve the issue for me.

Related