With SDK 2.0.1 and the 20736S and 20737S modules, the default is 4, but we can support up to 8:
extern void blecm_setmaxconnection(UINT8 num);
// Set the max number of connections to support to 8.
bleapp_set_cfg( application_gatt_database, sizeof(application_gatt_database), (void*)&application_profile_cfg, (void *)&blemultislavelb_puart_cfg, (void*)&application_gpio_config, application_create);
Is there a way to force a specific peripheral to disconnect from a central device when multiple peripherals are connected to a central device?
There seems only to be blecm_disconnect(BT_ERROR_CODE_CONNECTION_TERMINATED_BY_LOCAL_HOST), but how is the peripheral specified? I have tried using emconinfo_setConnHandle(), and this seems to work sometime but other times emconinfo starts returning bogus data for the other peripherals.
Can you provide some pseudo-code to show how this "should" be done?
I have created a case internally and asked one of the developers to respond.
1 of 1 people found this helpful
Please check a4wp_power_transmitter sample for the way to deal with multiple slaves. When you want to send data to a specific device or disconnect a specific device you should call blecm_SetPtrConMux with an HCI handle of the specific connection. This handle is passed to the application at the time connection is established (connection_up).
Is up to 8 supported by SDK 2.0.0? When I set blecm_setmaxconnection(8) and try to connect a fifth device, I never get a connection up (BLECM_APP_EVT_LINK_UP) callback for the fifth device.
That should work. Are you sending advertisements in your app. Please try to remove all the calls to bleprofile_Discoverable. There was a bug in 2.0 fixed in the 2.1 which can leak a connection block when advertisements are restarted while connection is up. I wonder if this is hurting your application.
Thanks for the quick response.
I think your comment above about removing bleprofile_Discoverable() helped with the disconnect problem I had before.
WRT to simultaneous connections, I was calling blecm_ConMuxInit(8) thinking I was calling blecm_setmaxconnection(8). Fixed that and can connect a fifth and sixth device, but I stop receiving Advertising Report callbacks after the sixth device. It seems that six is the limit with SDK 2.0.0 then?
If you are calling correct function passing 8, it should be 8 connections. Unless you are doing advertisements as well. Sending advertisements takes a connection because stack needs to be ready to accept connect request.
Still not seeing eight. Previously had been using four, and when I called blecm_setmaxconnection( 8 ), I was able to connect to six, which suggests that I am calling the correct functions with the right parameters. I had already commented out my call to bleprofile_Discoverable(). Are there any other settings that might affect the connection count?
Is there a sample app available? The central examples provided in SDK 2.0 show example connections to either two or four devices only.
1 of 1 people found this helpful
found that the following BLE_CEN_CFG settings needed to be bumped up in order to enable 8 simultaneous connections:
blecen_cen_cfg.high_conn_min_interval = 8; //frames blecen_cen_cfg.low_conn_min_interval = 8; //frames blecen_cen_cfg.high_conn_max_interval = 8; //frames blecen_cen_cfg.low_conn_max_interval = 8; //frames
Thanks for your help
What about the non-connectable advertisement? Will it also allocate one mux that reserving for connection?
I am pretty sure non-connectable advertisement do not reserve the connection.