summaryrefslogtreecommitdiff
path: root/obexd
diff options
context:
space:
mode:
authorHannu Mallat <hmallat@gmail.com>2021-07-23 15:58:24 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2021-07-23 14:47:37 -0700
commitbb27e5e1be7cbaac09aef5ff7a79f71a2ad8d113 (patch)
tree62c467047870447154342ce372ca9f491f5f5489 /obexd
parentedb86e5e012bca84bbcd05e14d049e93a9de2dae (diff)
downloadbluez-bb27e5e1be7cbaac09aef5ff7a79f71a2ad8d113.tar.gz
obexd: phonebook: Set default apparams for PTS clients
Some PTS clients do not send all the mandatory apparams when retrieving the phonebook. Clients such as car multimedia systems cannot be fixed, therefore working around this issue by inserting default apparams which makes these clients work as well.
Diffstat (limited to 'obexd')
-rw-r--r--obexd/plugins/pbap.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/obexd/plugins/pbap.c b/obexd/plugins/pbap.c
index efae92cd8..ab5236316 100644
--- a/obexd/plugins/pbap.c
+++ b/obexd/plugins/pbap.c
@@ -511,6 +511,21 @@ static int pbap_get(struct obex_session *os, void *user_data)
rsize = 0;
}
+ /* Workaround for PTS client not sending mandatory apparams */
+ if (!rsize && g_ascii_strcasecmp(type, VCARDLISTING_TYPE) == 0) {
+ static const uint8_t default_apparams[] = {
+ 0x04, 0x02, 0xff, 0xff
+ };
+ buffer = default_apparams;
+ rsize = sizeof(default_apparams);
+ } else if (!rsize && g_ascii_strcasecmp(type, VCARDENTRY_TYPE) == 0) {
+ static const uint8_t default_apparams[] = {
+ 0x07, 0x01, 0x00
+ };
+ buffer = default_apparams;
+ rsize = sizeof(default_apparams);
+ }
+
params = parse_aparam(buffer, rsize);
if (params == NULL)
return -EBADR;