Skip to main content
LCata.1
Associate
March 10, 2022
Question

I am using BlueNRG1. My setup consists of a peripheral and controller. I am having issues using the aci_gatt_disc_all_primary_services() function. I input the connection handle received from hci_le_connection_complete_event. Yet, I get an error of 0x

  • March 10, 2022
  • 12 replies
  • 6462 views

..

    This topic has been closed for replies.

    12 replies

    Sebastien DENOUAL
    ST Employee
    March 10, 2022

    Hi @LCata.1​ ,

    Could you please confirm if error is happening on server or client side ?

    0x46 means "not allowed". Usually this error is raised because API is not called at right moment.

    Just in case : Avoid to call this API (aci_gatt_disc_all_primary_services) inside hci_le_connection_complete_event() to avoid reentrance.

    Is there any disconnection in teh meantime ? (disconnection_complete_event)

    May you share extract of code ?

    Regards,

    Sebastien.

    LCata.1
    LCata.1Author
    Associate
    March 10, 2022

    this error is happening on the client side

    LCata.1
    LCata.1Author
    Associate
    March 10, 2022

    I am suppose to check disconnection_complete_event as well? I haven't looked at it since it wasn't mentioned here (see image).0693W00000Kc4rKQAR.png

    Sebastien DENOUAL
    ST Employee
    March 10, 2022

    Hi @LCata.1​ ,

    Yes, this disconnetcion_complete_event inform you about disconnection ( whatever server or client side - it also gives you reason code for disconnection)

    I'm not saying it is root cause but If a disconnection happens for any reason, there is a risk you are calling aci_gatt_disc_all_primary_services with invalid connection handle (because of disconnetcion)

    Regards,

    Sebastien.

    LCata.1
    LCata.1Author
    Associate
    March 10, 2022
    LCata.1
    LCata.1Author
    Associate
    March 10, 2022

    Above is my code. The line where I use the function is at line 241:

          ret = aci_gatt_disc_all_primary_services(connection_handle);

          if(ret != BLE_STATUS_SUCCESS) printf("Failure.\n");

    LCata.1
    LCata.1Author
    Associate
    March 10, 2022

    error code is 0x0

    reason is 0x8 (Connection timeout)

    Sebastien DENOUAL
    ST Employee
    March 10, 2022

    Ok - Thanks for feedback.

    > 0x08 is a timeout (supervision timeout)

    At first, you can try to increase timeout value while calling aci_gap_create_connection() - Value you set looks already correct - Should at least twice connection interval +1 (this is the case here)

    May be timeout issue is link to a request which is not acknowledged such as connection parameters update request, ....

    Is there any other pending action in your code (ie like update parameters)?

    Are you using your own HW/PCB ? if not which evalboard are your using ?

    Regards,

    Sebastien.

    LCata.1
    LCata.1Author
    Associate
    March 10, 2022

    aci_gatt_proc_complete_event gives an error code of 0x41 (Failed)

    LCata.1
    LCata.1Author
    Associate
    March 10, 2022

    Hmmmm, the connection is from bluenrg1 to bluenrg1 and it is my own board. I can verify that there is a connection by blinking LEDs when the two are connected. By pending action? Do you mean the peripheral side?

    LCata.1
    LCata.1Author
    Associate
    March 10, 2022

    This is the code to program the peripheral ble, there is nothing pending (i think). Unless I am missing any callback functions needed to grant access? I didn't set any security though... if that is a possibility. And since I am not reading anything yet, I didn't think that aci_gatt_allow_read() is necessary. Althought, I do have it in my peripheral code already.

    Sebastien DENOUAL
    ST Employee
    March 10, 2022

    Hi,

    By chance, does simialr code return same erro ron STEAL board (STEVAL-IDB07V1) ?

    Did you performed a HW bringup of your PCB ? see AN4818

    If you run server code on your BlueNRG-1 board : are you able to connect using smartphone debug APP surch as BLE_Scanner ?

    Regards,

    Sebastien