Role Switch on Time sharing

⚠️
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.
4 posts / 0 new
Last post
前腿帕特尔
Offline
Last seen:2 years 5 months ago
加入:2017-03-29 10:50
Role Switch on Time sharing

Hello Dialog_Support,

I am working on DA14580, and i could make it change role on time sharing basis and work also as central (switch from peripheral to central and the opposite). I am not connecting to any device. If i want to make connection in peripheral mode then is there any provision that connection request has served first before BLE stack has been erase(role change). My application requires 20-25 bytes of data communication with mobile Application so i cant do data communication in USER_ADVERTISE_DATA, without making any connection to the mobile Application. Can you suggest me that how should i communicate with these much data. Is there any example available then please send me.

Thanks and Regards,
前腿帕特尔

Device:
PM_Dialog
Offline
Last seen:2 days 6 hours ago
工作人员
加入:2018-02-08 11:03
Hi Ruchi Patel,

Hi Ruchi Patel,

As I am able to understand from your description, when the DA14580 is connected with a peer device, you don’t want to reset the application and not prevent the role switching? Did I understand correctly? If you mean that, you should add a flag into your application and if it is connected the chip should not reset, because the reset command is handled from the application level

Thanks, PM_Dialog

前腿帕特尔
Offline
Last seen:2 years 5 months ago
加入:2017-03-29 10:50
Hello PM_Dialog,

Hello PM_Dialog,

Thank you for the reply.

When device is performing role switching operation on time sharing basis, if the connection request comes from mobile Application(scanning device), device should not perform role switch or reset. It should connect to the mobile App and stay connected until disconnection request comes from mobile App. Once the device gets disconnected, again device should start performing role switch operation on time sharing basis. Is it possible to implement? If yes then please provide me the steps to perform so or is there any example which performs same operations.

Thank you in advance.

With Regards,
前腿帕特尔

PM_Dialog
Offline
Last seen:2 days 6 hours ago
工作人员
加入:2018-02-08 11:03
Hi Ruchi Patel,

Hi Ruchi Patel,

I suggest you to add a flag in order to check when the device is connected with a mobile phone or not. So, if it is connected (APP_CONNECTED), you should not perform role switch or reset. You are able to get the device state with the code sneppiet below:

if (ke_state_get(TASK_APP) == APP_CONNECTED)

When the device is disconnected, the user_app_disconnect() callback function will be trigger, in this function you should enable again the role switching functionality.

Thanks, PM_Dialog