Linux bluetooth development
 help / color / mirror / Atom feed
From: Mohammed Sadiq <sadiq@sadiqpk.org>
To: linux-bluetooth@vger.kernel.org
Cc: Mohammed Sadiq <sadiq@sadiqpk.org>
Subject: [PATCH BlueZ] obexd: Improve handling unsupported MAP events
Date: Sat, 24 Oct 2026 17:27:34 +0530	[thread overview]
Message-ID: <20261024115735.2403759-1-sadiq@sadiqpk.org> (raw)

As per the spec, unsupported events should be ignored. But since bluez
used to notify all unsupported events over DBus, removing support for
those will break DBus API and clients that may be depending on them.

But all unsupported events are being notified by replacing the
original message object, as all map event types defaults to
MAP_ET_NEW_MESSAGE if unsupported - As the event struct is allocated
with g_new0().

So change the first member in event enum to MAP_ET_UNSUPPORTED so that
it'll be the default on allocation and notify over DBus on unsupported
events.
---
 obexd/client/map-event.h | 1 +
 obexd/client/map.c       | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/obexd/client/map-event.h b/obexd/client/map-event.h
index ab185eadf..740c08be2 100644
--- a/obexd/client/map-event.h
+++ b/obexd/client/map-event.h
@@ -11,6 +11,7 @@
 struct obc_session;
 
 enum map_event_type {
+	MAP_ET_UNSUPPORTED,
 	MAP_ET_NEW_MESSAGE,
 	MAP_ET_DELIVERY_SUCCESS,
 	MAP_ET_SENDING_SUCCESS,
diff --git a/obexd/client/map.c b/obexd/client/map.c
index 487354252..6702aa333 100644
--- a/obexd/client/map.c
+++ b/obexd/client/map.c
@@ -2126,6 +2126,9 @@ static void map_handle_notification(struct map_event *event, void *user_data)
 		event->msg_type);
 
 	switch (event->type) {
+	case MAP_ET_UNSUPPORTED:
+		map_handle_status_changed(map, event, "notification");
+		break;
 	case MAP_ET_NEW_MESSAGE:
 		map_handle_new_message(map, event);
 		map_handle_status_changed(map, event, "notification");
-- 
2.47.3


             reply	other threads:[~2026-10-24 11:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-24 11:57 Mohammed Sadiq [this message]
2026-10-24 14:16 ` [BlueZ] obexd: Improve handling unsupported MAP events bluez.test.bot
2026-10-26 21:40 ` [PATCH BlueZ] " 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=20261024115735.2403759-1-sadiq@sadiqpk.org \
    --to=sadiq@sadiqpk.org \
    --cc=linux-bluetooth@vger.kernel.org \
    /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