Return-Path: From: To: CC: Date: Fri, 18 Feb 2011 16:51:18 +0530 Subject: RE: BUG in Mobile initiated pairing Message-ID: <23B1B83C3513ED4B8E8B2B9029CDE8EFC938906159@INDXM3113.dir.svc.accenture.com> References: <23B1B83C3513ED4B8E8B2B9029CDE8EFC9388671C2@INDXM3113.dir.svc.accenture.com> <20110217130322.GA10543@joana> <23B1B83C3513ED4B8E8B2B9029CDE8EFC938867886@INDXM3113.dir.svc.accenture.com> <20110217162719.GF10543@joana> In-Reply-To: <20110217162719.GF10543@joana> Content-Type: multipart/mixed; boundary="_003_23B1B83C3513ED4B8E8B2B9029CDE8EFC938906159INDXM3113dirs_" MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org List-ID: --_003_23B1B83C3513ED4B8E8B2B9029CDE8EFC938906159INDXM3113dirs_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Gustavo, Thanks for your precious time and response. I had modified the agent.c provided in the test folder of BlueZ to support = mobile initiated pairing. I have attached the 1. modified code (agent.c) 2. DBUS monitor logs 3. BlueZ Logs (property changed event "Paired" is not generated) The pairing is successful, but the property changed event "Paired" is not s= een in DBUS monitor. Please let me know your comments on this program. Yes, in Ubuntu 10.10 with the support of Bluetooth-Gnome remote device init= iated pairing works with all the events. Thanks Sachin -----Original Message----- From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-owner@v= ger.kernel.org] On Behalf Of Gustavo F. Padovan Sent: Thursday, February 17, 2011 9:57 PM To: Athanikar, Sachin Cc: linux-bluetooth@vger.kernel.org Subject: Re: BUG in Mobile initiated pairing Hi Sachin, * sachin.athanikar@accenture.com [2011-02-= 17 20:10:38 +0530]: > Hi Gustavo, > Many thanks for the response. > > The property changed event "Paired" is not generated when the mobile init= iated pairing is successful. So I am not able get an acknowledgement for su= ccessful completion of pairing process. Yes, it is. I just tested it before reply to you. -- Gustavo F. Padovan http://profusion.mobi -- 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 This message is for the designated recipient only and may contain privilege= d, proprietary, or otherwise private information. If you have received it = in error, please notify the sender immediately and delete the original. An= y other use of the email by you is prohibited. --_003_23B1B83C3513ED4B8E8B2B9029CDE8EFC938906159INDXM3113dirs_ Content-Type: text/plain; name="dbus-monitor-log.txt" Content-Description: dbus-monitor-log.txt Content-Disposition: attachment; filename="dbus-monitor-log.txt"; size=1037; creation-date="Fri, 18 Feb 2011 16:27:26 GMT"; modification-date="Fri, 18 Feb 2011 16:27:14 GMT" Content-Transfer-Encoding: base64 c2lnbmFsIHNlbmRlcj1vcmcuZnJlZWRlc2t0b3AuREJ1cyAtPiBkZXN0PShudWxsIGRlc3RpbmF0 aW9uKSBzZXJpYWw9NTAgcGF0aD0vb3JnL2ZyZWVkZXNrdG9wL0RCdXM7IGludGVyZmFjZT1vcmcu ZnJlZWRlc2t0b3AuREJ1czsgbWVtYmVyPU5hbWVPd25lckNoYW5nZWQKICAgc3RyaW5nICI6MS44 MiIKICAgc3RyaW5nICIiCiAgIHN0cmluZyAiOjEuODIiCnNpZ25hbCBzZW5kZXI9OjEuNjMgLT4g ZGVzdD0obnVsbCBkZXN0aW5hdGlvbikgc2VyaWFsPTI4NiBwYXRoPS9vcmcvYmx1ZXovMzM0Ni9o Y2kwL2Rldl9BMF80RV8wNF9CQ19BM183OTsgaW50ZXJmYWNlPW9yZy5ibHVlei5EZXZpY2U7IG1l bWJlcj1Qcm9wZXJ0eUNoYW5nZWQKICAgc3RyaW5nICJDb25uZWN0ZWQiCiAgIHZhcmlhbnQgICAg ICAgYm9vbGVhbiB0cnVlCnNpZ25hbCBzZW5kZXI9b3JnLmZyZWVkZXNrdG9wLkRCdXMgLT4gZGVz dD0obnVsbCBkZXN0aW5hdGlvbikgc2VyaWFsPTUxIHBhdGg9L29yZy9mcmVlZGVza3RvcC9EQnVz OyBpbnRlcmZhY2U9b3JnLmZyZWVkZXNrdG9wLkRCdXM7IG1lbWJlcj1OYW1lT3duZXJDaGFuZ2Vk CiAgIHN0cmluZyAiOjEuODMiCiAgIHN0cmluZyAiIgogICBzdHJpbmcgIjoxLjgzIgpzaWduYWwg c2VuZGVyPW9yZy5mcmVlZGVza3RvcC5EQnVzIC0+IGRlc3Q9KG51bGwgZGVzdGluYXRpb24pIHNl cmlhbD01MiBwYXRoPS9vcmcvZnJlZWRlc2t0b3AvREJ1czsgaW50ZXJmYWNlPW9yZy5mcmVlZGVz a3RvcC5EQnVzOyBtZW1iZXI9TmFtZU93bmVyQ2hhbmdlZAogICBzdHJpbmcgIjoxLjgzIgogICBz dHJpbmcgIjoxLjgzIgogICBzdHJpbmcgIiIKc2lnbmFsIHNlbmRlcj06MS42MyAtPiBkZXN0PShu dWxsIGRlc3RpbmF0aW9uKSBzZXJpYWw9Mjg4IHBhdGg9L29yZy9ibHVlei8zMzQ2L2hjaTAvZGV2 X0EwXzRFXzA0X0JDX0EzXzc5OyBpbnRlcmZhY2U9b3JnLmJsdWV6LkRldmljZTsgbWVtYmVyPVBy b3BlcnR5Q2hhbmdlZAogICBzdHJpbmcgIkNvbm5lY3RlZCIKICAgdmFyaWFudCAgICAgICBib29s ZWFuIGZhbHNlCgo= --_003_23B1B83C3513ED4B8E8B2B9029CDE8EFC938906159INDXM3113dirs_ Content-Type: text/plain; name="agent.c" Content-Description: agent.c Content-Disposition: attachment; filename="agent.c"; size=15368; creation-date="Fri, 18 Feb 2011 16:28:46 GMT"; modification-date="Fri, 18 Feb 2011 16:40:38 GMT" Content-Transfer-Encoding: base64 LyoKICoKICogIEJsdWVaIC0gQmx1ZXRvb3RoIHByb3RvY29sIHN0YWNrIGZvciBMaW51eAogKgog KiAgQ29weXJpZ2h0IChDKSAyMDA0LTIwMTAgIE1hcmNlbCBIb2x0bWFubiA8bWFyY2VsQGhvbHRt YW5uLm9yZz4KICoKICoKICogIFRoaXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2F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