Complete the code to start BLE advertising with a device name.
ble_advertiser.start_advertising(device_name=[1])The device name must be a string to advertise properly.
Complete the code to scan for BLE devices for 10 seconds.
scanner.scan(duration=[1])The scan duration should be an integer representing seconds.
Fix the error in the code to stop BLE advertising.
ble_advertiser.[1]()stop_advertising.The correct method to stop advertising is stop().
Fill both blanks to filter scanned devices by RSSI and device name prefix.
filtered_devices = [dev for dev in scanner.scan_results if dev.rssi [1] -70 and dev.name.startswith([2])]
We want devices with RSSI stronger than -70 (greater than -70) and names starting with "My".
Fill all four blanks to create a dictionary of device names and RSSI values for devices with names containing 'Sensor' and RSSI less than -60.
device_info = {dev.[1]: dev.[2] for dev in scanner.scan_results if 'Sensor' in dev.[3] and dev.rssi [4] -60}The dictionary keys are device names, values are RSSI. We filter devices whose name contains 'Sensor' and RSSI less than -60.
