* Detect client connection using dbus api @ 2015-06-18 8:24 dogan yazar 2015-06-18 8:31 ` Andrejs Hanins 0 siblings, 1 reply; 5+ messages in thread From: dogan yazar @ 2015-06-18 8:24 UTC (permalink / raw) To: linux-bluetooth I use gatt-api to register my services but then could not find a way to detect that a client is connected and discovering my services. Any ideas? ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Detect client connection using dbus api 2015-06-18 8:24 Detect client connection using dbus api dogan yazar @ 2015-06-18 8:31 ` Andrejs Hanins 2015-06-18 9:02 ` dogan yazar 0 siblings, 1 reply; 5+ messages in thread From: Andrejs Hanins @ 2015-06-18 8:31 UTC (permalink / raw) To: dogan yazar, linux-bluetooth Hi, On 06/18/2015 11:24 AM, dogan yazar wrote: > I use gatt-api to register my services but then could not find a way > to detect that a client is connected and discovering my services. > Any ideas? In case of connected client, there will be a org.bluez.Device1 object created with Connected propery set to "true". So if you would like to track connect/disconnect events, you should listed for this property changes. At least, this is how I do it. > -- > 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 http://vger.kernel.org/majordomo-info.html > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Detect client connection using dbus api 2015-06-18 8:31 ` Andrejs Hanins @ 2015-06-18 9:02 ` dogan yazar 2015-06-18 9:19 ` Andrejs Hanins 0 siblings, 1 reply; 5+ messages in thread From: dogan yazar @ 2015-06-18 9:02 UTC (permalink / raw) To: Andrejs Hanins; +Cc: linux-bluetooth Thanks for the answer. How does it differentiate if it is a client or a server? If bluez work as a client and connect to a device, same property will be set anyway. On Thu, Jun 18, 2015 at 10:31 AM, Andrejs Hanins <andrejs.hanins@ubnt.com> wrote: > Hi, > > On 06/18/2015 11:24 AM, dogan yazar wrote: >> I use gatt-api to register my services but then could not find a way >> to detect that a client is connected and discovering my services. >> Any ideas? > In case of connected client, there will be a org.bluez.Device1 object created > with Connected propery set to "true". So if you would like to track connect/disconnect > events, you should listed for this property changes. At least, this is how I do it. >> -- >> 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 http://vger.kernel.org/majordomo-info.html >> ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Detect client connection using dbus api 2015-06-18 9:02 ` dogan yazar @ 2015-06-18 9:19 ` Andrejs Hanins 2015-06-22 9:28 ` dogan yazar 0 siblings, 1 reply; 5+ messages in thread From: Andrejs Hanins @ 2015-06-18 9:19 UTC (permalink / raw) To: dogan yazar; +Cc: linux-bluetooth On 06/18/2015 12:02 PM, dogan yazar wrote: > Thanks for the answer. How does it differentiate if it is a client or > a server? If bluez work as a client and connect to a device, same > property will be set anyway. Just an idea: If BlueZ is a client, then someone does initiate the connect explicitly by calling Connect() D-Bus method on a given device path, so we know whom we are connecting to. But there may be a better way... > > On Thu, Jun 18, 2015 at 10:31 AM, Andrejs Hanins > <andrejs.hanins@ubnt.com> wrote: >> Hi, >> >> On 06/18/2015 11:24 AM, dogan yazar wrote: >>> I use gatt-api to register my services but then could not find a way >>> to detect that a client is connected and discovering my services. >>> Any ideas? >> In case of connected client, there will be a org.bluez.Device1 object created >> with Connected propery set to "true". So if you would like to track connect/disconnect >> events, you should listed for this property changes. At least, this is how I do it. >>> -- >>> 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 http://vger.kernel.org/majordomo-info.html >>> ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Detect client connection using dbus api 2015-06-18 9:19 ` Andrejs Hanins @ 2015-06-22 9:28 ` dogan yazar 0 siblings, 0 replies; 5+ messages in thread From: dogan yazar @ 2015-06-22 9:28 UTC (permalink / raw) To: Andrejs Hanins; +Cc: linux-bluetooth Thanks. Yeah could not really find a better way for now. On Thu, Jun 18, 2015 at 11:19 AM, Andrejs Hanins <andrejs.hanins@ubnt.com> wrote: > > > On 06/18/2015 12:02 PM, dogan yazar wrote: >> Thanks for the answer. How does it differentiate if it is a client or >> a server? If bluez work as a client and connect to a device, same >> property will be set anyway. > Just an idea: If BlueZ is a client, then someone does initiate the connect > explicitly by calling Connect() D-Bus method on a given device path, so we > know whom we are connecting to. But there may be a better way... > >> >> On Thu, Jun 18, 2015 at 10:31 AM, Andrejs Hanins >> <andrejs.hanins@ubnt.com> wrote: >>> Hi, >>> >>> On 06/18/2015 11:24 AM, dogan yazar wrote: >>>> I use gatt-api to register my services but then could not find a way >>>> to detect that a client is connected and discovering my services. >>>> Any ideas? >>> In case of connected client, there will be a org.bluez.Device1 object created >>> with Connected propery set to "true". So if you would like to track connect/disconnect >>> events, you should listed for this property changes. At least, this is how I do it. >>>> -- >>>> 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 http://vger.kernel.org/majordomo-info.html >>>> -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-06-22 9:28 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-06-18 8:24 Detect client connection using dbus api dogan yazar 2015-06-18 8:31 ` Andrejs Hanins 2015-06-18 9:02 ` dogan yazar 2015-06-18 9:19 ` Andrejs Hanins 2015-06-22 9:28 ` dogan yazar
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).