hfp_hf.c (75389f8089b080200d19a1dbd259000c4baeffa9) hfp_hf.c (14685fd34e1d9c03d6edf1ba145834f8da556f35)
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

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

1962 return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
1963 }
1964
1965 hfp_connection->hf_deactivate_calling_line_notification = 1;
1966 hfp_hf_run_for_context(hfp_connection);
1967 return ERROR_CODE_SUCCESS;
1968}
1969
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

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

1962 return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
1963 }
1964
1965 hfp_connection->hf_deactivate_calling_line_notification = 1;
1966 hfp_hf_run_for_context(hfp_connection);
1967 return ERROR_CODE_SUCCESS;
1968}
1969
1970static bool hfp_hf_echo_canceling_and_noise_reduction_supported(hfp_connection_t * hfp_connection){
1971 int ag = get_bit(hfp_connection->remote_supported_features, HFP_AGSF_EC_NR_FUNCTION);
1972 int hf = get_bit(hfp_hf_supported_features, HFP_HFSF_EC_NR_FUNCTION);
1973 return hf && ag;
1974}
1975
1976uint8_t hfp_hf_deactivate_echo_canceling_and_noise_reduction(hci_con_handle_t acl_handle){
1977 hfp_connection_t * hfp_connection = get_hfp_hf_connection_context_for_acl_handle(acl_handle);
1978 if (!hfp_connection) {
1979 return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
1980 }
1970uint8_t hfp_hf_deactivate_echo_canceling_and_noise_reduction(hci_con_handle_t acl_handle){
1971 hfp_connection_t * hfp_connection = get_hfp_hf_connection_context_for_acl_handle(acl_handle);
1972 if (!hfp_connection) {
1973 return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
1974 }
1981 if (!hfp_hf_echo_canceling_and_noise_reduction_supported(hfp_connection)){
1975 if (get_bit(hfp_connection->remote_supported_features, HFP_AGSF_EC_NR_FUNCTION) == 0){
1982 return ERROR_CODE_COMMAND_DISALLOWED;
1983 }
1984
1985 hfp_connection->hf_deactivate_echo_canceling_and_noise_reduction = 1;
1986 hfp_hf_run_for_context(hfp_connection);
1987 return ERROR_CODE_SUCCESS;
1988}
1989

--- 352 unchanged lines hidden ---
1976 return ERROR_CODE_COMMAND_DISALLOWED;
1977 }
1978
1979 hfp_connection->hf_deactivate_echo_canceling_and_noise_reduction = 1;
1980 hfp_hf_run_for_context(hfp_connection);
1981 return ERROR_CODE_SUCCESS;
1982}
1983

--- 352 unchanged lines hidden ---