weliem / bluez_inc

A C library for Bluez (BLE) that hides all DBus communication. It doesn't get easier than this. This library can also be used in C++.
MIT License
89 stars 23 forks source link

Change txpower from default -255? #78

Open abqjln opened 4 days ago

abqjln commented 4 days ago

I have multiple adapters in my system and would like to change their tx power levels, preferably dynamically. Is this possible in binc even on a single adapter? I may be lost and searching for the wrong thing or in the wrong place...

I see in binc_device_create that txpower is initialize to short -255. I had expected +/-20dbm at 0.1 max (+/-200) or something smaller. Would a value of +80 mean +8dbm?

binc_internal_device_update_property uses the Device->txpower parameter, but don't see where this is exposed to userspace. Also not seeing where one would set the adapter.c txpower.

I found bluez device.c has a function void device_set_tx_power that calls g_dbus_emit_property_changed, but I am so hoping that binc can continue to isolate me from dbus commands. Thanks for any help, including pointers to the right place.

weliem commented 1 day ago

I just gave it a big negative value so that it obvious it wasn't set. I think there is a way to set it nowadays but when I initially made the library it wasn't there I think. Need to have a look.