From: Jinwang Li <jinwang.li@oss.qualcomm.com>
To: linux-bluetooth@vger.kernel.org
Cc: cheng.jiang@oss.qualcomm.com, quic_chezhou@quicinc.com,
wei.deng@oss.qualcomm.com, shuai.zhang@oss.qualcomm.com,
mengshi.wu@oss.qualcomm.com, jinwang.li@oss.qualcomm.com,
xiuzhuo.shang@oss.qualcomm.com
Subject: [PATCH v2 1/2] obexd/pbap: Fix NewMissedCalls parameter size
Date: Tue, 27 Oct 2026 15:10:45 +0800 [thread overview]
Message-ID: <20261027071046.2272116-2-jinwang.li@oss.qualcomm.com> (raw)
In-Reply-To: <20261027071046.2272116-1-jinwang.li@oss.qualcomm.com>
NewMissedCalls is a one-byte apparam, but was encoded with
g_obex_apparam_set_uint16(). Use uint8 instead, and update the
phonebook callback type to match.
Fixes: 398d3e23533a ("obexd: Make use of GObexApparam API")
Signed-off-by: Jinwang Li <jinwang.li@oss.qualcomm.com>
---
obexd/plugins/irmc.c | 4 ++--
obexd/plugins/pbap.c | 8 ++++----
obexd/plugins/phonebook-tracker.c | 2 +-
obexd/plugins/phonebook.h | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/obexd/plugins/irmc.c b/obexd/plugins/irmc.c
index cfd8a45d4..b9888bbed 100644
--- a/obexd/plugins/irmc.c
+++ b/obexd/plugins/irmc.c
@@ -74,7 +74,7 @@ static const char *owner_vcard =
"END:VCARD\r\n";
static void phonebook_size_result(const char *buffer, size_t bufsize,
- int vcards, int missed,
+ int vcards, uint8_t missed,
gboolean lastpart, void *user_data)
{
struct irmc_session *irmc = user_data;
@@ -90,7 +90,7 @@ static void phonebook_size_result(const char *buffer, size_t bufsize,
}
static void query_result(const char *buffer, size_t bufsize, int vcards,
- int missed, gboolean lastpart, void *user_data)
+ uint8_t missed, gboolean lastpart, void *user_data)
{
struct irmc_session *irmc = user_data;
const char *s, *t;
diff --git a/obexd/plugins/pbap.c b/obexd/plugins/pbap.c
index 9f8684863..3ee54f1fe 100644
--- a/obexd/plugins/pbap.c
+++ b/obexd/plugins/pbap.c
@@ -159,7 +159,7 @@ static void cache_clear(struct cache *cache)
}
static void phonebook_size_result(const char *buffer, size_t bufsize,
- int vcards, int missed,
+ int vcards, uint8_t missed,
gboolean lastpart, void *user_data)
{
struct pbap_session *pbap = user_data;
@@ -186,7 +186,7 @@ static void phonebook_size_result(const char *buffer, size_t bufsize,
DBG("missed %d", missed);
}
- pbap->obj->apparam = g_obex_apparam_set_uint16(pbap->obj->apparam,
+ pbap->obj->apparam = g_obex_apparam_set_uint8(pbap->obj->apparam,
NEWMISSEDCALLS_TAG,
missed);
@@ -194,7 +194,7 @@ static void phonebook_size_result(const char *buffer, size_t bufsize,
}
static void query_result(const char *buffer, size_t bufsize, int vcards,
- int missed, gboolean lastpart, void *user_data)
+ uint8_t missed, gboolean lastpart, void *user_data)
{
struct pbap_session *pbap = user_data;
@@ -224,7 +224,7 @@ static void query_result(const char *buffer, size_t bufsize, int vcards,
pbap->obj->firstpacket = TRUE;
}
- pbap->obj->apparam = g_obex_apparam_set_uint16(pbap->obj->apparam,
+ pbap->obj->apparam = g_obex_apparam_set_uint8(pbap->obj->apparam,
NEWMISSEDCALLS_TAG,
missed);
diff --git a/obexd/plugins/phonebook-tracker.c b/obexd/plugins/phonebook-tracker.c
index 36e73db77..ba0940c40 100644
--- a/obexd/plugins/phonebook-tracker.c
+++ b/obexd/plugins/phonebook-tracker.c
@@ -488,7 +488,7 @@ struct phonebook_data {
GSList *contacts;
phonebook_cache_ready_cb ready_cb;
phonebook_entry_cb entry_cb;
- int newmissedcalls;
+ uint8_t newmissedcalls;
GCancellable *query_canc;
char *req_name;
int vcard_part_count;
diff --git a/obexd/plugins/phonebook.h b/obexd/plugins/phonebook.h
index b878b143d..7e99de6e7 100644
--- a/obexd/plugins/phonebook.h
+++ b/obexd/plugins/phonebook.h
@@ -61,7 +61,7 @@ struct apparam_field {
* Contacts will be returned in the vcard format.
*/
typedef void (*phonebook_cb) (const char *buffer, size_t bufsize,
- int vcards, int missed, gboolean lastpart, void *user_data);
+ int vcards, uint8_t missed, gboolean lastpart, void *user_data);
/*
* Interface between the PBAP core and backends to
--
2.34.1
next prev parent reply other threads:[~2026-10-27 7:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-27 7:10 [PATCH v2 0/2] obexd/pbap: Fix NewMissedCalls reporting Jinwang Li
2026-10-27 7:10 ` Jinwang Li [this message]
2026-10-27 9:01 ` bluez.test.bot
2026-10-27 7:10 ` [PATCH v2 2/2] obexd/pbap: Report NewMissedCalls for mch Jinwang Li
2026-10-28 13:30 ` [PATCH v2 0/2] obexd/pbap: Fix NewMissedCalls reporting patchwork-bot+bluetooth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261027071046.2272116-2-jinwang.li@oss.qualcomm.com \
--to=jinwang.li@oss.qualcomm.com \
--cc=cheng.jiang@oss.qualcomm.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=mengshi.wu@oss.qualcomm.com \
--cc=quic_chezhou@quicinc.com \
--cc=shuai.zhang@oss.qualcomm.com \
--cc=wei.deng@oss.qualcomm.com \
--cc=xiuzhuo.shang@oss.qualcomm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox