Python Forum

Full Version: Understaning simple reading object
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
I'm missing something very simple

I'm reading BLE data using https://github.com/IanHarvey/bluepy

on this part I want to know all the information I can get from the scanning , so I'm trying to prinr "dev"
scanner = Scanner().withDelegate(ScanDelegate())
    devices = scanner.scan(10.0)

    for dev in devices:
        print(dev)
        print ("Device %s (%s), RSSI=%d dB " % (dev.addr, dev.addrType, dev.rssi, ))
I get this
2022-02-09 10:22:31,117 <bluepy.btle.ScanEntry object at 0xb64c6210>
2022-02-09 10:22:31,124 <bluepy.btle.ScanEntry object at 0xb64c6070>
2022-02-09 10:22:31,132 <bluepy.btle.ScanEntry object at 0xb64c61f0>
2022-02-09 10:22:31,149 <bluepy.btle.ScanEntry object at 0xb64c62f0>
2022-02-09 10:22:31,155 <bluepy.btle.ScanEntry object at 0xb64c6190>
2022-02-09 10:22:31,159 <bluepy.btle.ScanEntry object at 0xb64c6250>
my question is
how can I know what kind of informaton there is in the dev object?
I know there is rssi,addr -
but what else?

*** this quesiton is not just gor the ble scan - it's something bigger I'm missing

Thanks ,
Please provide enough information to reply.
what is scanner? show with code.
If a package, tell us which one.
If you are trying to get the GitHub code use git clone.
Look into the source code of the ScanEntry object, The __init__ method goes like this

    def __init__(self, addr, iface):
        self.addr = addr
        self.iface = iface
        self.addrType = None
        self.rssi = None
        self.connectable = False
        self.rawData = None
        self.scanData = {}
        self.updateCount = 0
You can also print(dir(dev)) to see which members are accessible. Object inspection is easy in Python.
this is the answer I needed , (this is what I'm missing)
You can also print(dir(dev)) to see which members are accessible. Object inspection is easy in Python.
thank you very much!