diff --git a/obexd/plugins/ebook.c b/obexd/plugins/ebook.c
index 96990ea..da8bc9b 100644
--- a/obexd/plugins/ebook.c
+++ b/obexd/plugins/ebook.c
return 0;
}
+static int ebook_pullvcardentry(struct phonebook_context *context,
+ gchar *objname, guint64 filter, guint8 format)
+{
+ EBook *book;
+ EBookQuery *query;
+
+ DBG("context %p", context);
+
+ phonebook_ref(context);
+
+ book = e_book_new_default_addressbook(NULL);
+
+ e_book_open(book, FALSE, NULL);
+
+ query = e_book_query_any_field_contains("");
+
+ e_book_async_get_contacts(book, query, ebooklist_cb, context);
+
+ return 0;
+}
+
static struct phonebook_driver ebook_driver = {
.name = "ebook",
.create = ebook_create,
.destroy = ebook_destroy,
.pullphonebook = ebook_pullphonebook,
.pullvcardlisting = ebook_pullvcardlisting,
+ .pullvcardentry = ebook_pullvcardentry,
};
static int ebook_init(void)
diff --git a/obexd/src/pbap.c b/obexd/src/pbap.c
index d9ebdb0..70f3d8e 100644
--- a/obexd/src/pbap.c
+++ b/obexd/src/pbap.c
#define PHONEBOOK_TYPE "x-bt/phonebook"
#define VCARDLISTING_TYPE "x-bt/vcard-listing"
+#define VCARDENTRY_TYPE "x-bt/vcard"
#define ORDER_TAG 0x01
#define SEARCHVALUE_TAG 0x02
return err;
}
+static int pbap_pullvcardentry(obex_t *obex, obex_object_t *obj)
+{
+ struct obex_session *session = OBEX_GetUserData(obex);
+ gchar *fullname;
+ struct apparam_field apparam;
+ int err;
+
+ memset(&apparam, 0, sizeof(struct apparam_field));
+ err = pbap_parse_apparam_header(obex, obj, &apparam);
+ if (err < 0)
+ return err;
+
+ fullname = g_build_filename(session->current_folder,
+ session->name, NULL);
+ err = phonebook_pullvcardentry(session->pbctx, fullname,
+ apparam.filter, apparam.format);
+
+ g_free(apparam.searchval);
+ g_free(fullname);
+ return err;
+}
+
+
void pbap_get(obex_t *obex, obex_object_t *obj)
{
struct obex_session *session = OBEX_GetUserData(obex);
err = pbap_pullphonebook(obex, obj, &addbody);
else if (g_str_equal(session->type, VCARDLISTING_TYPE) == TRUE)
err = pbap_pullvcardlisting(obex, obj, &addbody);
+ else if (g_str_equal(session->type, VCARDENTRY_TYPE) == TRUE)
+ err = pbap_pullvcardentry(obex, obj);
else
goto fail;
diff --git a/obexd/src/phonebook.c b/obexd/src/phonebook.c
index 239fbaf..ab97b97 100644
--- a/obexd/src/phonebook.c
+++ b/obexd/src/phonebook.c
liststartoffset, phonebooksize, newmissedcalls);
}
+int phonebook_pullvcardentry(struct phonebook_context *context, gchar *objname,
+ guint64 filter, guint8 format)
+{
+ if (!context->driver->pullvcardentry)
+ return -1;
+
+ return context->driver->pullvcardentry(context, objname, filter,
+ format);
+}
+
/* if buf is NULL or size is 0, this indicate that no more result will
* be returned by PBAP plugin
* */
diff --git a/obexd/src/phonebook.h b/obexd/src/phonebook.h
index 311213c..4a270e8 100644
--- a/obexd/src/phonebook.h
+++ b/obexd/src/phonebook.h
guint8 searchattrib, guint16 maxlistcount,
guint16 liststartoffset, guint16 *phonebooksize,
guint8 *newmissedcalls);
+extern int phonebook_pullvcardentry(struct phonebook_context *context,
+ gchar *objname, guint64 filter, guint8 format);
extern void phonebook_return(struct phonebook_context *context,
char *buf, int size);
guint8 searchattrib, guint16 maxlistcount,
guint16 liststartoffset, guint16 *phonebooksize,
guint8 *newmissedcalls);
- int (*pullvcardentry) (struct phonebook_context *context);
+ int (*pullvcardentry) (struct phonebook_context *context,
+ gchar *objname, guint64 filter, guint8 format);
};
extern int phonebook_driver_register(struct phonebook_driver *driver);