summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2012-10-25 18:58:06 +0200
committerArron Wang <arron.wang@intel.com>2013-07-09 08:26:19 +0800
commit304e7dcaf536a11625a1694a19228e38babb3611 (patch)
treea99cf2b719471400ca490a79820a042288f26f76 /test
parent04e9d5867181807acae3b89f8ebc1f517c246933 (diff)
downloadneard-304e7dcaf536a11625a1694a19228e38babb3611.tar.gz
neard-304e7dcaf536a11625a1694a19228e38babb3611.tar.bz2
neard-304e7dcaf536a11625a1694a19228e38babb3611.zip
ndef: Support RAW ndef writes
Change-Id: I21a341b2482556458e381b4a3033ef3e9313194c
Diffstat (limited to 'test')
-rwxr-xr-xtest/write-tag11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/write-tag b/test/write-tag
index 3635ff7..32ce67a 100755
--- a/test/write-tag
+++ b/test/write-tag
@@ -21,6 +21,7 @@ def help_text():
print "e.g. < %s /org/neard/nfc0/tag0 E-Mail test@test.com >" % (sys.argv[0])
print "e.g. < %s /org/neard/nfc0/tag0 MIME wifi_wsc YourAPname passphrase >" % (sys.argv[0])
print "e.g. < %s /org/neard/nfc0/tag0 MIME wifi_wsc YourAPname >" % (sys.argv[0])
+ print "e.g. < %s /org/neard/nfc0/tag0 Raw <NDEF_file> >" % (sys.argv[0])
sys.exit(1)
@@ -72,5 +73,15 @@ elif sys.argv[2] in ["MIME"]:
else:
help_text()
+elif sys.argv[2] in ["Raw"]:
+ ndef = file(sys.argv[3]).read().rsplit(' ')
+ ndef_stream = bytearray()
+
+ for b in ndef:
+ ndef_stream.append(int(b, 16))
+
+ tag.Write(({ "Type" : "Raw",
+ "NDEF" : dbus.ByteArray(ndef_stream) }))
+
else:
help_text()