1. Whitelist mechanism
White list is the simplest and most straightforward security mechanism in the BLE protocol.
The so-called whitelist is a group of Bluetooth addresses.
Through the whitelist, we can only allow specific Bluetooth devices (listed in the whitelist) to scan and connect to us.
You can also scan and connect only to specific Bluetooth devices (listed in the whitelist).
#define APP_ADV_FAST_INTERVAL 0x0028 /**< Fast advertising interval (in units of 0.625 ms. This value corresponds to 25 ms.). */
#define APP_ADV_SLOW_INTERVAL 0x0C80 /**< Slow advertising interval (in units of 0.625 ms. This value corrsponds to 2 seconds). */
#define APP_ADV_FAST_TIMEOUT 3 /**< The duration of the fast advertising period (in seconds). */
#define APP_ADV_SLOW_TIMEOUT 0 /**< The duration of the slow advertising period (in seconds). */
static void advertising_init(void)
{
uint32_t err_code;
uint8_t adv_flags;
ble_advdata_t advdata;
ble_adv_modes_config_t options;
// Build and set advertising data
memset(&advdata, 0, sizeof(advdata));
adv_flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;//重点
advdata.name_type = BLE_ADVDATA_FULL_NAME;
advdata.include_appearance = true;
advdata.flags = adv_flags;
advdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
advdata.uuids_complete.p_uuids = m_adv_uuids;
memset(&options, 0, sizeof(options));
options.ble_adv_whitelist_enabled = true;//重点
options.ble_adv_directed_enabled = true;
options.ble_adv_directed_slow_enabled = false;
options.ble_adv_directed_slow_interval = 0;
options.ble_adv_directed_slow_timeout = 0;
options.ble_adv_fast_enabled = true;
options.ble_adv_fast_interval = APP_ADV_FAST_INTERVAL;
options.ble_adv_fast_timeout = APP_ADV_FAST_TIMEOUT;
options.ble_adv_slow_enabled = true;
options.ble_adv_slow_interval = APP_ADV_SLOW_INTERVAL;
options.ble_adv_slow_timeout = APP_ADV_SLOW_TIMEOUT;
err_code = ble_advertising_init(&advdata,
NULL,
&options,
on_adv_evt,
ble_advertising_error_handler);
APP_ERROR_CHECK(err_code);
}
Previous article:[nrf52] The difference between low_power_pwm pwm_library pwm_driver
Next article:[nrf51822][SDK12.3] Use [static/dynamic password] for pairing
Recommended ReadingLatest update time:2024-11-15 17:31
- Popular Resources
- Popular amplifiers
- Network Operating System (Edited by Li Zhixi)
- Microgrid Stability Analysis and Control Microgrid Modeling Stability Analysis and Control to Improve Power Distribution and Power Flow Control (
- MATLAB and FPGA implementation of wireless communication
- Introduction to Internet of Things Engineering 2nd Edition (Gongyi Wu)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- What is the output/input impedance value of CC2xxx?
- [TI recommended course] #[High Precision Lab] Operational Amplifier: 16 Fully Differential Amplifier#
- EEWORLD University Hall----Live Replay: Infineon & Intron Explanation- How to Choose a Suitable Automotive MOSFET
- Amway uses LT768 to realize TFT industrial serial port screen solution
- Neopixel Christmas Tree
- Gigabit Network Contactless Connector-SK202 Review Unboxing
- What are the methods of wireless bridge relay transmission?
- Diode selection
- The computer will automatically restart when the LabVIEW program is running
- Master these techniques to easily operate DC-DC circuits!