org.neard.Error.InvalidArguments
org.neard.Error.InProgress
+ array{byte} GetRawNDEF()
+
+ Return the tag's NDEF as a raw bytes stream.
Properties string Type [readonly]
return __near_error_failed(msg, ENOMEM);
}
+static DBusMessage *get_raw_ndef(DBusConnection *conn,
+ DBusMessage *msg, void *data)
+{
+ struct near_tag *tag = data;
+ DBusMessage *reply;
+ DBusMessageIter iter, array;
+
+ DBG("");
+
+ reply = dbus_message_new_method_return(msg);
+ if (reply == NULL)
+ return NULL;
+
+ dbus_message_iter_init_append(reply, &iter);
+
+ dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
+ DBUS_TYPE_BYTE_AS_STRING,
+ &array);
+
+ __near_ndef_append_records(&array, tag->records);
+
+ dbus_message_iter_close_container(&iter, &array);
+
+ return reply;
+}
+
static const GDBusMethodTable tag_methods[] = {
{ GDBUS_ASYNC_METHOD("Write", GDBUS_ARGS({"attributes", "a{sv}"}),
NULL, write_ndef) },
+ { GDBUS_METHOD("GetRawNDEF",
+ NULL, GDBUS_ARGS({"NDEF", "ay"}),
+ get_raw_ndef) },
{ },
};
bus = dbus.SystemBus()
-def extract_list(list):
+def extract_ndef(list):
val = "["
for i in list:
- val += " " + str(i)
+ val += " 0x%x" % i
val += " ]"
return val
else:
neardutils.dump_all_records(sys.argv[2])
+ tag = neardutils.find_tag(sys.argv[2])
+ raw_ndef = tag.GetRawNDEF()
+ print " Raw NDEF = %s" % (extract_ndef(raw_ndef))
+
sys.exit(0)
if (sys.argv[1] == "write"):