summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Winkler <danielwinkler@google.com>2020-10-29 16:06:17 -0700
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2020-10-29 17:44:19 -0700
commitd94551190dd59aac3edcd387e64335406b066779 (patch)
tree5719640528d8f60910346a39c9d2458bfb14fae4 /lib
parent657abc0ebe6ba049ae783d13f06e0eff6abd9ab2 (diff)
downloadbluez-d94551190dd59aac3edcd387e64335406b066779.tar.gz
advertising: Parse intervals and tx power from adv
This change adds parsers for the advertising intervals and tx power properties of the LEAdvertisement1 object. It validates that each field adheres to the 5.2 spec, and that min and max intervals are compatible with each other, i.e. that min interval is less than max interval. A note here for maintainers: The tx power that is sent in the hci parameter command is an int8_t, but as far as I can tell, there is no clean way to use a signed 8-bit integer in dbus. The dbus byte type seems incompatible with negative values in high-level languages (python) without awkward usage manipulation on the client side. For this reason, I chose to use an int16_t type for the tx power dbus field, which is then downcasted to the int8_t in bluetoothd, which at least makes the signed-ness of the type crystal clear to the dbus client that uses it. This change is manually verified by ensuring the intervals and tx power parameters are correctly parsed from the LEAdvertisement1 object, and that the parse fails if the parameters are incorrect or not compatible with each other.
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions