2022-03-10 12:15 AM
2022-03-10 02:03 AM
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.
2022-03-10 02:05 AM
this error is happening on the client side
2022-03-10 02:07 AM
I am suppose to check disconnection_complete_event as well? I haven't looked at it since it wasn't mentioned here (see image).
2022-03-10 02:11 AM
2022-03-10 02:12 AM
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.
2022-03-10 02:12 AM
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");
2022-03-10 02:26 AM
error code is 0x0
reason is 0x8 (Connection timeout)
2022-03-10 02:29 AM
aci_gatt_proc_complete_event gives an error code of 0x41 (Failed)
2022-03-10 02:50 AM
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.