@@ -56,11 +56,11 @@ def __init__(self, **kwargs):
56
56
Bench .__init__ (self , ** testcase_args )
57
57
58
58
def setup (self ):
59
- try :
59
+ # try:
60
60
self .clf = ContactlessCommandRunner ()
61
- self .clf .parse ( " mute" )
62
- except :
63
- raise asserts .TestStepFail ("Could not find NFC reader" )
61
+ self .clf .nfc . mute ( )
62
+ # except:
63
+ # raise asserts.TestStepFail("Could not find NFC reader")
64
64
65
65
def teardown (self ):
66
66
self .logger .info ("Test teardown: Reboot target..." )
@@ -83,7 +83,7 @@ def test_nfce2e_target_found(self):
83
83
if not eeprom :
84
84
self .nfc_command ("dev1" , "start" )
85
85
86
- self .clf .parse ( " connect" )
86
+ self .clf .nfc . connect ( )
87
87
tag = self .clf .clf_response ()
88
88
asserts .assertNotNone (tag , "Could not connect to any tag" )
89
89
@@ -103,7 +103,7 @@ def test_nfce2e_type4_found(self):
103
103
if not eeprom :
104
104
self .nfc_command ("dev1" , "start" )
105
105
106
- self .clf .parse ( " connect" )
106
+ self .clf .nfc . connect ( )
107
107
tag = self .clf .clf_response ()
108
108
asserts .assertNotNone (tag , "Could not connect to any tag" )
109
109
@@ -129,7 +129,7 @@ def test_nfce2e_smartposter(self):
129
129
# write poster tag to target
130
130
self .command ("dev1" , "setsmartposter %s" % expectedURI )
131
131
132
- self .clf .parse ( " connect" )
132
+ self .clf .nfc . connect ( )
133
133
tag = self .clf .clf_response ()
134
134
asserts .assertNotNone (tag , "Could not connect to any tag" )
135
135
asserts .assertEqual (1 , len (tag .ndef .records ), "expected number NDEF records" )
@@ -156,21 +156,21 @@ def test_nfce2e_reprogrammed(self):
156
156
157
157
# program a poster tag to target
158
158
print ("Write Smartposter MESSAGE wirelessly" )
159
- self .clf .parse ( " connect" )
159
+ self .clf .nfc . connect ( )
160
160
tag = self .clf .clf_response ()
161
161
asserts .assertNotNone (tag , "Could not connect to any tag" )
162
162
smartposter = nfc_messages .make_smartposter (expectedURI , ["en-US:Other search engines exist" ])
163
163
nfc_messages .program_remote_tag (smartposter , tag )
164
164
self .logger .info ("Remote programmed %d bytes Smartposter" % len (str (smartposter )))
165
165
166
166
print ("Write back Smartposter MESSAGE wirelessly" )
167
- self .clf .parse ( " connect" )
167
+ self .clf .nfc . connect ( )
168
168
tag = self .clf .clf_response ()
169
169
asserts .assertNotNone (tag , "Could not re-connect to any tag" )
170
170
171
171
asserts .assertEqual (tag .ndef .records [0 ].__class__ .__name__ , "SmartposterRecord" , "expected SmartposterRecord" )
172
172
asserts .assertEqual (expectedURI , tag .ndef .records [0 ].uri_records [0 ].uri , "expected exact URI" )
173
- self .clf .parse ( " mute" ) # disable radio, to allow a local session
173
+ self .clf .nfc . mute ( ) # disable radio, to allow a local session
174
174
175
175
# verify in target
176
176
response = self .nfc_command ("dev1" , "readmessage" )
@@ -208,7 +208,7 @@ def test_nfce2e_read_stress(self):
208
208
# write a large message to the tag via API, then read it wirelessly
209
209
print ("Write/set tag MESSAGE (%d) bytes" % textLength )
210
210
self .nfc_command ("dev1" , "writelong %d %s" % (textLength ,messageRep ))
211
- self .clf .parse ( " connect" )
211
+ self .clf .nfc . connect ( )
212
212
tag = self .clf .clf_response ()
213
213
asserts .assertNotNone (tag , "Could not connect to any tag" )
214
214
@@ -249,18 +249,18 @@ def test_nfce2e_reprogrammed_stress(self):
249
249
250
250
# program a large tag to target remotely
251
251
print ("Write tag MESSAGE wirelessly (%d) bytes" % len (str (message )))
252
- self .clf .parse ( " connect" )
252
+ self .clf .nfc . connect ( )
253
253
tag = self .clf .clf_response ()
254
254
asserts .assertNotNone (tag , "Could not connect to any tag" )
255
255
nfc_messages .program_remote_tag (message , tag )
256
256
self .logger .info ("%d bytes chunk of data written to tag remotely" % len (str (message )))
257
257
258
258
# read device locally
259
259
print ("Read back tag MESSAGE wirelessly" )
260
- self .clf .parse ( " connect" )
260
+ self .clf .nfc . connect ( )
261
261
tag = self .clf .clf_response ()
262
262
asserts .assertNotNone (tag , "Could not re-connect to any tag" )
263
- self .clf .parse ( " mute" ) # disable the reader radio, to allow local access
263
+ self .clf .nfc . mute ( ) # disable the reader radio, to allow local access
264
264
265
265
# verify in target
266
266
response = self .nfc_command ("dev1" , "readmessage" )
@@ -285,26 +285,26 @@ def test_nfce2e_discovery_loop(self):
285
285
# Automatic resume after disconnect can be turned off by using command "start man" , the default is "start auto" .
286
286
287
287
if not eeprom :
288
- self .clf .parse ( " connect" )
288
+ self .clf .nfc . connect ( )
289
289
tag = self .clf .clf_response ()
290
290
asserts .assertNone (tag , "post-init: Tag discovery loop should be stopped!" )
291
291
self .nfc_command ("dev1" , "stop" )
292
292
time .sleep (1 )
293
293
294
- self .clf .parse ( " connect" )
294
+ self .clf .nfc . connect ( )
295
295
tag = self .clf .clf_response ()
296
296
asserts .assertNone (tag , "post-stop: Tag discovery loop should be stopped!" )
297
297
self .nfc_command ("dev1" , "start" )
298
298
time .sleep (1 )
299
299
300
- self .clf .parse ( " connect" )
300
+ self .clf .nfc . connect ( )
301
301
tag = self .clf .clf_response ()
302
302
asserts .assertNotNone (tag , "Could not connect to any tag" )
303
303
304
- self .clf .parse ( " mute" )
304
+ self .clf .nfc . mute ( )
305
305
self .nfc_command ("dev1" , "stop" )
306
306
time .sleep (10 )
307
- self .clf .parse ( " connect" )
307
+ self .clf .nfc . connect ( )
308
308
tag = self .clf .clf_response ()
309
309
# test blocked by issue raised IOTPAN313 NFC Controller discovery can stop but cannot restart - PN512
310
310
asserts .assertNone (tag , "post-restart: Tag discovery loop should be stopped!" )
0 commit comments