Return-Path: From: Antonio Ospite To: linux-bluetooth@vger.kernel.org Cc: Antonio Ospite , Vinicius Costa Gomes , Bastien Nocera Subject: [RFC PATCH BlueZ RESEND 2/3] Add a btd_store_record_string() call Date: Mon, 10 Oct 2011 17:50:52 +0200 Message-Id: <1318261853-22448-2-git-send-email-ospite@studenti.unina.it> In-Reply-To: <1316454126-32614-1-git-send-email-ospite@studenti.unina.it> References: <1316454126-32614-1-git-send-email-ospite@studenti.unina.it> Sender: linux-bluetooth-owner@vger.kernel.org List-ID: Add a new btd_* call to store an SDP record passed as a string, this is going to be used by the external playstation-peripheral plugin. --- src/storage.h | 1 + src/storage.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 0 deletions(-) diff --git a/src/storage.h b/src/storage.h index dbe717f..9b6eb47 100644 --- a/src/storage.h +++ b/src/storage.h @@ -55,6 +55,7 @@ int write_trust(const char *src, const char *addr, const char *service, gboolean int write_device_profiles(bdaddr_t *src, bdaddr_t *dst, const char *profiles); int delete_entry(bdaddr_t *src, const char *storage, const char *key); int store_record(const gchar *src, const gchar *dst, sdp_record_t *rec); +int btd_store_record_string(const gchar *src, const gchar *dst, const gchar *record_str); sdp_record_t *record_from_string(const gchar *str); sdp_record_t *fetch_record(const gchar *src, const gchar *dst, const uint32_t handle); int delete_record(const gchar *src, const gchar *dst, const uint32_t handle); diff --git a/src/storage.c b/src/storage.c index c64842c..35c39bf 100644 --- a/src/storage.c +++ b/src/storage.c @@ -783,6 +783,23 @@ int store_record(const gchar *src, const gchar *dst, sdp_record_t *rec) return err; } +int btd_store_record_string(const gchar *src, + const gchar *dst, + const gchar *record_str) +{ + sdp_record_t *record; + int ret = 0; + + record = record_from_string(record_str); + if (record == NULL) { + return -ENOMEM; + } + ret = store_record(src, dst, record); + sdp_record_free(record); + + return ret; +} + sdp_record_t *record_from_string(const gchar *str) { sdp_record_t *rec; -- 1.7.6.3