Replies: 4 comments 7 replies
-
Oops, after reading what causes the error "Unknown object" ? I realised I'd tried debugging the code so changed it to:
Changing it back fixed the error. But my original problem is that discovery on Ubuntu finds all the BLE devices around me whereas on my embedded device I only see:
If I run |
Beta Was this translation helpful? Give feedback.
-
What version of sdbus-c++ are you using? Since v2, the proxy created the way you mentioned connects to the bus depending on the context -- it may be a system bus or a session bus. If your proxy connects to the session bus and the remote object is on system bus, it will fail. |
Beta Was this translation helpful? Give feedback.
-
Small update - I saw somewhere else that you can use
The strange thing is there's a try catch around the
|
Beta Was this translation helpful? Give feedback.
-
Ah dammit, looks to be a timing problem. The app enables Bluetooth then starts discovery. If I enable Bluetooth first then run the app it works - I guess there's a delay between enabling it and BlueZ accepting messages. I'll see if there's a way of polling for it. Weird that sdbus-c++ doesn't throw an exception though. Is there any point me investigating this further or should I just wait until I can use v2? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I started with this blog post Me and the Devil BlueZ: Reading BLE Sensors From C++ which uses this code to call StartDiscovery:
This works fine on Ubuntu but when I try the same code on my embedded device I get:
But if I try this on the command line it seems to work:
How can I do this in using sdbus-c++ so it works consistently on different devices?
(also asked here and I added a tag for sdbus-cpp)
Beta Was this translation helpful? Give feedback.
All reactions