1 /******************************************************************************
3 * Copyright (C) 1999-2012 Broadcom Corporation
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at:
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 ******************************************************************************/
19 /******************************************************************************
21 * This file contains the Bluetooth Manager (BTM) API function external
24 ******************************************************************************/
28 #include <base/callback_forward.h>
29 #include <hardware/bt_common_types.h>
31 #include "bt_common.h"
33 #include "btm_ble_api_types.h"
34 #include "osi/include/alarm.h"
36 /*****************************************************************************
37 * EXTERNAL FUNCTION DECLARATIONS
38 ****************************************************************************/
39 /*******************************************************************************
41 * Function BTM_SecAddBleDevice
43 * Description Add/modify device. This function will be normally called
44 * during host startup to restore all required information
45 * for a LE device stored in the NVRAM.
47 * Parameters: bd_addr - BD address of the peer
48 * bd_name - Name of the peer device. NULL if unknown.
49 * dev_type - Remote device's device type.
50 * addr_type - LE device address type.
52 * Returns true if added OK, else false
54 ******************************************************************************/
55 extern bool BTM_SecAddBleDevice(const RawAddress& bd_addr, BD_NAME bd_name,
56 tBT_DEVICE_TYPE dev_type,
57 tBLE_ADDR_TYPE addr_type);
59 /*******************************************************************************
61 * Function BTM_SecAddBleKey
63 * Description Add/modify LE device information. This function will be
64 * normally called during host startup to restore all required
65 * information stored in the NVRAM.
67 * Parameters: bd_addr - BD address of the peer
68 * p_le_key - LE key values.
69 * key_type - LE SMP key type.
71 * Returns true if added OK, else false
73 ******************************************************************************/
74 extern bool BTM_SecAddBleKey(const RawAddress& bd_addr,
75 tBTM_LE_KEY_VALUE* p_le_key,
76 tBTM_LE_KEY_TYPE key_type);
78 /*******************************************************************************
80 * Function BTM_BleSetAdvParams
82 * Description This function is called to set advertising parameters.
88 ******************************************************************************/
89 extern tBTM_STATUS BTM_BleSetAdvParams(uint16_t adv_int_min,
91 tBLE_BD_ADDR* p_dir_bda,
92 tBTM_BLE_ADV_CHNL_MAP chnl_map);
94 /*******************************************************************************
96 * Function BTM_BleObtainVendorCapabilities
98 * Description This function is called to obatin vendor capabilties
100 * Parameters p_cmn_vsc_cb - Returns the vednor capabilities
104 ******************************************************************************/
105 extern void BTM_BleObtainVendorCapabilities(tBTM_BLE_VSC_CB* p_cmn_vsc_cb);
108 * This function is called to set scan parameters. |cb| is called with operation
111 extern void BTM_BleSetScanParams(uint32_t scan_interval, uint32_t scan_window,
112 tBLE_SCAN_MODE scan_type,
113 base::Callback<void(uint8_t)> cb);
115 /*******************************************************************************
117 * Function BTM_BleGetVendorCapabilities
119 * Description This function reads local LE features
121 * Parameters p_cmn_vsc_cb : Locala LE capability structure
125 ******************************************************************************/
126 extern void BTM_BleGetVendorCapabilities(tBTM_BLE_VSC_CB* p_cmn_vsc_cb);
127 /*******************************************************************************
129 * Function BTM_BleSetStorageConfig
131 * Description This function is called to setup storage configuration and
134 * Parameters uint8_t batch_scan_full_max -Batch scan full maximum
135 uint8_t batch_scan_trunc_max - Batch scan truncated value
137 uint8_t batch_scan_notify_threshold - Threshold value
139 tBTM_BLE_SCAN_THRESHOLD_CBACK *p_thres_cback -Threshold
141 void *p_ref - Reference value
144 ******************************************************************************/
145 extern void BTM_BleSetStorageConfig(
146 uint8_t batch_scan_full_max, uint8_t batch_scan_trunc_max,
147 uint8_t batch_scan_notify_threshold,
148 base::Callback<void(uint8_t /* status */)> cb,
149 tBTM_BLE_SCAN_THRESHOLD_CBACK* p_thres_cback, tBTM_BLE_REF_VALUE ref_value);
151 /* This function is called to enable batch scan */
152 extern void BTM_BleEnableBatchScan(
153 tBTM_BLE_BATCH_SCAN_MODE scan_mode, uint32_t scan_interval,
154 uint32_t scan_window, tBTM_BLE_DISCARD_RULE discard_rule,
155 tBLE_ADDR_TYPE addr_type, base::Callback<void(uint8_t /* status */)> cb);
157 /* This function is called to disable batch scanning */
158 extern void BTM_BleDisableBatchScan(
159 base::Callback<void(uint8_t /* status */)> cb);
161 /* This function is called to read batch scan reports */
162 extern void BTM_BleReadScanReports(tBLE_SCAN_MODE scan_mode,
163 tBTM_BLE_SCAN_REP_CBACK cb);
165 /* This function is called to setup the callback for tracking */
166 extern void BTM_BleTrackAdvertiser(tBTM_BLE_TRACK_ADV_CBACK* p_track_cback,
167 tBTM_BLE_REF_VALUE ref_value);
169 /*******************************************************************************
171 * Function BTM_BleWriteScanRsp
173 * Description This function is called to write LE scan response.
175 * Parameters: p_scan_rsp: scan response.
179 ******************************************************************************/
180 extern void BTM_BleWriteScanRsp(uint8_t* data, uint8_t length,
181 tBTM_BLE_ADV_DATA_CMPL_CBACK* p_adv_data_cback);
183 /*******************************************************************************
185 * Function BTM_BleObserve
187 * Description This procedure keep the device listening for advertising
188 * events from a broadcast device.
190 * Parameters start: start or stop observe.
194 ******************************************************************************/
195 extern tBTM_STATUS BTM_BleObserve(bool start, uint8_t duration,
196 tBTM_INQ_RESULTS_CB* p_results_cb,
197 tBTM_CMPL_CB* p_cmpl_cb);
199 /*******************************************************************************
201 * Function BTM_GetDeviceIDRoot
203 * Description This function is called to read the local device identity
207 * the local device ER is copied into er
209 ******************************************************************************/
210 extern void BTM_GetDeviceIDRoot(BT_OCTET16 ir);
212 /*******************************************************************************
214 * Function BTM_GetDeviceEncRoot
216 * Description This function is called to read the local device encryption
220 * the local device ER is copied into er
222 ******************************************************************************/
223 extern void BTM_GetDeviceEncRoot(BT_OCTET16 er);
225 /*******************************************************************************
227 * Function BTM_GetDeviceDHK
229 * Description This function is called to read the local device DHK.
232 * the local device DHK is copied into dhk
234 ******************************************************************************/
235 extern void BTM_GetDeviceDHK(BT_OCTET16 dhk);
237 /*******************************************************************************
239 * Function BTM_SecurityGrant
241 * Description This function is called to grant security process.
243 * Parameters bd_addr - peer device bd address.
244 * res - result of the operation BTM_SUCCESS if success.
245 * Otherwise, BTM_REPEATED_ATTEMPTS is too many
250 ******************************************************************************/
251 extern void BTM_SecurityGrant(const RawAddress& bd_addr, uint8_t res);
253 /*******************************************************************************
255 * Function BTM_BlePasskeyReply
257 * Description This function is called after Security Manager submitted
258 * passkey request to the application.
260 * Parameters: bd_addr - Address of the device for which passkey was
262 * res - result of the operation SMP_SUCCESS if success
263 * passkey - numeric value in the range of
264 * BTM_MIN_PASSKEY_VAL(0) -
265 * BTM_MAX_PASSKEY_VAL(999999(0xF423F)).
267 ******************************************************************************/
268 extern void BTM_BlePasskeyReply(const RawAddress& bd_addr, uint8_t res,
271 /*******************************************************************************
273 * Function BTM_BleConfirmReply
275 * Description This function is called after Security Manager submitted
276 * numeric comparison request to the application.
278 * Parameters: bd_addr - Address of the device with which numeric
279 * comparison was requested
280 * res - comparison result BTM_SUCCESS if success
282 ******************************************************************************/
283 extern void BTM_BleConfirmReply(const RawAddress& bd_addr, uint8_t res);
285 /*******************************************************************************
287 * Function BTM_LeOobDataReply
289 * Description This function is called to provide the OOB data for
290 * SMP in response to BTM_LE_OOB_REQ_EVT
292 * Parameters: bd_addr - Address of the peer device
293 * res - result of the operation SMP_SUCCESS if success
294 * p_data - simple pairing Randomizer C.
296 ******************************************************************************/
297 extern void BTM_BleOobDataReply(const RawAddress& bd_addr, uint8_t res,
298 uint8_t len, uint8_t* p_data);
300 /*******************************************************************************
302 * Function BTM_BleSecureConnectionOobDataReply
304 * Description This function is called to provide the OOB data for
305 * SMP in response to BTM_LE_OOB_REQ_EVT when secure connection
308 * Parameters: bd_addr - Address of the peer device
309 * p_c - pointer to Confirmation
310 * p_r - pointer to Randomizer.
312 ******************************************************************************/
313 extern void BTM_BleSecureConnectionOobDataReply(const RawAddress& bd_addr,
314 uint8_t* p_c, uint8_t* p_r);
316 /*******************************************************************************
318 * Function BTM_BleDataSignature
320 * Description This function is called to sign the data using AES128 CMAC
323 * Parameter bd_addr: target device the data to be signed for.
324 * p_text: singing data
325 * len: length of the signing data
326 * signature: output parameter where data signature is going to
329 * Returns true if signing sucessul, otherwise false.
331 ******************************************************************************/
332 extern bool BTM_BleDataSignature(const RawAddress& bd_addr, uint8_t* p_text,
333 uint16_t len, BLE_SIGNATURE signature);
335 /*******************************************************************************
337 * Function BTM_BleVerifySignature
339 * Description This function is called to verify the data signature
341 * Parameter bd_addr: target device the data to be signed for.
342 * p_orig: original data before signature.
343 * len: length of the signing data
344 * counter: counter used when doing data signing
345 * p_comp: signature to be compared against.
347 * Returns true if signature verified correctly; otherwise false.
349 ******************************************************************************/
350 extern bool BTM_BleVerifySignature(const RawAddress& bd_addr, uint8_t* p_orig,
351 uint16_t len, uint32_t counter,
354 /*******************************************************************************
356 * Function BTM_ReadConnectionAddr
358 * Description Read the local device random address.
362 ******************************************************************************/
363 extern void BTM_ReadConnectionAddr(const RawAddress& remote_bda,
364 RawAddress& local_conn_addr,
365 tBLE_ADDR_TYPE* p_addr_type);
367 /*******************************************************************************
369 * Function BTM_IsBleConnection
371 * Description This function is called to check if the connection handle
374 * Returns true if connection is LE link, otherwise false.
376 ******************************************************************************/
377 extern bool BTM_IsBleConnection(uint16_t conn_handle);
379 /*******************************************************************************
381 * Function BTM_ReadRemoteConnectionAddr
383 * Description Read the remote device address currently used.
387 ******************************************************************************/
388 extern bool BTM_ReadRemoteConnectionAddr(const RawAddress& pseudo_addr,
389 RawAddress& conn_addr,
390 tBLE_ADDR_TYPE* p_addr_type);
392 /*******************************************************************************
394 * Function BTM_BleLoadLocalKeys
396 * Description Local local identity key, encryption root or sign counter.
398 * Parameters: key_type: type of key, can be BTM_BLE_KEY_TYPE_ID,
399 * BTM_BLE_KEY_TYPE_ER
400 * or BTM_BLE_KEY_TYPE_COUNTER.
401 * p_key: pointer to the key.
405 ******************************************************************************/
406 extern void BTM_BleLoadLocalKeys(uint8_t key_type, tBTM_BLE_LOCAL_KEYS* p_key);
409 * Set BLE connectable mode to auto connect
411 extern void BTM_BleStartAutoConn();
413 /*******************************************************************************
415 * Function BTM_BleUpdateBgConnDev
417 * Description This function is called to add or remove a device into/from
418 * background connection procedure. The background connection
419 * procedure is decided by the background connection type, it
421 * auto connection, or selective connection.
423 * Parameters add_remove: true to add; false to remove.
424 * remote_bda: device address to add/remove.
428 ******************************************************************************/
429 extern bool BTM_BleUpdateBgConnDev(bool add_remove,
430 const RawAddress& remote_bda);
432 /*******************************************************************************
434 * Function BTM_BleClearBgConnDev
436 * Description This function is called to clear the whitelist,
437 * end any pending whitelist connections,
438 * and reset the local bg device list.
444 ******************************************************************************/
445 extern void BTM_BleClearBgConnDev(void);
447 /********************************************************
449 * Function BTM_BleSetPrefConnParams
451 * Description Set a peripheral's preferred connection parameters. When
452 * any of the value does not want to be updated while others
453 * do, use BTM_BLE_CONN_PARAM_UNDEF for the ones want to
456 * Parameters: bd_addr - BD address of the peripheral
457 * min_conn_int - minimum preferred connection interval
458 * max_conn_int - maximum preferred connection interval
459 * slave_latency - preferred slave latency
460 * supervision_tout - preferred supervision timeout
464 ******************************************************************************/
465 extern void BTM_BleSetPrefConnParams(const RawAddress& bd_addr,
466 uint16_t min_conn_int,
467 uint16_t max_conn_int,
468 uint16_t slave_latency,
469 uint16_t supervision_tout);
471 /******************************************************************************
473 * Function BTM_BleSetConnScanParams
475 * Description Set scan parameters used in BLE connection request
477 * Parameters: scan_interval - scan interval
478 * scan_window - scan window
482 ******************************************************************************/
483 extern void BTM_BleSetConnScanParams(uint32_t scan_interval,
484 uint32_t scan_window);
486 /******************************************************************************
488 * Function BTM_BleReadControllerFeatures
490 * Description Reads BLE specific controller features
492 * Parameters: tBTM_BLE_CTRL_FEATURES_CBACK : Callback to notify when
497 ******************************************************************************/
498 extern void BTM_BleReadControllerFeatures(
499 tBTM_BLE_CTRL_FEATURES_CBACK* p_vsc_cback);
501 /*******************************************************************************
503 * Function BTM__BLEReadDiscoverability
505 * Description This function is called to read the current LE
506 * discoverability mode of the device.
508 * Returns BTM_BLE_NON_DISCOVERABLE ,BTM_BLE_LIMITED_DISCOVERABLE or
509 * BTM_BLE_GENRAL_DISCOVERABLE
511 ******************************************************************************/
512 uint16_t BTM_BleReadDiscoverability();
514 /*******************************************************************************
516 * Function BTM__BLEReadConnectability
518 * Description This function is called to read the current LE
519 * connectibility mode of the device.
521 * Returns BTM_BLE_NON_CONNECTABLE or BTM_BLE_CONNECTABLE
523 ******************************************************************************/
524 extern uint16_t BTM_BleReadConnectability();
526 /*******************************************************************************
528 * Function BTM_ReadDevInfo
530 * Description This function is called to read the device/address type
533 * Parameter remote_bda: remote device address
534 * p_dev_type: output parameter to read the device type.
535 * p_addr_type: output parameter to read the address type.
537 ******************************************************************************/
538 extern void BTM_ReadDevInfo(const RawAddress& remote_bda,
539 tBT_DEVICE_TYPE* p_dev_type,
540 tBLE_ADDR_TYPE* p_addr_type);
542 /*******************************************************************************
544 * Function BTM_ReadConnectedTransportAddress
546 * Description This function is called to read the paired device/address
547 * type of other device paired corresponding to the BD_address
549 * Parameter remote_bda: remote device address, carry out the transport
551 * transport: active transport
553 * Return true if an active link is identified; false otherwise
555 ******************************************************************************/
556 extern bool BTM_ReadConnectedTransportAddress(RawAddress* remote_bda,
557 tBT_TRANSPORT transport);
559 /*******************************************************************************
561 * Function BTM_BleConfigPrivacy
563 * Description This function is called to enable or disable the privacy in
566 * Parameters enable: true to enable it; false to disable it.
568 * Returns bool privacy mode set success; otherwise failed.
570 ******************************************************************************/
571 extern bool BTM_BleConfigPrivacy(bool enable);
573 /*******************************************************************************
575 * Function BTM_BleLocalPrivacyEnabled
577 * Description Checks if local device supports private address
579 * Returns Return true if local privacy is enabled else false
581 ******************************************************************************/
582 extern bool BTM_BleLocalPrivacyEnabled(void);
584 /*******************************************************************************
586 * Function BTM_BleEnableMixedPrivacyMode
588 * Description This function is called to enabled Mixed mode if privacy 1.2
589 * is applicable in controller.
591 * Parameters mixed_on: mixed mode to be used or not.
595 ******************************************************************************/
596 extern void BTM_BleEnableMixedPrivacyMode(bool mixed_on);
598 /*******************************************************************************
600 * Function BTM_BleMaxMultiAdvInstanceCount
602 * Description Returns the maximum number of multi adv instances supported
605 * Returns Max multi adv instance count
607 ******************************************************************************/
608 extern uint8_t BTM_BleMaxMultiAdvInstanceCount();
610 /*******************************************************************************
612 * Function BTM_BleSetConnectableMode
614 * Description This function is called to set BLE connectable mode for a
617 * Parameters connectable_mode: directed connectable mode, or
618 * non-directed. It can be
619 * BTM_BLE_CONNECT_EVT,
620 * BTM_BLE_CONNECT_DIR_EVT or
621 * BTM_BLE_CONNECT_LO_DUTY_DIR_EVT
623 * Returns BTM_ILLEGAL_VALUE if controller does not support BLE.
624 * BTM_SUCCESS is status set successfully; otherwise failure.
626 ******************************************************************************/
627 extern tBTM_STATUS BTM_BleSetConnectableMode(
628 tBTM_BLE_CONN_MODE connectable_mode);
630 /*******************************************************************************
632 * Function BTM_BleTurnOnPrivacyOnRemote
634 * Description This function is called to enable or disable the privacy on
637 * Parameters bd_addr: remote device address.
638 * privacy_on: true to enable it; false to disable it.
642 ******************************************************************************/
643 extern void BTM_BleTurnOnPrivacyOnRemote(const RawAddress& bd_addr,
646 /*******************************************************************************
648 * Function BTM_BleUpdateAdvFilterPolicy
650 * Description This function update the filter policy of advertiser.
652 * Parameter adv_policy: advertising filter policy
655 ******************************************************************************/
656 extern void BTM_BleUpdateAdvFilterPolicy(tBTM_BLE_AFP adv_policy);
658 /*******************************************************************************
660 * Function BTM_BleReceiverTest
662 * Description This function is called to start the LE Receiver test
664 * Parameter rx_freq - Frequency Range
665 * p_cmd_cmpl_cback - Command Complete callback
667 ******************************************************************************/
668 void BTM_BleReceiverTest(uint8_t rx_freq, tBTM_CMPL_CB* p_cmd_cmpl_cback);
670 /*******************************************************************************
672 * Function BTM_BleTransmitterTest
674 * Description This function is called to start the LE Transmitter test
676 * Parameter tx_freq - Frequency Range
677 * test_data_len - Length in bytes of payload data in each
679 * packet_payload - Pattern to use in the payload
680 * p_cmd_cmpl_cback - Command Complete callback
682 ******************************************************************************/
683 void BTM_BleTransmitterTest(uint8_t tx_freq, uint8_t test_data_len,
684 uint8_t packet_payload,
685 tBTM_CMPL_CB* p_cmd_cmpl_cback);
687 /*******************************************************************************
689 * Function BTM_BleTestEnd
691 * Description This function is called to stop the in-progress TX or RX test
693 * Parameter p_cmd_cmpl_cback - Command complete callback
695 ******************************************************************************/
696 void BTM_BleTestEnd(tBTM_CMPL_CB* p_cmd_cmpl_cback);
698 /*******************************************************************************
700 * Function BTM_UseLeLink
702 * Description Select the underlying physical link to use.
704 * Returns true to use LE, false use BR/EDR.
706 ******************************************************************************/
707 extern bool BTM_UseLeLink(const RawAddress& bd_addr);
709 /*******************************************************************************
711 * Function BTM_BleStackEnable
713 * Description Enable/Disable BLE functionality on stack regardless of
714 * controller capability.
716 * Parameters: enable: true to enable, false to disable.
718 * Returns true if added OK, else false
720 ******************************************************************************/
721 extern tBTM_STATUS BTM_BleStackEnable(bool enable);
723 /*******************************************************************************
725 * Function BTM_GetLeSecurityState
727 * Description This function is called to get security mode 1 flags and
728 * encryption key size for LE peer.
730 * Returns bool true if LE device is found, false otherwise.
732 ******************************************************************************/
733 extern bool BTM_GetLeSecurityState(const RawAddress& bd_addr,
734 uint8_t* p_le_dev_sec_flags,
735 uint8_t* p_le_key_size);
737 /*******************************************************************************
739 * Function BTM_BleSecurityProcedureIsRunning
741 * Description This function indicates if LE security procedure is
742 * currently running with the peer.
744 * Returns bool true if security procedure is running, false otherwise.
746 ******************************************************************************/
747 extern bool BTM_BleSecurityProcedureIsRunning(const RawAddress& bd_addr);
749 /*******************************************************************************
751 * Function BTM_BleGetSupportedKeySize
753 * Description This function gets the maximum encryption key size in bytes
754 * the local device can suport.
757 * Returns the key size or 0 if the size can't be retrieved.
759 ******************************************************************************/
760 extern uint8_t BTM_BleGetSupportedKeySize(const RawAddress& bd_addr);
762 /*******************************************************************************
764 * Function BTM_BleAdvFilterParamSetup
766 * Description This function is called to setup the adv data payload filter
769 ******************************************************************************/
770 extern void BTM_BleAdvFilterParamSetup(
771 int action, tBTM_BLE_PF_FILT_INDEX filt_index,
772 std::unique_ptr<btgatt_filt_param_setup_t> p_filt_params,
773 tBTM_BLE_PF_PARAM_CB cb);
776 * This functions are called to configure the adv data payload filter condition
778 extern void BTM_LE_PF_srvc_data(tBTM_BLE_SCAN_COND_OP action,
779 tBTM_BLE_PF_FILT_INDEX filt_index);
780 extern void BTM_LE_PF_addr_filter(tBTM_BLE_SCAN_COND_OP action,
781 tBTM_BLE_PF_FILT_INDEX filt_index,
782 tBLE_BD_ADDR addr, tBTM_BLE_PF_CFG_CBACK cb);
783 extern void BTM_LE_PF_local_name(tBTM_BLE_SCAN_COND_OP action,
784 tBTM_BLE_PF_FILT_INDEX filt_index,
785 std::vector<uint8_t> name,
786 tBTM_BLE_PF_CFG_CBACK cb);
787 extern void BTM_LE_PF_uuid_filter(tBTM_BLE_SCAN_COND_OP action,
788 tBTM_BLE_PF_FILT_INDEX filt_index,
789 tBTM_BLE_PF_COND_TYPE filter_type,
791 tBTM_BLE_PF_LOGIC_TYPE cond_logic,
792 tBTM_BLE_PF_COND_MASK* p_uuid_mask,
793 tBTM_BLE_PF_CFG_CBACK cb);
794 extern void BTM_LE_PF_manu_data(tBTM_BLE_SCAN_COND_OP action,
795 tBTM_BLE_PF_FILT_INDEX filt_index,
796 uint16_t company_id, uint16_t company_id_mask,
797 std::vector<uint8_t> data,
798 std::vector<uint8_t> data_mask,
799 tBTM_BLE_PF_CFG_CBACK cb);
800 extern void BTM_LE_PF_srvc_data_pattern(tBTM_BLE_SCAN_COND_OP action,
801 tBTM_BLE_PF_FILT_INDEX filt_index,
802 std::vector<uint8_t> data,
803 std::vector<uint8_t> data_mask,
804 tBTM_BLE_PF_CFG_CBACK cb);
805 extern void BTM_LE_PF_clear(tBTM_BLE_PF_FILT_INDEX filt_index,
806 tBTM_BLE_PF_CFG_CBACK cb);
808 /*******************************************************************************
810 * Function BTM_BleEnableDisableFilterFeature
812 * Description Enable or disable the APCF feature
814 * Parameters enable - true - enables APCF, false - disables APCF
816 ******************************************************************************/
817 extern void BTM_BleEnableDisableFilterFeature(
818 uint8_t enable, tBTM_BLE_PF_STATUS_CBACK p_stat_cback);
820 /*******************************************************************************
822 * Function BTM_BleGetEnergyInfo
824 * Description This function obtains the energy info
826 * Parameters p_ener_cback - Callback pointer
830 ******************************************************************************/
831 extern tBTM_STATUS BTM_BleGetEnergyInfo(
832 tBTM_BLE_ENERGY_INFO_CBACK* p_ener_cback);
834 /*******************************************************************************
836 * Function BTM_SetBleDataLength
838 * Description Set the maximum BLE transmission packet size
840 * Returns BTM_SUCCESS if success; otherwise failed.
842 ******************************************************************************/
843 extern tBTM_STATUS BTM_SetBleDataLength(const RawAddress& bd_addr,
844 uint16_t tx_pdu_length);
846 /*******************************************************************************
848 * Function BTM_BleReadPhy
850 * Description To read the current PHYs for specified LE connection
853 * Returns BTM_SUCCESS if success; otherwise failed.
855 ******************************************************************************/
856 extern void BTM_BleReadPhy(
857 const RawAddress& bd_addr,
858 base::Callback<void(uint8_t tx_phy, uint8_t rx_phy, uint8_t status)> cb);
860 /*******************************************************************************
862 * Function BTM_BleSetDefaultPhy
864 * Description To set preferred PHY for ensuing LE connections
867 * Returns BTM_SUCCESS if success; otherwise failed.
869 ******************************************************************************/
870 extern tBTM_STATUS BTM_BleSetDefaultPhy(uint8_t all_phys, uint8_t tx_phys,
873 /*******************************************************************************
875 * Function BTM_BleSetPhy
877 * Description To set PHY preferences for specified LE connection
880 * Returns BTM_SUCCESS if success; otherwise failed.
882 ******************************************************************************/
883 extern void BTM_BleSetPhy(const RawAddress& bd_addr, uint8_t tx_phys,
884 uint8_t rx_phys, uint16_t phy_options);
886 extern void btm_ble_multi_adv_cleanup(void);