In aioble the ScanResult.name gives <bound_method>. However, advertisement is fine #13736
Unanswered
brianreinhold
asked this question in
Libraries & Drivers
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This may be a bug in aioble.
I run a central app and make a device discoverable in 'setup' mode. It's advertisement contains the name
1BP100
. I getScanResult.name
, print it and it is fine.Now I reconnect after setting up and the advertisement name has changed to
0BP100a3490000
. (Proprietary devices are a pain.). THis time when I printScanResult.name
I get (as shown below)<bound method>
Note the name reports but the advertisement clearly shows the correct name. Of course when I try and get the first character in the name the above error is thrown, the systems crashes, VS Code has to be restarted and the PICO-W has to be power cycled.
What does scanResult.name is a even mean? Is aioble getting confused by the change in the advertisement data? It is ok in the spec for connectable advertisement data to change, though it often doesn't.
What task exception is not being retrieved? I am IN a task, I am not running one. (It could be in the library however).
I think I know what the problem was. I forgot
scanResult.name
is a method, not a field! I think that is the cause of the<bound method>
error. All the otherscanResult
properties I was using were fields...and I even knew that at one time. That led me down a rabbit hole of trying to decode the advertisement name myself which I could do but could not get it to compare with the device name obtained elsewhere. Turned out my approach generated a unicode string and the library was giving me utf-8 strings. They had the same class, length, type, and printed identical but an == gave false. I was at a loss!Beta Was this translation helpful? Give feedback.
All reactions