This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to avoid the Not expected connect?

image description

Parents Reply Children
  • I have read it. I think that, Let the master use public address, and when the slave receive the data, I use a button trig the program, and let the slave remember the public key, and add the address to the whitelisting. I think this is the only method to solve the question. But, I can not know this is the only correct. and I want to know that whether somebody have betters.

  • Yes, it's the most common solution (note: there is nothing called public key unless you are talking about LESecure connection).

    Another solution is to let the application disconnect the connection if the central device can't provide correct "password". For example, the central must write to a characteristic a "code" in the first 30 seconds after connected or it will be disconnected. But this is not very common only used when whitelisting can't be used.

Related