Implement Bluetooth access to messages (Message Access Profile, MAP)

Title sais it basically.

This Profile is most often seen in Car kits, but also things like “Bluetooth Diallers” use it.

SFOS already has a nice database for messages, what’s missing is the API/bus glue to the bluetooth layer.

  1. Must: Allow reading messages and lists of messages from connected bluetooth device
  2. Should: Allow sending (text) messages from connected bluetooth device
  3. Nice-To-Have: Display Notifications as “messages” to connected bluetooth device
  4. Nice-To-Have: XMPP and other messaging applications using Sailfish messaging infrastructure
  5. Out-of-Scope: Any of the plethora of instant messaging apps/protocols implemented in their own app. This is not what is meant by messages here.
4 Likes

I guess the problem is in the OBEX part. I’m working in my free time on BT Synchronization and have hard time to convince the OpenOBEX maintainer that the 1.7 version is broken.
My guess is that someone should implement this profile as obex server extention (MSE), but given the status of OpenOBEX … it could be it would take more time.
The OBEX protocol was obliterated by Jolla and all other major phone players. IT could be that it comes back with such requests.

1 Like

Thank you for your insights.

Well I guess what we will see is things like infotainment systems implementing this via Google Services only instead of dealing with having to support various messy implementations of an aging standard.

What service?! Be aware that if you have such thing (Google) in your car, you do not have the control over your car.
This is your choice and if you do not do anything we will end up in the middle ages, where Google is the Land Lord.
What I wanted to say is that the specification needs implementation. The standard is not aging, but the big players went for Big Brother.
We need more developers to do the work because AFAIK Jolla has no interest in this piece of software, but (reportedly) they would adopt it if someone provides working solution.

I know, don’t like it and it is already happening.

Can you expand on what you know would be needed?

Because actually one can enable the MAS plugin on obexd, and it works to the degree that other devices can see it as a MAS. (done by removing the file mas in /etc/obexd/noplugins)
I do not know how to poperly test any further than that:

Device 38:78:62:xx:yy:zz (public)
    Name: Xperia10
    Alias: Xperia10
    Class: 0x005c020c
    Icon: phone
    Paired: yes
    Trusted: no
    Blocked: no
    Connected: yes
    LegacyPairing: no
    UUID: OBEX Object Push          (00001105-0000-1000-8000-00805f9b34fb)
    UUID: Audio Source              (0000110a-0000-1000-8000-00805f9b34fb)
    UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
    UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
    UUID: Advanced Audio Distribu.. (0000110d-0000-1000-8000-00805f9b34fb)
    UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
    UUID: Headset AG                (00001112-0000-1000-8000-00805f9b34fb)
    UUID: Handsfree Audio Gateway   (0000111f-0000-1000-8000-00805f9b34fb)
    UUID: Phonebook Access Server   (0000112f-0000-1000-8000-00805f9b34fb)
    UUID: Message Access Server     (00001132-0000-1000-8000-00805f9b34fb)
    UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
    UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
    UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)

After restarting and pairing I can try on a linux computer:

linuxbox $ /usr/lib/bluez/test/map-client -d 38:78:62:xx:yy:zz -c /telecom/server/inbox -l
linuxbox $ /usr/lib/bluez/test/map-client -d 38:78:62:xx:yy:zz -L /home/nemo

produces on the phone:

Apr 22 12:37:28 Xperia10 obexd[12949]: open((null)): Function not implemented (38)
Apr 22 12:37:28 Xperia10 obexd[12949]: disconnected: Transport got disconnected
Apr 22 12:37:28 Xperia10 bluetoothd[6121]: Unable to get io data for Message Access: getpeername: Transport endpoint is not connected (107)
Apr 22 12:39:58 Xperia10 obexd[12949]: open(/home/nemo/): Invalid request descriptor (53)
Apr 22 12:39:58 Xperia10 obexd[12949]: disconnected: Transport got disconnected
Apr 22 12:39:58 Xperia10 bluetoothd[6121]: Unable to get io data for Message Access: getpeername: Transport endpoint is not connected (107)
Apr 22 12:40:10 Xperia10 obexd[12949]: open(/home/nemo/): Invalid request descriptor (53)
Apr 22 12:40:10 Xperia10 obexd[12949]: disconnected: Transport got disconnected
Apr 22 12:40:10 Xperia10 bluetoothd[6121]: Unable to get io data for Message Access: getpeername: Transport endpoint is not connected (107)

Have a look at the specification https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/obex-api.txt
under Message Access hierarchy.

It could be you need appropriate client. You can use on linux the qdbusviewer tool.

Inspect with Introspection the implementation. It is suspicious that the plugin is disabled. If it is operational/functional/working should be possible to utilize.

1 Like

Thank you.

introspection does not show the MessageAccess1 interface.

Ill investigate a bit further, maybe it can be added.

there should be a service on the phone that can handle these methods, so you are supposed to do the introspection on the phone. For example on org.bluez.obex the path /org/bluez/obex is introspected as following

$ dbus-send --print-reply --session --dest=org.bluez.obex /org/bluez/obex org.freedesktop.DBus.Introspectable.Introspect
method return time=1619109895.372426 sender=:1.4 -> destination=:1.129 serial=21 reply_serial=2
   string "<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node><interface name="org.freedesktop.DBus.Introspectable"><method name="Introspect"><arg name="xml" type="s" direction="out"/>
</method></interface><interface name="org.bluez.obex.AgentManager1"><method name="RegisterAgent"><arg name="agent" type="o" direction="in"/>
</method><method name="UnregisterAgent"><arg name="agent" type="o" direction="in"/>
</method></interface><interface name="org.bluez.obex.Client1"><method name="CreateSession"><arg name="destination" type="s" direction="in"/>
<arg name="args" type="a{sv}" direction="in"/>
<arg name="session" type="o" direction="out"/>
</method><method name="RemoveSession"><arg name="session" type="o" direction="in"/>
</method></interface></node>"

Note the obexd is working in the user session (–session).
If there is no service to provide the functionality behind, it means the bluetooth obex supports the interface, but someone has to write the daemon, which is not that hard in Qt5 if you have the time and experience to do.

1 Like