hci.c (532454f96dc583da553adc4f3e6b006a1f85ec34) hci.c (137715ebdabcc85ab872119f87126c47f631daaa)
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

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

3407#ifdef ENABLE_CLASSIC
3408void gap_set_required_encryption_key_size(uint8_t encryption_key_size){
3409 // validate ranage and set
3410 if (encryption_key_size < 7) return;
3411 if (encryption_key_size > 16) return;
3412 hci_stack->gap_required_encyrption_key_size = encryption_key_size;
3413}
3414
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

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

3407#ifdef ENABLE_CLASSIC
3408void gap_set_required_encryption_key_size(uint8_t encryption_key_size){
3409 // validate ranage and set
3410 if (encryption_key_size < 7) return;
3411 if (encryption_key_size > 16) return;
3412 hci_stack->gap_required_encyrption_key_size = encryption_key_size;
3413}
3414
3415void gap_set_security_mode(gap_security_mode_t security_mode){
3416 btstack_assert((security_mode == GAP_SECURITY_MODE_4) || (security_mode == GAP_SECURITY_MODE_2));
3417 hci_stack->gap_security_mode = security_mode;
3415uint8_t gap_set_security_mode(gap_security_mode_t security_mode){
3416 if ((security_mode == GAP_SECURITY_MODE_4) || (security_mode == GAP_SECURITY_MODE_2)){
3417 hci_stack->gap_security_mode = security_mode;
3418 return ERROR_CODE_SUCCESS;
3419 } else {
3420 return ERROR_CODE_UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE;
3421 }
3418}
3419
3420gap_security_mode_t gap_get_security_mode(void){
3421 return hci_stack->gap_security_mode;
3422}
3423
3424void gap_set_security_level(gap_security_level_t security_level){
3425 hci_stack->gap_security_level = security_level;

--- 3225 unchanged lines hidden ---
3422}
3423
3424gap_security_mode_t gap_get_security_mode(void){
3425 return hci_stack->gap_security_mode;
3426}
3427
3428void gap_set_security_level(gap_security_level_t security_level){
3429 hci_stack->gap_security_level = security_level;

--- 3225 unchanged lines hidden ---