Closed morrowyn closed 8 years ago
It is not possible to read the current power; the API does not provide a method for doing this. It is only possible to set the power. However, the module never changes the power on its own, so it will always be whatever you set it to last (starting with the <txpower>
tag in hardware.xml).
Sorry, I meant how do I retrieve the txpower from the ble advertisements using the bled112_scanner.py from the help it seems i only can get the following: 't' (Unix time):\t1364699464.574, 1364699591.128, etc. 'r' (RSSI value):\t-57, -80, -92, etc. 'p' (Packet type):\t0 (advertisement), 4 (scan response) 's' (Sender MAC):\t000780535BB4, 000780814494, etc. 'a' (Address type):\t0 (public), 1 (random) 'b' (Bond status):\t255 (no bond), 0 to 15 if bonded 'd' (Data payload):\t02010603030918, etc.
If the power is present in advertisement data (which is not at all guaranteed), then it will be in a properly formed advertisement field contained in the data payload. The value 02010603030918
in your example contains two fields:
02 01 06
(2-byte field, type=1, value=06) - flags field03 03 0918
(3-byte field, type=3, value= 0918) - 16-bit service UUID list, containing 0x1809There are no other fields to work with. This is the only way to get ad payload data; the Bluetooth LE specification contains more information about different advertisement field types and their formats/values.
How do i retrieve the tx power using the bglib?