cancel
Showing results for 
Search instead for 
Did you mean: 

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 0x46.

LCata.1
Associate II
 
14 REPLIES 14
Sebastien DENOUAL
ST Employee

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
Associate II

this error is happening on the client side

LCata.1
Associate II

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

LCata.1
Associate II

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
Associate II

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
Associate II

error code is 0x0

reason is 0x8 (Connection timeout)

LCata.1
Associate II

aci_gatt_proc_complete_event gives an error code of 0x41 (Failed)

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.