-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
invalid field detected *device.Device1Properties.Bonded #193
Comments
Hello @vlappa I would guess that the version of BlueZ installed on your Linux machine does not match version we are using for this package. What kernel version/BlueZ version are your running? |
Arch Linux: I think I got the same message on both. |
Can confirm, I have had this pop up when playing around with Bluez configs. In my case, I was compiling 5.69 for a Raspberry Pi 4 and playing with the configuration to see if that fixed the Bluetooth connectivity issues I was having (it didn't). Reinstalling the original 5.55 that came with Raspbian cleared things up. However, I believe what caused it was enabling experimental features in Bluez which I think added extra fields to its Device1 object that it registers on DBus thus the errors. They are harmless, but obviously not fun to see. |
This is a big rewrite to use DBus calls directly instead of going through go-bluetooth first. This is a big change, but I believe it is an improvement. While the go-bluetooth works for many cases, it's a layer in between that I believe hurts more than it helps. Without it, we can just program directly against the BlueZ D-Bus API. The end result is about 10% more code. With this rewrite, I fixed the following issues: * All MapToStruct warnings are gone, like in #193. * Advertisements can be restarted after they were stopped. Previously this resulted in a panic. * Looking at the source code of go-bluetooth, it appears that it includes devices from a different Bluetooth adapter than the one that's currently scanning. This is fixed with the rewrite. * Fix a bug in Adapter.AddService where it would only allow adding a single service. Multiple services can now be added. This was actually the motivating bug that led me down to rewrite the whole thing because I couldn't figure out where the bug was in go-bluetooth (it's many layers deep). * The `WriteEvent` callback in a characteristic now also gets the 'offset' parameter which wasn't provided by go-bluetooth. This rewrite also avoids go-bluetooth specific workarounds like #74 and #121. I have tested all examples in the smoketest-linux Makefile target. They all still work with this rewrite.
This is a big rewrite to use DBus calls directly instead of going through go-bluetooth first. This is a big change, but I believe it is an improvement. While the go-bluetooth works for many cases, it's a layer in between that I believe hurts more than it helps. Without it, we can just program directly against the BlueZ D-Bus API. The end result is about 10% more code. With this rewrite, I fixed the following issues: * All MapToStruct warnings are gone, like in #193. * Advertisements can be restarted after they were stopped. Previously this resulted in a panic. * Looking at the source code of go-bluetooth, it appears that it includes devices from a different Bluetooth adapter than the one that's currently scanning. This is fixed with the rewrite. * Fix a bug in Adapter.AddService where it would only allow adding a single service. Multiple services can now be added. This was actually the motivating bug that led me down to rewrite the whole thing because I couldn't figure out where the bug was in go-bluetooth (it's many layers deep). * The `WriteEvent` callback in a characteristic now also gets the 'offset' parameter which wasn't provided by go-bluetooth. This rewrite also avoids go-bluetooth specific workarounds like #74 and #121. I have tested all examples in the smoketest-linux Makefile target. They all still work with this rewrite.
#216 fixes this issue by not using the code that causes these warnings. |
This is a big rewrite to use DBus calls directly instead of going through go-bluetooth first. This is a big change, but I believe it is an improvement. While the go-bluetooth works for many cases, it's a layer in between that I believe hurts more than it helps. Without it, we can just program directly against the BlueZ D-Bus API. The end result is about 10% more code. With this rewrite, I fixed the following issues: * All MapToStruct warnings are gone, like in #193. * Advertisements can be restarted after they were stopped. Previously this resulted in a panic. * Looking at the source code of go-bluetooth, it appears that it includes devices from a different Bluetooth adapter than the one that's currently scanning. This is fixed with the rewrite. * Fix a bug in Adapter.AddService where it would only allow adding a single service. Multiple services can now be added. This was actually the motivating bug that led me down to rewrite the whole thing because I couldn't figure out where the bug was in go-bluetooth (it's many layers deep). * The `WriteEvent` callback in a characteristic now also gets the 'offset' parameter which wasn't provided by go-bluetooth. This rewrite also avoids go-bluetooth specific workarounds like #74 and #121. I have tested all examples in the smoketest-linux Makefile target. They all still work with this rewrite.
Now closing since 0.9.0 has been released. Thank you! |
I'm running code (on Linux) based on the heartrate-monitor example. The server is a board with a esp32 chip, using the esp32 BLE C++ library.
I do get this warning. Any idea what triggers this?
scanning...
WARN[0000] MapToStruct: invalid field detected *device.Device1Properties.Bonded
WARN[0000] MapToStruct: invalid field detected *device.Device1Properties.Bonded
WARN[0000] MapToStruct: invalid field detected *device.Device1Properties.Bonded
WARN[0000] MapToStruct: invalid field detected *device.Device1Properties.Bonded
WARN[0000] MapToStruct: invalid field detected *device.Device1Properties.Bonded
WARN[0000] MapToStruct: invalid field detected *device.Device1Properties.Bonded
WARN[0000] MapToStruct: invalid field detected *device.Device1Properties.Bonded
WARN[0000] MapToStruct: invalid field detected *device.Device1Properties.Bonded
WARN[0000] MapToStruct: invalid field detected *device.Device1Properties.Bonded
WARN[0000] MapToStruct: invalid field detected *device.Device1Properties.Bonded
found device: 40:22:D8:3B:ED:16 -59 ESP32
WARN[0000] MapToStruct: invalid field detected *device.Device1Properties.Bonded
connected to 40:22:D8:3B:ED:16
discovering services/characteristics
found service adaf0200-c332-42a8-93bd-25e905756cb8
found characteristic adaf0201-c332-42a8-93bd-25e905756cb8
The text was updated successfully, but these errors were encountered: