Coder Social home page Coder Social logo

TX Power about bglib HOT 3 CLOSED

jrowberg avatar jrowberg commented on July 29, 2024
TX Power

from bglib.

Comments (3)

jrowberg avatar jrowberg commented on July 29, 2024

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).

from bglib.

morrowyn avatar morrowyn commented on July 29, 2024

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.

from bglib.

jrowberg avatar jrowberg commented on July 29, 2024

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 field
  • 03 03 0918 (3-byte field, type=3, value= 0918) - 16-bit service UUID list, containing 0x1809

There 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.

from bglib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.