Skip to content
Snippets Groups Projects
Commit 2422e064 authored by ft-Demo's avatar ft-Demo
Browse files

commit by robo pro coding

parent 85cbfb4c
No related branches found
No related tags found
No related merge requests found
......@@ -98,7 +98,4 @@
</block>
</statement>
</block>
<block type="controls_if" id="QQ49+[F0OOH7_P8_mE*u" disabled="true" x="535" y="118">
<mutation elseif="0" else="1"/>
</block>
</xml>
\ No newline at end of file
......@@ -1736,7 +1736,7 @@
</value>
<next>
<block type="util_python" id="W3l!q=q$W!Cq.FN@%GLU">
<field name="value">target_uid = None&amp;#10;try:&amp;#10; for target in nfc_obj.poll(modulations=((pynfc.nfc.NMT_ISO14443A, pynfc.nfc.NBR_424),), times=0x01, delay=1):&amp;#10; &amp;#10; target_uid = target.uid.decode('utf-8')&amp;#10;&amp;#10; #_print_device_target(target)&amp;#10; &amp;#10; if target_uid != None:&amp;#10; break&amp;#10;except Exception as e:&amp;#10; target_uid = None&amp;#10; logging.warning(e)</field>
<field name="value">target_uid = None&amp;#10;try:&amp;#10; for target in nfc_obj.poll(modulations=((pynfc.nfc.NMT_ISO14443A, pynfc.nfc.NBR_424),), times=0x05, delay=1):&amp;#10; &amp;#10; target_uid = target.uid.decode('utf-8')&amp;#10;&amp;#10; #_print_device_target(target)&amp;#10; &amp;#10; if target_uid != None:&amp;#10; break&amp;#10;except Exception as e:&amp;#10; target_uid = None&amp;#10; logging.warning(e)</field>
<next>
<block type="lists_setIndex" id="BY0Bs+xxi5ov5rbx;Sv.">
<mutation at="true"/>
......@@ -1789,7 +1789,7 @@
<field name="value">logging.log(logging.TRACE0_NFC, '-&gt;')</field>
<next>
<block type="util_python" id="ntdme()Ckm)RvcZNhFy=">
<field name="value">global tag&amp;#10;def _internal_func_ntag21x():&amp;#10; global tag&amp;#10; target_uid = None&amp;#10; try:&amp;#10; for target in nfc_obj.poll(modulations=((pynfc.nfc.NMT_ISO14443A, pynfc.nfc.NBR_424),), times=0x01, delay=1):&amp;#10; &amp;#10; target_uid = target.uid.decode('utf-8')&amp;#10; nfc_data[0] = target_uid&amp;#10; _print_device_target(target)&amp;#10;&amp;#10; logging.log(logging.DEBUG_NFC, "freefare_get_tags")&amp;#10; tags = freefare_get_tags(nfc_obj.pdevice)&amp;#10; logging.log(logging.DEBUG_NFC, "tags")&amp;#10;&amp;#10; for tag in tags:&amp;#10; logging.log(logging.DEBUG_NFC, "*")&amp;#10; logging.log(logging.DEBUG_NFC, "tag")&amp;#10; logging.log(logging.DEBUG_NFC, "type(tag)")&amp;#10;&amp;#10; logging.log(logging.DEBUG_NFC, 'freefare_get_tag_type')&amp;#10; r_type = freefare_get_tag_type(tag)&amp;#10; logging.log(logging.DEBUG_NFC, r_type)&amp;#10;&amp;#10; # read only NTAG21x tags&amp;#10; if r_type != 7:&amp;#10; logging.log(logging.DEBUG_NFC, "No NTAG21x tag! ", r_type)&amp;#10; friendly_name = ctypes.string_at(freefare_get_tag_friendly_name(tag))&amp;#10; logging.log(logging.DEBUG_NFC, friendly_name)&amp;#10; break&amp;#10;&amp;#10; logging.log(logging.DEBUG_NFC, 'ntag21x_connect')&amp;#10; r = ntag21x_connect(tag)&amp;#10; logging.log(logging.DEBUG_NFC, r)&amp;#10;&amp;#10; if (r &gt;= 0):&amp;#10; logging.log(logging.DEBUG_NFC, 'ntag21x_get_info')&amp;#10; r = ntag21x_get_info(tag)&amp;#10; logging.log(logging.DEBUG_NFC, r)&amp;#10; if (r &gt;= 0):&amp;#10; logging.log(logging.DEBUG_NFC, 'ntag21x_get_subtype')&amp;#10; r_subtype = ntag21x_get_subtype(tag)&amp;#10; logging.log(logging.DEBUG_NFC, r_subtype)&amp;#10;&amp;#10; if r_subtype != NTAG_213:&amp;#10; logging.log(logging.DEBUG_NFC, "Wrong subtype, NTAG_213 expected, ",r_subtype )&amp;#10; break&amp;#10;&amp;#10; logging.log(logging.DEBUG_NFC, '_inner_func -&gt;')&amp;#10;&amp;#10; r = _inner_func()&amp;#10; logging.log(logging.DEBUG_NFC, r) &amp;#10; logging.log(logging.DEBUG_NFC, '_inner_func &lt;-')&amp;#10; &amp;#10; &amp;#10; logging.log(logging.DEBUG_NFC, 'ntag21x_disconnect')&amp;#10; ntag21x_disconnect(tag)&amp;#10;&amp;#10; #read only first tag in tags:&amp;#10; break&amp;#10;&amp;#10; logging.log(logging.DEBUG_NFC, "freefare_free_tags")&amp;#10; freefare_free_tags(tags)&amp;#10;&amp;#10; if target_uid != None:&amp;#10; break&amp;#10; except Exception as e:&amp;#10; target_uid = None&amp;#10; #ntag21x_disconnect(tag)&amp;#10; #freefare_free_tags(tags)&amp;#10; #print_nfc_data()&amp;#10; #traceback.print_exc(file=sys.stdout)&amp;#10; #logging.warning(e)&amp;#10; logging.log(logging.DEBUG_NFC, e)</field>
<field name="value">global tag&amp;#10;def _internal_func_ntag21x():&amp;#10; global tag&amp;#10; target_uid = None&amp;#10; try:&amp;#10; for target in nfc_obj.poll(modulations=((pynfc.nfc.NMT_ISO14443A, pynfc.nfc.NBR_424),), times=0x05, delay=1):&amp;#10; &amp;#10; target_uid = target.uid.decode('utf-8')&amp;#10; nfc_data[0] = target_uid&amp;#10; _print_device_target(target)&amp;#10;&amp;#10; logging.log(logging.DEBUG_NFC, "freefare_get_tags")&amp;#10; tags = freefare_get_tags(nfc_obj.pdevice)&amp;#10; logging.log(logging.DEBUG_NFC, "tags")&amp;#10;&amp;#10; for tag in tags:&amp;#10; logging.log(logging.DEBUG_NFC, "*")&amp;#10; logging.log(logging.DEBUG_NFC, "tag")&amp;#10; logging.log(logging.DEBUG_NFC, "type(tag)")&amp;#10;&amp;#10; logging.log(logging.DEBUG_NFC, 'freefare_get_tag_type')&amp;#10; r_type = freefare_get_tag_type(tag)&amp;#10; logging.log(logging.DEBUG_NFC, r_type)&amp;#10;&amp;#10; # read only NTAG21x tags&amp;#10; if r_type != 7:&amp;#10; logging.log(logging.DEBUG_NFC, "No NTAG21x tag! ", r_type)&amp;#10; friendly_name = ctypes.string_at(freefare_get_tag_friendly_name(tag))&amp;#10; logging.log(logging.DEBUG_NFC, friendly_name)&amp;#10; break&amp;#10;&amp;#10; logging.log(logging.DEBUG_NFC, 'ntag21x_connect')&amp;#10; r = ntag21x_connect(tag)&amp;#10; logging.log(logging.DEBUG_NFC, r)&amp;#10;&amp;#10; if (r &gt;= 0):&amp;#10; logging.log(logging.DEBUG_NFC, 'ntag21x_get_info')&amp;#10; r = ntag21x_get_info(tag)&amp;#10; logging.log(logging.DEBUG_NFC, r)&amp;#10; if (r &gt;= 0):&amp;#10; logging.log(logging.DEBUG_NFC, 'ntag21x_get_subtype')&amp;#10; r_subtype = ntag21x_get_subtype(tag)&amp;#10; logging.log(logging.DEBUG_NFC, r_subtype)&amp;#10;&amp;#10; if r_subtype != NTAG_213:&amp;#10; logging.log(logging.DEBUG_NFC, "Wrong subtype, NTAG_213 expected, ",r_subtype )&amp;#10; break&amp;#10;&amp;#10; logging.log(logging.DEBUG_NFC, '_inner_func -&gt;')&amp;#10;&amp;#10; r = _inner_func()&amp;#10; logging.log(logging.DEBUG_NFC, r) &amp;#10; logging.log(logging.DEBUG_NFC, '_inner_func &lt;-')&amp;#10; &amp;#10; &amp;#10; logging.log(logging.DEBUG_NFC, 'ntag21x_disconnect')&amp;#10; ntag21x_disconnect(tag)&amp;#10;&amp;#10; #read only first tag in tags:&amp;#10; break&amp;#10;&amp;#10; logging.log(logging.DEBUG_NFC, "freefare_free_tags")&amp;#10; freefare_free_tags(tags)&amp;#10;&amp;#10; if target_uid != None:&amp;#10; break&amp;#10; except Exception as e:&amp;#10; target_uid = None&amp;#10; #ntag21x_disconnect(tag)&amp;#10; #freefare_free_tags(tags)&amp;#10; #print_nfc_data()&amp;#10; #traceback.print_exc(file=sys.stdout)&amp;#10; #logging.warning(e)&amp;#10; logging.log(logging.DEBUG_NFC, e)</field>
<next>
<block type="util_python" id="HcOukw^4VRN/XyT3vsVi" inline="true">
<field name="value">logging.log(logging.TRACE0_NFC, '&lt;-')</field>
......
......@@ -50,7 +50,7 @@ def nfc_read_uid():
nfc_data = [None, None, None, None, [None] * 8]
target_uid = None
try:
for target in nfc_obj.poll(modulations=((pynfc.nfc.NMT_ISO14443A, pynfc.nfc.NBR_424),), times=0x01, delay=1):
for target in nfc_obj.poll(modulations=((pynfc.nfc.NMT_ISO14443A, pynfc.nfc.NBR_424),), times=0x05, delay=1):
target_uid = target.uid.decode('utf-8')
......@@ -73,7 +73,7 @@ def _wrapper_ntag21x(_inner_func):
global tag
target_uid = None
try:
for target in nfc_obj.poll(modulations=((pynfc.nfc.NMT_ISO14443A, pynfc.nfc.NBR_424),), times=0x01, delay=1):
for target in nfc_obj.poll(modulations=((pynfc.nfc.NMT_ISO14443A, pynfc.nfc.NBR_424),), times=0x05, delay=1):
target_uid = target.uid.decode('utf-8')
nfc_data[0] = target_uid
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment