diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2013-11-13 02:00:38 +0100 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-11-13 02:06:44 +0100 |
commit | cf5ed12400e0dd89d5849d27dbdde38b02752b33 (patch) | |
tree | f69e8e7f37737435d730d9049380f66c2ea483db | |
parent | 4f8e947730745be87e89fc59c6682ac1a9b6ce5e (diff) | |
download | neard-cf5ed12400e0dd89d5849d27dbdde38b02752b33.tar.gz neard-cf5ed12400e0dd89d5849d27dbdde38b02752b33.tar.bz2 neard-cf5ed12400e0dd89d5849d27dbdde38b02752b33.zip |
ndef: Implement record payload getter
-rw-r--r-- | src/ndef.c | 8 | ||||
-rw-r--r-- | src/near.h | 1 |
2 files changed, 9 insertions, 0 deletions
@@ -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; @@ -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); |