hci.c (bec5f683aa4d2d684ac9691bb08cc633b980d86f) hci.c (d821984b1fab162518a40694abf09b245c441031)
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 2480 unchanged lines hidden (view full) ---

2489 if (!packet[2]){
2490 conn->state = OPEN;
2491 conn->con_handle = little_endian_read_16(packet, 3);
2492
2493 // queue get remote feature
2494 conn->bonding_flags |= BONDING_REQUEST_REMOTE_FEATURES_PAGE_0;
2495
2496 // queue set supervision timeout if we're master
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 2480 unchanged lines hidden (view full) ---

2489 if (!packet[2]){
2490 conn->state = OPEN;
2491 conn->con_handle = little_endian_read_16(packet, 3);
2492
2493 // queue get remote feature
2494 conn->bonding_flags |= BONDING_REQUEST_REMOTE_FEATURES_PAGE_0;
2495
2496 // queue set supervision timeout if we're master
2497 if ((hci_stack->link_supervision_timeout != 0) && (conn->role == HCI_ROLE_MASTER)){
2497 if ((hci_stack->link_supervision_timeout != HCI_LINK_SUPERVISION_TIMEOUT_DEFAULT) && (conn->role == HCI_ROLE_MASTER)){
2498 connectionSetAuthenticationFlags(conn, WRITE_SUPERVISION_TIMEOUT);
2499 }
2500
2501 // restart timer
2502 btstack_run_loop_set_timer(&conn->timeout, HCI_CONNECTION_TIMEOUT_MS);
2503 btstack_run_loop_add_timer(&conn->timeout);
2504
2505 log_info("New connection: handle %u, %s", conn->con_handle, bd_addr_to_str(conn->address));

--- 704 unchanged lines hidden (view full) ---

3210 // Allow Role Switch
3211 hci_stack->allow_role_switch = 1;
3212
3213 // Default / minimum security level = 2
3214 hci_stack->gap_security_level = LEVEL_2;
3215
3216 // Errata-11838 mandates 7 bytes for GAP Security Level 1-3
3217 hci_stack->gap_required_encyrption_key_size = 7;
2498 connectionSetAuthenticationFlags(conn, WRITE_SUPERVISION_TIMEOUT);
2499 }
2500
2501 // restart timer
2502 btstack_run_loop_set_timer(&conn->timeout, HCI_CONNECTION_TIMEOUT_MS);
2503 btstack_run_loop_add_timer(&conn->timeout);
2504
2505 log_info("New connection: handle %u, %s", conn->con_handle, bd_addr_to_str(conn->address));

--- 704 unchanged lines hidden (view full) ---

3210 // Allow Role Switch
3211 hci_stack->allow_role_switch = 1;
3212
3213 // Default / minimum security level = 2
3214 hci_stack->gap_security_level = LEVEL_2;
3215
3216 // Errata-11838 mandates 7 bytes for GAP Security Level 1-3
3217 hci_stack->gap_required_encyrption_key_size = 7;
3218
3219 // Link Supervision Timeout
3220 hci_stack->link_supervision_timeout = HCI_LINK_SUPERVISION_TIMEOUT_DEFAULT;
3221
3218#endif
3219
3220 // Secure Simple Pairing default: enable, no I/O capabilities, general bonding, mitm not required, auto accept
3221 hci_stack->ssp_enable = 1;
3222 hci_stack->ssp_io_capability = SSP_IO_CAPABILITY_NO_INPUT_NO_OUTPUT;
3223 hci_stack->ssp_authentication_requirement = SSP_IO_AUTHREQ_MITM_PROTECTION_NOT_REQUIRED_GENERAL_BONDING;
3224 hci_stack->ssp_auto_accept = 1;
3225

--- 3255 unchanged lines hidden ---
3222#endif
3223
3224 // Secure Simple Pairing default: enable, no I/O capabilities, general bonding, mitm not required, auto accept
3225 hci_stack->ssp_enable = 1;
3226 hci_stack->ssp_io_capability = SSP_IO_CAPABILITY_NO_INPUT_NO_OUTPUT;
3227 hci_stack->ssp_authentication_requirement = SSP_IO_AUTHREQ_MITM_PROTECTION_NOT_REQUIRED_GENERAL_BONDING;
3228 hci_stack->ssp_auto_accept = 1;
3229

--- 3255 unchanged lines hidden ---