hci.c (dc8d5bd34eb734990de3d8b50558b887f895843c) | hci.c (278ff8a910061d6697d57f96d145e4ac8ac1b587) |
---|---|
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 --- 199 unchanged lines hidden (view full) --- 208 conn->address_type = addr_type; 209 conn->con_handle = 0xffff; 210 conn->authentication_flags = AUTH_FLAGS_NONE; 211 conn->bonding_flags = 0; 212 conn->requested_security_level = LEVEL_0; 213#ifdef ENABLE_CLASSIC 214 conn->request_role = HCI_ROLE_INVALID; 215 conn->sniff_subrating_max_latency = 0xffff; | 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 --- 199 unchanged lines hidden (view full) --- 208 conn->address_type = addr_type; 209 conn->con_handle = 0xffff; 210 conn->authentication_flags = AUTH_FLAGS_NONE; 211 conn->bonding_flags = 0; 212 conn->requested_security_level = LEVEL_0; 213#ifdef ENABLE_CLASSIC 214 conn->request_role = HCI_ROLE_INVALID; 215 conn->sniff_subrating_max_latency = 0xffff; |
216 conn->qos_service_type = HCI_SERVICE_TyPE_INVALID; |
|
216 btstack_run_loop_set_timer_handler(&conn->timeout, hci_connection_timeout_handler); 217 btstack_run_loop_set_timer_context(&conn->timeout, conn); 218 hci_connection_timestamp(conn); 219#endif 220 conn->acl_recombination_length = 0; 221 conn->acl_recombination_pos = 0; 222 conn->num_packets_sent = 0; 223 --- 4272 unchanged lines hidden (view full) --- 4496 4497 if (connection->sniff_subrating_max_latency != 0xffff){ 4498 uint16_t max_latency = connection->sniff_subrating_max_latency; 4499 connection->sniff_subrating_max_latency = 0; 4500 hci_send_cmd(&hci_sniff_subrating, connection->con_handle, max_latency, connection->sniff_subrating_min_remote_timeout, connection->sniff_subrating_min_local_timeout); 4501 return true; 4502 } 4503 | 217 btstack_run_loop_set_timer_handler(&conn->timeout, hci_connection_timeout_handler); 218 btstack_run_loop_set_timer_context(&conn->timeout, conn); 219 hci_connection_timestamp(conn); 220#endif 221 conn->acl_recombination_length = 0; 222 conn->acl_recombination_pos = 0; 223 conn->num_packets_sent = 0; 224 --- 4272 unchanged lines hidden (view full) --- 4497 4498 if (connection->sniff_subrating_max_latency != 0xffff){ 4499 uint16_t max_latency = connection->sniff_subrating_max_latency; 4500 connection->sniff_subrating_max_latency = 0; 4501 hci_send_cmd(&hci_sniff_subrating, connection->con_handle, max_latency, connection->sniff_subrating_min_remote_timeout, connection->sniff_subrating_min_local_timeout); 4502 return true; 4503 } 4504 |
4505 if (connection->qos_service_type != HCI_SERVICE_TyPE_INVALID){ 4506 uint8_t service_type = (uint8_t) connection->qos_service_type; 4507 connection->qos_service_type = HCI_SERVICE_TyPE_INVALID; 4508 hci_send_cmd(&hci_qos_setup, connection->con_handle, 0, service_type, connection->qos_token_rate, connection->qos_peak_bandwidth, connection->qos_latency, connection->qos_delay_variation); 4509 return true; 4510 } 4511 |
|
4504 if (connection->request_role != HCI_ROLE_INVALID){ 4505 hci_role_t role = connection->request_role; 4506 connection->request_role = HCI_ROLE_INVALID; 4507 hci_send_cmd(&hci_switch_role_command, connection->address, role); 4508 return true; 4509 } 4510#endif 4511 --- 1858 unchanged lines hidden (view full) --- 6370 if (!conn) return GAP_CONNECTION_INVALID; 6371 conn->sniff_subrating_max_latency = max_latency; 6372 conn->sniff_subrating_min_remote_timeout = min_remote_timeout; 6373 conn->sniff_subrating_min_local_timeout = min_local_timeout; 6374 hci_run(); 6375 return ERROR_CODE_SUCCESS; 6376} 6377 | 4512 if (connection->request_role != HCI_ROLE_INVALID){ 4513 hci_role_t role = connection->request_role; 4514 connection->request_role = HCI_ROLE_INVALID; 4515 hci_send_cmd(&hci_switch_role_command, connection->address, role); 4516 return true; 4517 } 4518#endif 4519 --- 1858 unchanged lines hidden (view full) --- 6378 if (!conn) return GAP_CONNECTION_INVALID; 6379 conn->sniff_subrating_max_latency = max_latency; 6380 conn->sniff_subrating_min_remote_timeout = min_remote_timeout; 6381 conn->sniff_subrating_min_local_timeout = min_local_timeout; 6382 hci_run(); 6383 return ERROR_CODE_SUCCESS; 6384} 6385 |
6386uint8_t gap_qos_set(hci_con_handle_t con_handle, hci_service_type_t service_type, uint32_t token_rate, uint32_t peak_bandwidth, uint32_t latency, uint32_t delay_variation){ 6387 hci_connection_t * conn = hci_connection_for_handle(con_handle); 6388 if (!conn) return GAP_CONNECTION_INVALID; 6389 conn->qos_service_type = service_type; 6390 conn->qos_token_rate = token_rate; 6391 conn->qos_peak_bandwidth = peak_bandwidth; 6392 conn->qos_latency = latency; 6393 conn->qos_delay_variation = delay_variation; 6394 hci_run(); 6395 return ERROR_CODE_SUCCESS; 6396} 6397 |
|
6378void gap_set_page_scan_activity(uint16_t page_scan_interval, uint16_t page_scan_window){ 6379 hci_stack->new_page_scan_interval = page_scan_interval; 6380 hci_stack->new_page_scan_window = page_scan_window; 6381 hci_run(); 6382} 6383 6384void gap_set_page_scan_type(page_scan_type_t page_scan_type){ 6385 hci_stack->new_page_scan_type = (uint8_t) page_scan_type; --- 120 unchanged lines hidden --- | 6398void gap_set_page_scan_activity(uint16_t page_scan_interval, uint16_t page_scan_window){ 6399 hci_stack->new_page_scan_interval = page_scan_interval; 6400 hci_stack->new_page_scan_window = page_scan_window; 6401 hci_run(); 6402} 6403 6404void gap_set_page_scan_type(page_scan_type_t page_scan_type){ 6405 hci_stack->new_page_scan_type = (uint8_t) page_scan_type; --- 120 unchanged lines hidden --- |