2025-11-12 2:28 AM - edited 2025-11-12 2:33 AM
I am currently working with an STM32WB05N as a co processor to a STM32U5, but I think the basic flow should be the same for all WB products. But I didn't find an AN or example for it.
My device is acting as a central and connecting to a (WB55 based) peripheral which uses aci_l2cap_connection_parameter_update_req. My central receives this though aci_l2cap_connection_update_req_event. So far so good.
But now I want to accept the proposal with aci_l2cap_connection_parameter_update_resp using the same parameters received through the request and Min_CE_Length as well as Max_CE_Length using the same values I used for the original connection opening (and 0x01 for accept). But I get a 0x12 BLE_ERROR_INVALID_HCI_CMD_PARAMS.
What am I doing wrong? (and is there example code for connection update somewhere?)
uint8_t s_Identifier;
uint16_t s_Connection_Interval_Min;
uint16_t s_Connection_Interval_Max;
uint16_t s_Max_Latency;
uint16_t s_Timeout_Multiplier;
void vPendableConnectResp( void * pvParameter1, uint32_t ulParameter2 )
{
tBleStatus State;
//accept whatever the peripheral wants
State = aci_l2cap_connection_parameter_update_resp(s_ConnectionHandle,
s_Connection_Interval_Min,
s_Connection_Interval_Max,
s_Max_Latency,
s_Timeout_Multiplier,
BLE_MINIMUM_CE,
BLE_MAXIMUM_CE,
s_Identifier,
1);
while(State != BLE_STATUS_SUCCESS);
}
void aci_l2cap_connection_update_req_event(uint16_t Connection_Handle,
uint8_t Identifier,
uint16_t L2CAP_Length,
uint16_t Connection_Interval_Min,
uint16_t Connection_Interval_Max,
uint16_t Max_Latency,
uint16_t Timeout_Multiplier)
{
if(Connection_Handle == s_ConnectionHandle)
{
s_Identifier = Identifier;
s_Connection_Interval_Min = Connection_Interval_Min;
s_Connection_Interval_Max = Connection_Interval_Max;
s_Max_Latency = Max_Latency;
s_Timeout_Multiplier = Timeout_Multiplier;
//pend to timer function to prevent recursion in task handler
xTimerPendFunctionCall(vPendableConnectResp, NULL, 0, 0);
}
}
2025-11-14 6:12 AM
2025-11-18 12:12 AM
What am I supposed to find there? The functions description is just the doxygen export of what I already saw in the code. But there is no description about the flow.
So the Questions remain the same:
1) What in the code above is wrong?
2) Is there example code for connection update somewhere?
2025-11-19 1:31 AM
Hello,
I don't see what you did wrong here but you can check BLE_p2pClient application like here :
https://github.com/STMicroelectronics/STM32CubeWB0/blob/1d091cbd4c787a4208711e121d17a0dde6279b9a/Projects/NUCLEO-WB05KZ/Applications/BLE/BLE_p2pClient/STM32_BLE/App/app_ble.c#L710
Corentin