aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Escande <thierry.escande@collabora.com>2016-06-29 10:38:33 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2016-07-04 13:02:36 +0200
commit4d060165aedd5a0e7592a3d20889ec281d13f962 (patch)
tree84263ce82b5b25d05ba5a0953e7537d9d62960b7
parent421fd97857dee92e258aeea233d3cc6210a21d49 (diff)
downloadneard-4d060165aedd5a0e7592a3d20889ec281d13f962.tar.gz
nfctool: polling: Fix netlink event handler
With this patch, the netlink event handler for poll operations now only treats messages from the device specified with the -d command line parameter. This fixes an issue when used with nfcsim (the loopback driver) for which you have 2 instances of nfctool running simultaneously in poll mode. Both instances were receiving the TARGETS_FOUND and TM_ACTIVATED events which could lead to prematurely stop the poll operation for the target device. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r--tools/nfctool/main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/nfctool/main.c b/tools/nfctool/main.c
index 00b099f..c9a236f 100644
--- a/tools/nfctool/main.c
+++ b/tools/nfctool/main.c
@@ -305,6 +305,9 @@ static int nfctool_poll_cb(guint8 cmd, guint32 idx, gpointer data)
{
int err = 0;
+ if (idx != opts.adapter_idx)
+ return 0;
+
DBG("cmd: %d, idx: %d", cmd, idx);
switch (cmd) {