Is there a way to disconnect a ble connection from server?

frank zhang 121 Reputation points
2022-05-21T01:14:33.013+00:00

After setting service/characteristics and do serviceProvider.StartAdvertising(), then ble client connect the server. How can server do disconnect to a client ? I did't find any api in Docs.

In a word, what I want is the method for server to:

  1. disconnect a connection from a single client, the service is still available and can be connected, and other client's connection is still work.
  2. disconnect all client connection, and the service is not avaliable. (seems serviceProvider.StopAdvertising() useful, but after I tried, the client did not get disconnect event?)
    Thanks.
Universal Windows Platform (UWP)
{count} votes

Accepted answer
  1. Nico Zhu (Shanghai Wicresoft Co,.Ltd.) 12,851 Reputation points
    2022-05-25T02:05:02.673+00:00

    Hello,
    Welcome to Microsoft Q&A!

    Is there a way to disconnect a ble connection from server?

    There is no explicit API to disconnect a client. Closing all references to it would help if the system is in central role (i.e. initiated the connection). If the system is in peripheral role (client side initiated) then the disconnect needs to be initiated by the client side.

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful