Python Forum
Understaning simple reading object
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Understaning simple reading object
#1
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 ,
Reply
#2
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.
Reply
#3
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.
BashBedlam likes this post
Reply
#4
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!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Reading DBF files from Amazon s3 throwing error - 'int' object has no attribute 'isa abeesm 1 2,930 Sep-22-2019, 05:49 PM
Last Post: ndc85430

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020