bluez.dart icon indicating copy to clipboard operation
bluez.dart copied to clipboard

Cannot power on adapter but can power off

Open RossComputerGuy opened this issue 4 years ago • 7 comments

I've got code that toggles the power on the Bluetooth adapter(s). Using D-Feet, I've monitored the power state and it seems that bluez.dart does not power on the adapter. There's no exceptions printed, just that the Powered property for the object in DBus does not change from false to true. My code is available here if that's necessary to look at. Here are the lines that are in question.

RossComputerGuy avatar Apr 07 '21 22:04 RossComputerGuy

Can you try setting this from the command line and confirm that works where dbus.dart doesn't?

gdbus call --system --dest org.bluez --object-path /org/bluez/hci0 --method org.freedesktop.DBus.Properties.Set 'org.bluez.Adapter1' 'Powered' '<true>'

robert-ancell avatar Apr 08 '21 00:04 robert-ancell

@robert-ancell Doesn't work, only works in bluetoothctl.

RossComputerGuy avatar Apr 08 '21 02:04 RossComputerGuy

@RossComputerGuy can you try bluez.dart 0.5.0 - I've replaced the properties with async methods. The existing code should still have sent the request to the server but you wouldn't be sure when that completed and would have let a risk that the client was removed before that was completed.

robert-ancell avatar Apr 22 '21 03:04 robert-ancell

It is weird the example code isn't working for you - it definitely is changing the powered property as read in D-Feet for me here.

robert-ancell avatar Apr 22 '21 03:04 robert-ancell

current using bluez: ^0.7.4 And I can power on and off

https://user-images.githubusercontent.com/15329494/155120678-f954e129-b4eb-4991-a956-4f0bf9fd704f.mp4

So this issue is not happening for me

Feichtmeier avatar Feb 22 '22 11:02 Feichtmeier

@Feichtmeier your video isn't showing up, looks like its corrupted.

RossComputerGuy avatar Feb 23 '22 02:02 RossComputerGuy

ya

@RossComputerGuy sorry, sometimes mp4s crash on upload. This is converted to gif and should work for you code is here https://github.com/Feichtmeier/settings/tree/master/lib/view/pages/bluetooth

Feichtmeier avatar Feb 23 '22 07:02 Feichtmeier