CFG_MAX_CONNECTIONS=2 ble_app_peripheral

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
6 posts / 0 new
Last post
Roie DAHAN
Offline
Last seen:9 months 1 week ago
Joined:2018-11-19 16:32
CFG_MAX_CONNECTIONS=2 ble_app_peripheral

Hi,

I'm looking for an example code that show enable multiple connections to my ble_app_peripheral using DA14585 custom service
for example:
#define CFG_MAX_CONNECTIONS (2)
- task1 read ADC
- task2 toggle LED
while two mobile phones connected (Android/iOS)

Thanks,
Roie

Device:
PM_Dialog
Offline
Last seen:2 days 23 hours ago
Staff
Joined:2018-02-08 11:03
Hi Roie DAHAN,

Hi Roie DAHAN,

There isn’t any available example regarding the multiple simultaneous connections when the DA14585 acting as peripheral device. However, you can find some steps below in order to be able to connect the DA14585 with 2 mobile phones at the same time.

  • #define CFG_MAX_CONNECTIONS (2) in da1458x_config_basic.h header file
  • #定义APP_EASY_MAX_ACTIVE_CONNECTION(2)应用程序。h header file for supporting 2 connections in application task
  • In user_app_connection() comment out the whole if() statement an call the user_app_adv_start() function before default_app_on_connection()
  • In user_app_adv_start(), comment out the app_easy_timer() and the app_add_ad_struct()

The central devices are two Android devices and the peripheral device is a DA14585 Pro-DK. For this demo I used the ble_app_peripheral example and I am able to switch off/on the LED on the Pro-DK with both of the mobile phones. Also, can you please let me know in which SDK version are you working on?

Thanks, PM_Dialog

Roie DAHAN
Offline
Last seen:9 months 1 week ago
Joined:2018-11-19 16:32
Hi,

Hi,

Thanks for the quick reply.

I'm using SDK DA14585_SDK_6.0.10.511_0 with DA14585 (complied with Keil)

The good news are after applying the changes you recommended two Mobile phones are able to get to Connected state :)
However, once i write any value the app is getting to
gapc_disconnect_ind_handler
// We are not in Connected State
--> ASSERT_ERROR(0);
can you send me your example to see what part i'm missing ?

Regards,
Roie

PM_Dialog
Offline
Last seen:2 days 23 hours ago
Staff
Joined:2018-02-08 11:03
Hi Roie DAHAN,

Hi Roie DAHAN,

I am not able to replicate your issue. While the DA14585 is connected with the mobile phones, I am able to write a value into the LED characteristic using both of them. Also, I used the configurations that I have mentioned in my previous post. Are you using the default ble_app_peripheral example of the SDK? The gapc_disconnect_ind_handler is triggered only if one of the mobile phones is disconnected. Also, this handler is executed only if you get a GAPC_DISCONNECT_IND message. If you found any of the above answers useful please mark one of them as accepted.

Thanks, PM_Dialog

Roie DAHAN
Offline
Last seen:9 months 1 week ago
Joined:2018-11-19 16:32
Hi,

Hi,

This issue is still in "Open" state since it's not usable to connect two devices and once the first byte arrives the DA14585 closes the connection.

As stated in my provisos post I'm using SDK DA14585_SDK_6.0.10.511_0 with DA14585 (complied with Keil)

The changes i made are "only" the ones mention in the post above, that is way as i asked for the Demo ("no warranty") code you tested with maybe there is some option/flag that causes a difference in behavior.

Can you send me your example to see what part i'm missing ("no warranty") ?

Regards,
Roie

PM_Dialog
Offline
Last seen:2 days 23 hours ago
Staff
Joined:2018-02-08 11:03
Hi Roie DAHAN,

Hi Roie DAHAN,

I used the default ble_app_peripheral example of the SDK DA14585_SDK_6.0.10.511_0 with DA14585 (complied with Keil) and the only configurations that I did are in my previous post. Could you please try it into the default ble_app_peripheral example of the SDK and let me know? Are you able to toggle the LED on the Pro DK using both of your mobile phones? Which mobile application are you using?

Thanks, PM_Dialog