@@ -674,6 +674,21 @@ void BLEManagerImpl::HandleConnectEvent(volatile sl_bt_msg_t * evt)
674
674
PlatformMgr ().ScheduleWork (DriveBLEState, 0 );
675
675
}
676
676
677
+ void BLEManagerImpl::HandleConnectParams (volatile sl_bt_msg_t * evt)
678
+ {
679
+ sl_bt_evt_connection_parameters_t * con_param_evt = (sl_bt_evt_connection_parameters_t *) &(evt->data );
680
+
681
+ if (con_param_evt->timeout < BLE_CONFIG_TIMEOUT)
682
+ {
683
+ ChipLogProgress (DeviceLayer, " Request to increase the connection timeout from %d to %d" , con_param_evt->timeout ,
684
+ BLE_CONFIG_TIMEOUT);
685
+ sl_bt_connection_set_parameters (con_param_evt->connection , BLE_CONFIG_MIN_INTERVAL, BLE_CONFIG_MAX_INTERVAL,
686
+ BLE_CONFIG_LATENCY, BLE_CONFIG_TIMEOUT, BLE_CONFIG_MIN_CE_LENGTH, BLE_CONFIG_MAX_CE_LENGTH);
687
+ }
688
+
689
+ PlatformMgr ().ScheduleWork (DriveBLEState, 0 );
690
+ }
691
+
677
692
void BLEManagerImpl::HandleConnectionCloseEvent (volatile sl_bt_msg_t * evt)
678
693
{
679
694
sl_bt_evt_connection_closed_t * conn_evt = (sl_bt_evt_connection_closed_t *) &(evt->data );
@@ -1061,11 +1076,20 @@ extern "C" void sl_bt_on_event(sl_bt_msg_t * evt)
1061
1076
}
1062
1077
break ;
1063
1078
case sl_bt_evt_connection_parameters_id: {
1064
- // ChipLogProgress(DeviceLayer, "Connection parameter ID received");
1079
+ ChipLogProgress (DeviceLayer, " Connection parameter ID received - i:%d, l:%d, t:%d, sm:%d" ,
1080
+ evt->data .evt_connection_parameters .interval , evt->data .evt_connection_parameters .latency ,
1081
+ evt->data .evt_connection_parameters .timeout , evt->data .evt_connection_parameters .security_mode );
1082
+ chip::DeviceLayer::Internal::BLEMgrImpl ().HandleConnectParams (evt);
1065
1083
}
1066
1084
break ;
1067
1085
case sl_bt_evt_connection_phy_status_id: {
1068
- // ChipLogProgress(DeviceLayer, "PHY update procedure is completed");
1086
+ ChipLogProgress (DeviceLayer, " Connection phy status ID received - phy:%d" , evt->data .evt_connection_phy_status .phy );
1087
+ }
1088
+ break ;
1089
+ case sl_bt_evt_connection_data_length_id: {
1090
+ ChipLogProgress (DeviceLayer, " Connection data length ID received - txL:%d, txT:%d, rxL:%d, rxL:%d" ,
1091
+ evt->data .evt_connection_data_length .tx_data_len , evt->data .evt_connection_data_length .tx_time_us ,
1092
+ evt->data .evt_connection_data_length .rx_data_len , evt->data .evt_connection_data_length .rx_time_us );
1069
1093
}
1070
1094
break ;
1071
1095
case sl_bt_evt_connection_closed_id: {
0 commit comments