Hello Mario,
thank you for response.
To be honest, i did an error. Now i explain better the issue:
i wrote an assignment of one flag for my code in callback function BleApp_ConnectionCallback to be able to recognize when the device is or not connected. Maybe this is not a good solution because now i'm watching that this function is triggered even if i switch on/off other device but BEFORE a connection with a smartphone. I don't know if this is correct because the two devices are with different BD_ADDR and shortened name.
Moreover when i switch on the second device, the first stop his advertising so i can't see it in the app, i can see only the second device.
In the last post i wrote that it cause a disconnection from the smartphone but it was only an impression for my inattention because this mechanism occur only when the devices are disconnected from any smartphone.
When connection with smartphone is established the callback function is only executed when really occur a disconnection from the phone.
However now i need to use other flags or mechanism to recognize when my peripheral is or not connected/disconnected. Can you suggest me a way?
How can i see more devices into my app?
Thank you
Marco