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,
前腿帕特尔
Keywords:
Device:
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
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,
前腿帕特尔
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