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

Problems with the db discovery module

Hi everybody.

I am opening a dedicate question after a recent topic that already helped me a lot, with another discussion pretty similar to my problem. Resuming briefly, i have two nordic devices, a smart beacon kit (SDK 7.1 with s110) that is sending temperature by notification with a custom service (from service tutorial here on the nordic site), and a DK (SDK 11 with s130) that must receive the values and send it via USB to the PC. I use the ble_app_uart_c as reference on the DK, modified by one of the moderators to find the UUID of my service on the beacon and connect to it (function is_uuid_present), and this works correctly. The problem is that the next step should be find the service on the beacon with the discovery module, in order to start the transmission of the values, but it seems that the discovery module doesn't find the service (it starts correctly, but the function db_disc_handler, which should be called when a discovery event occurs, never executes). I load the two projects (the one on the beacon that i think at this point should be ok, and the one on the DK), can you please help me understand the error, or if i am using correctly the discovery module? Probably is some kind of stupid error caused by my inexperience ^^' Thanks in advance!

Or at least please tell me how should i use correctly the db discovery module, in terms of what field i should fill to make it find my service and characteristic or what esle!

projects.zip

libraries.zip

  • Please really nobody knows how to get the db discovery module working?

  • Hi. I assume this is the recent topic you talk about? I tried your code and it seemed to work fine out of the box. Your central connected with the beacon, db_disc_handler was called, and the service with UUID 0xF00D was discovered.

    Have you tried to define DEBUG in the Target Options -> C/C++ defines? As described here.

    Are you sure that you are in a connection? If you define DEBUG as mentioned above the application will print out some nice messages on the UART terminal about what is going on.

    And btw, this also seems to be you?

  • Can you debug your code and put a breakpoint in db_disc_handler to make sure that it is in fact never called?

  • The other topics are from another user, but it's ok because in the topic you posted first i found almost the same informations and followed them letter by letter! However here is what i have done: i debugged the code that i posted using some printf (which means that i am in connection via UART, because i see the text in the printf's on TERMITE). As soon as the two devices connect (i know it because the LED indicating connection turns on, and the function is_uuid_present returns success) the following functions are called inside Ble_db_discovery.c (with relative cases if present), in order:

    ble_db_discovery_start
    ble_db_discovery_on_ble_evt -> case 	BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP
    on_primary_srv_discovery_rsp
    characteristics_discover
    ble_db_discovery_on_ble_evt -> case BLE_GATTC_EVT_CHAR_DISC_RSP
    on_characteristic_discovery_rsp
    is_char_discovery_reqd
    characteristics_discover
    ble_db_discovery_on_ble_evt -> case BLE_GATTC_EVT_CHAR_DISC_RSP
    on_characteristic_discovery_rsp
    descriptors_discover
    is_desc_discovery_reqd
    descriptors_discover
    

    At the end of the last function, they just disconnect (and reconnect immediately after, executing the same functions again) instead of entering in db_disc_handler (i put here a printf too), and i can't really understand why.

    P.S i also noticed a strange thing that maybe can help you understand. In the function db_disc_handler, there is a check on the UUID (in the if statemente immediately after the function definition); as you can see in my code, i put there BLE_UUID_OUR_SERVICE or whatever it is. I tried to change it with a random value, like "2", and the strange fact is that in this case all the functions listed before are executed, but the two devices don't disconnect at the last one and db_disc_handler is called! Of course it stops at the if statement because it doesn't find an UUID like "2", but the strange fact is that just changing this check value, they don't disconnect and it enters the function.

  • Is there any news? Please Martin if the code works fine on your boards, can you upload the hex file for the nrf51 DK so i can verify that there are not compilation problems?

Related