How I get the passkey value??

Hello.

I would like to receive the passkey value that the user entered when pairing Bluetooth and modify it.

Originally, it was said that if you enter "0000", you have to enter 6 digits according to the regulations to enable Bluetooth pairing.

So if I type "0000" I want to add "00" and make it "000000".

But I'm still a beginner, so I'd like to know where I can get the value and modify it.

You want to modify passkey and use it in the function below that you want to compare with static_passkey.

Parents
  • Hello,

    I am not sure this request is possible.

    The passkey is either generated during BLE pairing by the device that have a display device, or it must be specified prior to BLE pairing as a static passkey by the device that claim it has a display. The passkey must be 6 digit long. It's not transferred in clear text in any way, though I guess it's possible to also write the 6 digit value to a characteristic, which the peer device can read during connection before pairing, but it's a odd implementation, and in terms of security I don't see this as a good solution.

    Kenneth

  • Oh.

    Thank you the answer, Kenneth.

    I understand your answer.

    It is related to terms of security.

    I'd like to see the official document of bluetooth and android on the passkey 6-digit limit, is it possible??

Reply Children
Related