mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-18 14:42:33 +00:00
example/sm_pairing_peripheral: disable security request on connection complete
This commit is contained in:
parent
fa485b2b3f
commit
414eb680d1
@ -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){
|
static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
|
||||||
UNUSED(channel);
|
UNUSED(channel);
|
||||||
UNUSED(size);
|
UNUSED(size);
|
||||||
|
|
||||||
hci_con_handle_t con_handle;
|
hci_con_handle_t con_handle;
|
||||||
bd_addr_t addr;
|
bd_addr_t addr;
|
||||||
|
|
||||||
switch (packet_type) {
|
switch (packet_type) {
|
||||||
case HCI_EVENT_PACKET:
|
case HCI_EVENT_PACKET:
|
||||||
switch (hci_event_packet_get_type(packet)) {
|
switch (hci_event_packet_get_type(packet)) {
|
||||||
case HCI_EVENT_LE_META:
|
case HCI_EVENT_LE_META:
|
||||||
switch (hci_event_le_meta_get_subevent_code(packet)) {
|
switch (hci_event_le_meta_get_subevent_code(packet)) {
|
||||||
case HCI_SUBEVENT_LE_CONNECTION_COMPLETE:
|
case HCI_SUBEVENT_LE_CONNECTION_COMPLETE:
|
||||||
// setup new
|
printf("Connection complete\n");
|
||||||
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);
|
// con_handle = hci_subevent_le_connection_complete_get_connection_handle(packet);
|
||||||
sm_send_security_request(con_handle);
|
// sm_send_security_request(con_handle);
|
||||||
|
UNUSED(con_handle);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user