mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-23 12:14:26 +08:00
obex: Fix the PBAP GET request in PTS testing
This change is required for passing below PTS testcases: 1. PBAP/PSE/PBD/BV-02-C 2. PBAP/PSE/PBD/BV-03-C 3. PBAP/PSE/PBD/BI-01-C 4. PBAP/PSE/PBD/BV-13-C 5. PBAP/PSE/PBD/BV-14-C 6. PBAP/PSE/PBD/BV-17-C PTS sends all the GET phonebook requests without extra params. Therefore, the PBAP server is rejecting the requests with a 'Bad Request' response. So append 'maxlistcount' as default param in GET request to avoid testcase failure.
This commit is contained in:
parent
486aeafd87
commit
b22bbf873f
@ -436,10 +436,6 @@ static struct apparam_field *parse_aparam(const uint8_t *buffer, uint32_t hlen)
|
||||
GObexApparam *apparam;
|
||||
struct apparam_field *param;
|
||||
|
||||
apparam = g_obex_apparam_decode(buffer, hlen);
|
||||
if (apparam == NULL)
|
||||
return NULL;
|
||||
|
||||
param = g_new0(struct apparam_field, 1);
|
||||
|
||||
/*
|
||||
@ -447,25 +443,28 @@ static struct apparam_field *parse_aparam(const uint8_t *buffer, uint32_t hlen)
|
||||
* should be assume as Maximum value in vcardlisting 65535
|
||||
*/
|
||||
param->maxlistcount = UINT16_MAX;
|
||||
|
||||
g_obex_apparam_get_uint8(apparam, ORDER_TAG, ¶m->order);
|
||||
g_obex_apparam_get_uint8(apparam, SEARCHATTRIB_TAG,
|
||||
apparam = g_obex_apparam_decode(buffer, hlen);
|
||||
if (apparam) {
|
||||
g_obex_apparam_get_uint8(apparam, ORDER_TAG, ¶m->order);
|
||||
g_obex_apparam_get_uint8(apparam, SEARCHATTRIB_TAG,
|
||||
¶m->searchattrib);
|
||||
g_obex_apparam_get_uint8(apparam, FORMAT_TAG, ¶m->format);
|
||||
g_obex_apparam_get_uint16(apparam, MAXLISTCOUNT_TAG,
|
||||
g_obex_apparam_get_uint8(apparam, FORMAT_TAG, ¶m->format);
|
||||
g_obex_apparam_get_uint16(apparam, MAXLISTCOUNT_TAG,
|
||||
¶m->maxlistcount);
|
||||
g_obex_apparam_get_uint16(apparam, LISTSTARTOFFSET_TAG,
|
||||
g_obex_apparam_get_uint16(apparam, LISTSTARTOFFSET_TAG,
|
||||
¶m->liststartoffset);
|
||||
g_obex_apparam_get_uint64(apparam, FILTER_TAG, ¶m->filter);
|
||||
param->searchval = g_obex_apparam_get_string(apparam, SEARCHVALUE_TAG);
|
||||
g_obex_apparam_get_uint64(apparam, FILTER_TAG, ¶m->filter);
|
||||
param->searchval = g_obex_apparam_get_string(apparam,
|
||||
SEARCHVALUE_TAG);
|
||||
|
||||
g_obex_apparam_free(apparam);
|
||||
}
|
||||
|
||||
DBG("o %x sa %x sv %s fil %" G_GINT64_MODIFIER "x for %x max %x off %x",
|
||||
param->order, param->searchattrib, param->searchval,
|
||||
param->filter, param->format, param->maxlistcount,
|
||||
param->liststartoffset);
|
||||
|
||||
g_obex_apparam_free(apparam);
|
||||
|
||||
return param;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user