The sense example demonstrates the use of the
nfc.clf.ContactlessFrontend.sense() method to discover
$ sense.py [target [target ...]] [options]
The target arguments define the type, bitrate and optional
attributes for the contactless targets that may be discovered in a
single sense loop. An empty loop (no targets) is allowed but is only
useful to verify the
behavior. Optional arguments allow to set an iteration count and
interval, continously repeat the (iterated) loop after a wait time,
activate standard or verbose debug logs, and to specify the local
device to use.
A target is specified by bitrate and a type identifier
F. The following example would first sense for a DEP Target at
106kbps (in active communication mode), then for a Type A Target at
106 kbps, a Type B Target at 106kbps and a Type F Target at
$ sense.py 106A 106B 212F
Additional parameters can be supplied as comma-delimited name=value pairs in brackets. The example below searches for a 106 kbps DEP Target (in active communication mode) and then changes communication speed to 424 kbps.
$ sense.py '106A(atr_req=d400FFFFFFFFFFFFFFFF62260000003246666d010110)' $ sense.py 106A --atr d400FFFFFFFFFFFFFFFF62260000003246666d010110
Show a help message and exit.
Attempt a DEP Target activation in passive communication mode when an appropriate Type A or Type F Target was discovered in in the main sense loop. The params argument defines optional attributes for the
nfc.clf.DEPtarget object. The example below would try a DEP Target activation (in passive communication mode) with a parameter change to 424 kbps after 106 kbps Type A Target discovery.
$ sense.py 106A --dep 'psl_req=D404001203'
Specifies the number of iterations to run (default is 1 iteration). Each iteration is a sense for all the targets given as positional arguments.
The time between two iterations (default is 0.2 sec). It is measured from the start of one iteration to the start of the next iteration, effectively it will thus never be shorter than the execution time of an iteration.
Forever repeat the sense loop (including the number of iterations). Execution can be terminated with Ctrl-C.
Wait the specified number of seconds between repetitions (the default wait time is 0.1 sec).
Activate debug log messages on standard error output.
Activate more debug log messages, most notably all commands send to the local device will be logged as well as their responses.