Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b597c509 authored by Timm Korte's avatar Timm Korte Committed by Andre Eisenbach
Browse files

bt: fix sdp service name by removing NULL char



The Bluedroid stack uses a C string with terminating NULL char as a
service name. Since in BT, strings are TLV encoded (type, length,
value), this doesn't make sense.

Simple fix is to copy the string without the trailing NULL by
removing the "+1" after the strlen call when passing the string as
uint8_t array to the lower level functions.
The current behaviour keeps some older devices from being able to
connect to an Android providing a Serial Port profile due to having
the wrong service name (that is, including a NULL at the end instead
of the correct string).

Test: Checked against Linux BlueZ, which does not include this extra
null character.

Bug: 63665003
Change-Id: I6a43024ff89ac09e4b2d2e5cfb407b6e9323f0bd
Signed-off-by: default avatarTimm Korte <timm.korte@gmail.com>
(cherry picked from commit 625f798c696229b0cc58e5f85409fd029f987473)
parent 6793b8e5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment