目前,我想更改nRF Connect 应用程序上显示的Pico 2W设备的名称。我在 VsCode 中使用Micro Pico。我尝试了很多方法,但名称始终为“ N/A ”。
import bluetooth
from time import sleep
bluetooth.BLE().active(True)
ble = bluetooth.BLE()
device_name = 'PicoW_Device'
advertising_data = b'\x02\x01\x06\x03\x03\x0F\x18\x09' + bytes(device_name, 'utf-8')
ble.gap_advertise(100, adv_data=advertising_data)
print(f"The Name of the device is currently: {device_name}")
while True:
sleep(1)
我尝试更改名称,但始终显示“ N/A ”