Return-Path: From: "Stotland, Inga" To: "laczenjms@gmail.com" CC: "linux-bluetooth@vger.kernel.org" Subject: Re: [PATCH 1/1] mesh: Remove StopNotify method to avoid reading data twice on some mesh nodes Date: Fri, 8 Sep 2017 22:29:55 +0000 Message-ID: <1504909793.9732.2.camel@intel.com> References: In-Reply-To: Content-Type: multipart/signed; micalg=sha-1; protocol="application/x-pkcs7-signature"; boundary="=-e2vOtjJwfuwRRwhdKveq" MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org List-ID: --=-e2vOtjJwfuwRRwhdKveq Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Jehudi, On Fri, 2017-09-08 at 16:25 +0200, Laczen JMS wrote: > Hi Luiz, >=20 > Probably my analysis of the cause is wrong. I added a rl_printf when > the StopNotify was called, meshctl shows the following: >=20 > Notify started > Notify for Mesh Provisioning Out Data started > Open-Node: 0x102c470 > Open-Prov: 0xff7000 > Open-Prov: proxy 0xffe830 > GATT-TX:=C2=A0=C2=A003 00 10 > Attempting to write > /org/bluez/hci0/dev_C3_F0_13_5D_5F_5E/service000a/char000b > Initiated provisioning > Characteristic property changed > /org/bluez/hci0/dev_C3_F0_13_5D_5F_5E/service000a/char000d > GATT-RX: 03 01 01 00 01 00 00 00 00 00 00 00 00 > Got provisioning data (12 bytes) > 01 01 00 01 00 00 00 00 00 00 00 00 > Provisioning failed > Calling StopNotify --------------> added by me using rl_printf() > Characteristic property changed > /org/bluez/hci0/dev_C3_F0_13_5D_5F_5E/service000a/char000d > GATT-RX: 03 01 01 00 01 00 00 00 00 00 00 00 00 > Node not found? > Notify stopped > Attempting to disconnect from C3:F0:13:5D:5F:5E > Services resolved no >=20 > As you can see the same data is received twice: GATT-RX: 03 01 01 00 > 01 ..., just after the Characteristic property changed line. I > thought > that this Characteristic property change was the result of the not > changing of the node and keeping notifications on. >=20 > I also enable btmon during this process (see included file). In the > log I cannot find the data being send twice. >=20 > Kind regards, >=20 > Jehudi >=20 > 2017-09-08 15:47 GMT+02:00 Luiz Augusto von Dentz om>: > > Hi Jehudi, > >=20 > > On Fri, Sep 8, 2017 at 3:30 PM, Laczen JMS > > wrote: > > > Some mesh nodes do not change (e.g. zephyr) the notification when > > > given the StopNotify. As a result the data from the notification > > > channel is processed twice. This patch removes the StopNotify. > >=20 > > What do you mean the node do not change? Perhaps this is the result > > of > > bluetoothd remembering the subscriptions so you don't have to > > StopNotify while disconnected, though this should not cause the > > data > > to be processed twice otherwise we have a bug somewhere in the > > daemon. > >=20 > > > Kind regards, > > >=20 > > > Jehudi > > >=20 > > > =C2=A0 diff --git a/mesh/gatt.c b/mesh/gatt.c > > > index f9615b3..7d3b869 100644 > > > --- a/mesh/gatt.c > > > +++ b/mesh/gatt.c > > > @@ -589,15 +589,10 @@ bool mesh_gatt_notify(GDBusProxy *proxy, > > > bool > > > enable, GDBusReturnFunction cb, > > > =C2=A0 cb =3D notify_reply; > > > =C2=A0 } > > > =C2=A0 } else { > > > - if (notify_io) { > > > - notify_io_destroy(); > > > - if (cb) > > > - cb(NULL, user_data); > > > - return true; > > > - } else { > > > - method =3D "StopNotify"; > > > - cb =3D notify_reply; > > > - } > > > + if (notify_io) notify_io_destroy(); > > > + if (cb) cb(NULL, user_data); > > > + > > > + return true; > > > =C2=A0 } > > >=20 > > > =C2=A0 if (g_dbus_proxy_method_call(proxy, method, NULL, cb, > > > -- > > > To unsubscribe from this list: send the line "unsubscribe linux- > > > bluetooth" in > > > the body of a message to majordomo@vger.kernel.org > > > More majordomo info at=C2=A0=C2=A0http://vger.kernel.org/majordomo-in= fo.htm > > > l > >=20 > >=20 > >=20 > > -- > > Luiz Augusto von Dentz Thank you for your analysis of the issue. A patch (subject "PATCH BlueZ] mesh: Add characteristic property name check") has been submitted and (I believe) should take care of seeing duplicate GATT-RX output. Regards, Inga --=-e2vOtjJwfuwRRwhdKveq Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Disposition: attachment; filename="smime.p7s" Content-Transfer-Encoding: base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