summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2013-11-13 02:00:38 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2013-11-13 02:06:44 +0100
commitcf5ed12400e0dd89d5849d27dbdde38b02752b33 (patch)
treef69e8e7f37737435d730d9049380f66c2ea483db
parent4f8e947730745be87e89fc59c6682ac1a9b6ce5e (diff)
downloadneard-cf5ed12400e0dd89d5849d27dbdde38b02752b33.tar.gz
neard-cf5ed12400e0dd89d5849d27dbdde38b02752b33.tar.bz2
neard-cf5ed12400e0dd89d5849d27dbdde38b02752b33.zip
ndef: Implement record payload getter
-rw-r--r--src/ndef.c8
-rw-r--r--src/near.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/ndef.c b/src/ndef.c
index c7d78d4..e8f950e 100644
--- a/src/ndef.c
+++ b/src/ndef.c
@@ -248,6 +248,14 @@ uint8_t *__near_ndef_record_get_data(struct near_ndef_record *record,
return record->data;
}
+uint8_t *__near_ndef_record_get_payload(struct near_ndef_record *record,
+ size_t *len)
+{
+ *len = record->header->payload_len;
+
+ return record->data + record->header->header_len;
+}
+
void __near_ndef_append_records(DBusMessageIter *iter, GList *records)
{
GList *list;
diff --git a/src/near.h b/src/near.h
index 66e34ee..cf00675 100644
--- a/src/near.h
+++ b/src/near.h
@@ -108,6 +108,7 @@ void __near_ndef_record_free(struct near_ndef_record *record);
char *__near_ndef_record_get_path(struct near_ndef_record *record);
char *__near_ndef_record_get_type(struct near_ndef_record *record);
uint8_t *__near_ndef_record_get_data(struct near_ndef_record *record, size_t *len);
+uint8_t *__near_ndef_record_get_payload(struct near_ndef_record *record, size_t *len);
void __near_ndef_append_records(DBusMessageIter *iter, GList *record);
const char *__near_ndef_get_uri_prefix(uint8_t id);
struct near_ndef_message *__ndef_build_from_message(DBusMessage *msg);