Skip to main content

CFG_MAX_CONNECTIONS=2 ble_app_peripheral

2 years ago

CFG_MAX_CONNECTIONS=2 ble_app_peripheral

Posted byRoie DAHAN0 points 5 replies
0 upvotes

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

2 years ago

PM_Dialog

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)in app.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

2 years ago

Roie DAHAN 0 points

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

2 years ago

PM_Dialog

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

accepted answer!

2 years ago

Roie DAHAN 0 points

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

accepted answer!

2 years ago

PM_Dialog

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