From 414eb680d1c1e192ea910cfa0c4590e708948873 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Sat, 7 Dec 2019 21:31:08 +0100 Subject: [PATCH] example/sm_pairing_peripheral: disable security request on connection complete --- example/sm_pairing_peripheral.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/example/sm_pairing_peripheral.c b/example/sm_pairing_peripheral.c index ad9ffc1d6..0aa815daa 100644 --- a/example/sm_pairing_peripheral.c +++ b/example/sm_pairing_peripheral.c @@ -155,18 +155,21 @@ static void sm_peripheral_setup(void){ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){ UNUSED(channel); UNUSED(size); + hci_con_handle_t con_handle; bd_addr_t addr; + switch (packet_type) { case HCI_EVENT_PACKET: switch (hci_event_packet_get_type(packet)) { case HCI_EVENT_LE_META: switch (hci_event_le_meta_get_subevent_code(packet)) { case HCI_SUBEVENT_LE_CONNECTION_COMPLETE: - // setup new - printf("Connection complete\n"); - con_handle = hci_subevent_le_connection_complete_get_connection_handle(packet); - sm_send_security_request(con_handle); + printf("Connection complete\n"); + // Uncomment the next lines to trigger explicit pairing on connect + // con_handle = hci_subevent_le_connection_complete_get_connection_handle(packet); + // sm_send_security_request(con_handle); + UNUSED(con_handle); break; default: break;