pycom / pycom-libraries

MicroPython libraries and examples that work out of the box on Pycom's IoT modules
330 stars 378 forks source link

Rename bluetooth variable to bt #74

Closed tomazursic closed 5 years ago

tomazursic commented 5 years ago

This fix the bluetooth example, to be run without errors.

tomazursic commented 5 years ago

Hi, @sdaniel55

Something else jumped out on line 14:

    TypeError: object with buffer protocol required

The following snippet fix the issue. What do you think, can we go this way?

    mfg_data = bt.resolve_adv_data(adv.data, Bluetooth.ADV_MANUFACTURER_DATA)

    if mfg_data:
        # try to get the manufacturer data (Apple's iBeacon data is sent here)
        print(binascii.hexlify(mfg_data))