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

What are the purpose of the keypress and lesc function in Peer Manager?

I try to add function for the peer manager initialization and set the security parameters. I did not understand keypress and lesc parameters exactly. Documentation says for keypress;

  • Enable generation of keypress notifications.

Also documentation says for lesc;

  • Enable LE Secure Connection pairing.

But what does it mean? I can not understand. Is there anyone who can explain it?

  • LE Secure Connections (LESC) what added in Bluetooth core specification 4.2.

    It is a pairing alternative that provides protection again eavesdropping and MITM attacks.

    It uses an Elliptic Curve Diffie-Hellman (ECDH) key agreement to derive encryption keys.

    Keypress notification can be used when doing LESC Passkey Entry, it is used to inform the remote device when keys have been entered or erased.

    The peer with the keyboard send them with sd_ble_gap_keypress_notify(), and the peer with the display receives BLE_GAP_EVT_KEY_PRESSED events.

    If you don't support LESC, set the LESC bit to 0. If you don't support keypress notifications set the keypress bit to 0.

Related