hci.c (593702caaed6af09221cbdb630d3976f5de453a1) | hci.c (78315a58573f370dd679856042aa32fba14bc84a) |
---|---|
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 --- 2872 unchanged lines hidden (view full) --- 2881 hci_stack->local_name = default_classic_name; 2882 2883 // Master slave policy 2884 hci_stack->master_slave_policy = 1; 2885 2886 // Allow Role Switch 2887 hci_stack->allow_role_switch = 1; 2888 | 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 --- 2872 unchanged lines hidden (view full) --- 2881 hci_stack->local_name = default_classic_name; 2882 2883 // Master slave policy 2884 hci_stack->master_slave_policy = 1; 2885 2886 // Allow Role Switch 2887 hci_stack->allow_role_switch = 1; 2888 |
2889 // Default / minimum security level = 2 2890 hci_stack->gap_security_level = LEVEL_2; 2891 |
|
2889 // Errata-11838 mandates 7 bytes for GAP Security Level 1-3, we use 16 as default 2890 hci_stack->gap_required_encyrption_key_size = 16; 2891#endif 2892 2893 // Secure Simple Pairing default: enable, no I/O capabilities, general bonding, mitm not required, auto accept 2894 hci_stack->ssp_enable = 1; 2895 hci_stack->ssp_io_capability = SSP_IO_CAPABILITY_NO_INPUT_NO_OUTPUT; 2896 hci_stack->ssp_authentication_requirement = SSP_IO_AUTHREQ_MITM_PROTECTION_NOT_REQUIRED_GENERAL_BONDING; --- 80 unchanged lines hidden (view full) --- 2977 2978#ifdef ENABLE_CLASSIC 2979void gap_set_required_encryption_key_size(uint8_t encryption_key_size){ 2980 // validate ranage and set 2981 if (encryption_key_size < 7) return; 2982 if (encryption_key_size > 16) return; 2983 hci_stack->gap_required_encyrption_key_size = encryption_key_size; 2984} | 2892 // Errata-11838 mandates 7 bytes for GAP Security Level 1-3, we use 16 as default 2893 hci_stack->gap_required_encyrption_key_size = 16; 2894#endif 2895 2896 // Secure Simple Pairing default: enable, no I/O capabilities, general bonding, mitm not required, auto accept 2897 hci_stack->ssp_enable = 1; 2898 hci_stack->ssp_io_capability = SSP_IO_CAPABILITY_NO_INPUT_NO_OUTPUT; 2899 hci_stack->ssp_authentication_requirement = SSP_IO_AUTHREQ_MITM_PROTECTION_NOT_REQUIRED_GENERAL_BONDING; --- 80 unchanged lines hidden (view full) --- 2980 2981#ifdef ENABLE_CLASSIC 2982void gap_set_required_encryption_key_size(uint8_t encryption_key_size){ 2983 // validate ranage and set 2984 if (encryption_key_size < 7) return; 2985 if (encryption_key_size > 16) return; 2986 hci_stack->gap_required_encyrption_key_size = encryption_key_size; 2987} |
2988 2989void gap_set_security_level(gap_security_level_t security_level){ 2990 hci_stack->gap_security_level = security_level; 2991} 2992 2993gap_security_level_t gap_get_security_level(void){ 2994 return hci_stack->gap_security_level; 2995} |
|
2985#endif 2986 2987#ifdef ENABLE_CLASSIC 2988void gap_set_class_of_device(uint32_t class_of_device){ 2989 hci_stack->class_of_device = class_of_device; 2990} 2991 2992void gap_set_default_link_policy_settings(uint16_t default_link_policy_settings){ --- 2508 unchanged lines hidden --- | 2996#endif 2997 2998#ifdef ENABLE_CLASSIC 2999void gap_set_class_of_device(uint32_t class_of_device){ 3000 hci_stack->class_of_device = class_of_device; 3001} 3002 3003void gap_set_default_link_policy_settings(uint16_t default_link_policy_settings){ --- 2508 unchanged lines hidden --- |