public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Zhao Forrest <forrest.zhao@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: PBAP storage plugin API proposal
Date: Wed, 08 Oct 2008 11:17:36 +0200	[thread overview]
Message-ID: <1223457456.11272.254.camel@violet.holtmann.net> (raw)
In-Reply-To: <ac8af0be0810080159h712b0f8drdffa49dc57d7afb5@mail.gmail.com>

Hi Forrest,

> I'm implementing PBAP server based on obexd. In order to support
> various PBAP backend storage each type of PBAP backend storage should
> be implemented as a plugin of PBAP server. So we propose the initial
> PBAP storage plugin API as follows. Basically the bellows are defined
> in pbap_storage_plugin.h
> ====================================================================
> typedef void* pullphonebook_t;
> typedef void* pullvcardlisting_t;
> typedef void* pullvcardentry_t;
> 
> struct pbap_storage_operations {
>         pullphonebook_t* (*pullphonebook_init) (const gchar *object_name,
>                           guint64 filter, guint8 format,
>                           guint16 max_list_count, guint16 list_start_offset,
>                           guint16 *phonebook_size, guint8 *new_missed_calls);
>         gint32 (*pullphonebook) (pullphonebook_t *handle, guint8 *buf,
>                 guint16 buf_len);
>         void (*pullphonebook_free) (pullphonebook_t *handle);
> 
>         pullvcardlisting_t* (*pullvcardlisting_init) (const gchar *object_name,
>                              guint8 order, guint8 search_attr, gchar
> *search_val,
>                              guint16 max_list_count, guint16 list_start_offset,
>                              guint16 *phonebook_size, guint8 *new_missed_calls);
>         gint32 (*pullvcardlisting) (pullvcardlisting_t *handle, guint8 *buf,
>                 guint16 buf_len);
>         void (*pullvcardlisting_free) (pullvcardlisting_t *handle);
> 
>         pullvcardentry_t* (*pullvcardentry_init) (const gchar *object_name,
>                            guint64 filter, guint8 format);
>         gint32 (*pullvcardentry) (pullvcardentry_t *handle, guint8 *buf,
>                                   guint16 buf_len);
>         void (*pullvcardentry_free) (pullvcardentry_t *handle);
> };
> 
> guint8 pbap_storage_operations_register(struct pbap_storage_operations *ops);
> 
> struct obex_pbap_storage_plugin_desc {
>         const char *name;
>         int (*init) (void);
>         void (*exit) (void);
> };
> 
> #define OBEX_PBAP_STORAGE_PLUGIN_DEFINE(name,init,exit) \
>                 struct obex_pbap_storage_plugin_desc
> obex_pbap_storage_plugin_desc = { \
>                         name, init, exit \
>                 };
> ====================================================================
> The plugin framework is similar to the one used in bluez and obexd. A
> particular PBAP storage plugin program should define its own "struct
> pbap_storage_operations" and call pbap_storage_operations_register()
> in obex_pbap_storage_plugin_desc.init() to register these callback
> functions to PBAP server.

use the generic per plugin defines and its init and exit functions and
then provide methods to register and unregister the operations.

Please keep in mind that in theory we can load more than one of these
phonebook "drivers".

All (and I mean all) plugins in bluetoothd and obexd are treated the
same. It is up to their init and exit routines to do the job. This
allows us to have a generic plugin framework and not do invent it over
and over again.

Did anyone converted the picture from the whiteboard at the meeting into
some written details.

Regards

Marcel



  reply	other threads:[~2008-10-08  9:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-08  8:59 PBAP storage plugin API proposal Zhao Forrest
2008-10-08  9:17 ` Marcel Holtmann [this message]
2008-10-09  1:43   ` Zhao Forrest
2008-10-18  4:29     ` Marcel Holtmann
2008-10-20  9:21       ` Zhao Forrest
2008-10-20 16:12         ` Marcel Holtmann

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=1223457456.11272.254.camel@violet.holtmann.net \
    --to=marcel@holtmann.org \
    --cc=forrest.zhao@gmail.com \
    --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