IanHarvey / bluepy

Python interface to Bluetooth LE on Linux
Other
1.61k stars 490 forks source link

Can't find my cellphone using bluepy #203

Open aeyuxi opened 7 years ago

aeyuxi commented 7 years ago

Greetings, I'm trying to use the following code snipped listed in the example code

from bluepy.btle import Scanner, DefaultDelegate

class ScanDelegate(DefaultDelegate):
    def __init__(self):
        DefaultDelegate.__init__(self)

    def handleDiscovery(self, dev, isNewDev, isNewData):
        if isNewDev:
            print "Discovered device", dev.addr
        elif isNewData:
            print "Received new data from", dev.addr

scanner = Scanner().withDelegate(ScanDelegate())
devices = scanner.scan(10.0)

for dev in devices:
    print "Device %s (%s), RSSI=%d dB" % (dev.addr, dev.addrType, dev.rssi)
    for (adtype, desc, value) in dev.getScanData():
        print "  %s = %s" % (desc, value)

However, I can't see the MAC address of my cellphone listed. Any ideas why is it happening? Thanks.

aeyuxi commented 7 years ago

Solved. I read further and my cell phone does not support peripheral mode. Thanks.