hci.c (5ccef624bd0f1bfd6e0b9f372687d6d498dfbf1f) hci.c (67aae55197b5e3d998f4beab1abae10c98495871)
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

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

128
129
130// prototypes
131#ifdef ENABLE_CLASSIC
132static void hci_update_scan_enable(void);
133static void hci_emit_discoverable_enabled(uint8_t enabled);
134static int hci_local_ssp_activated(void);
135static int hci_remote_ssp_supported(hci_con_handle_t con_handle);
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

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

128
129
130// prototypes
131#ifdef ENABLE_CLASSIC
132static void hci_update_scan_enable(void);
133static void hci_emit_discoverable_enabled(uint8_t enabled);
134static int hci_local_ssp_activated(void);
135static int hci_remote_ssp_supported(hci_con_handle_t con_handle);
136static bool hci_ssp_supported(hci_connection_t * connection);
136static void hci_notify_if_sco_can_send_now(void);
137static void hci_emit_connection_complete(bd_addr_t address, hci_con_handle_t con_handle, uint8_t status);
138static gap_security_level_t gap_security_level_for_connection(hci_connection_t * connection);
139static void hci_emit_security_level(hci_con_handle_t con_handle, gap_security_level_t level);
140static void hci_connection_timeout_handler(btstack_timer_source_t *timer);
141static void hci_connection_timestamp(hci_connection_t *connection);
142static void hci_emit_l2cap_check_timeout(hci_connection_t *conn);
143static void gap_inquiry_explode(uint8_t *packet, uint16_t size);

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

4564
4565// query if remote side supports eSCO
4566int hci_remote_esco_supported(hci_con_handle_t con_handle){
4567 hci_connection_t * connection = hci_connection_for_handle(con_handle);
4568 if (!connection) return 0;
4569 return (connection->remote_supported_features[0] & 1) != 0;
4570}
4571
137static void hci_notify_if_sco_can_send_now(void);
138static void hci_emit_connection_complete(bd_addr_t address, hci_con_handle_t con_handle, uint8_t status);
139static gap_security_level_t gap_security_level_for_connection(hci_connection_t * connection);
140static void hci_emit_security_level(hci_con_handle_t con_handle, gap_security_level_t level);
141static void hci_connection_timeout_handler(btstack_timer_source_t *timer);
142static void hci_connection_timestamp(hci_connection_t *connection);
143static void hci_emit_l2cap_check_timeout(hci_connection_t *conn);
144static void gap_inquiry_explode(uint8_t *packet, uint16_t size);

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

4565
4566// query if remote side supports eSCO
4567int hci_remote_esco_supported(hci_con_handle_t con_handle){
4568 hci_connection_t * connection = hci_connection_for_handle(con_handle);
4569 if (!connection) return 0;
4570 return (connection->remote_supported_features[0] & 1) != 0;
4571}
4572
4573static bool hci_ssp_supported(hci_connection_t * connection){
4574 const uint8_t mask = BONDING_REMOTE_SUPPORTS_SSP_CONTROLLER | BONDING_REMOTE_SUPPORTS_SSP_HOST;
4575 return (connection->bonding_flags & mask) == mask;
4576}
4577
4572// query if remote side supports SSP
4573int hci_remote_ssp_supported(hci_con_handle_t con_handle){
4574 hci_connection_t * connection = hci_connection_for_handle(con_handle);
4575 if (!connection) return 0;
4578// query if remote side supports SSP
4579int hci_remote_ssp_supported(hci_con_handle_t con_handle){
4580 hci_connection_t * connection = hci_connection_for_handle(con_handle);
4581 if (!connection) return 0;
4576 return (connection->bonding_flags & BONDING_REMOTE_SUPPORTS_SSP_CONTROLLER) ? 1 : 0;
4582 return hci_ssp_supported(connection) ? 1 : 0;
4577}
4578
4579int gap_ssp_supported_on_both_sides(hci_con_handle_t handle){
4580 return hci_local_ssp_activated() && hci_remote_ssp_supported(handle);
4581}
4582
4583// GAP API
4584/**

--- 996 unchanged lines hidden ---
4583}
4584
4585int gap_ssp_supported_on_both_sides(hci_con_handle_t handle){
4586 return hci_local_ssp_activated() && hci_remote_ssp_supported(handle);
4587}
4588
4589// GAP API
4590/**

--- 996 unchanged lines hidden ---