All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bluetooth Low Energy] Pairing and writing characteristic property issue
@ 2013-09-11 12:34 Nedim Hadzic
  2013-09-12 16:55 ` Nedim Hadzic
  0 siblings, 1 reply; 5+ messages in thread
From: Nedim Hadzic @ 2013-09-11 12:34 UTC (permalink / raw)
  To: linux-bluetooth

Hello everyone,

Recently I started working with Bluetooth Low Energy devices on Linux (developing some applications, testing devices etc). I am using two Bluetooth Low Energy devices SensorTag from Texas Instruments and HearRateMonitor BlueHR. 

Bluez version: 4.101-0ubuntu8b1

SensorTag: I can connect to the device, read and write characteristic values using gatttool and I can pair with the device using a simple-agent tool for this. After I pair with the device, I want to change value of the characteristic using org.bluez.Characteristic interface and SetProperty method, but it does not change; nor PropertyChanged signal is emitted nor I get any error. I checked hcidump:
2013-09-11 12:07:15.827211 < ACL data: handle 75 flags 0x00 dlen 8
    ATT: Write cmd (0x52)
      handle 0x0029 value  0x01

In case of changing the characteristic value with gatttool hcidump is following:
2013-09-11 12:20:07.239012 < ACL data: handle 75 flags 0x00 dlen 8
    ATT: Write req (0x12)
      handle 0x0029 value  0x01

Difference is in part of write cmd and req. Only difference between these two approaches is that with gatttool, you first connect to LE device (LE Create Connection in hcidump), and in hcdump when accessing through interface and using method SetProperty there is no interface or method for connecting. Any guesses what can be done? 


HearRateMonitor: I can connect to the device, read characteristic values using gatttool ( with adding "-t random" part to the command), but I can not pair with the device using simple-agent: Error: Creating device failed: org.bluez.Error.AuthenticationFailed: Authentication Failed.
Hcidump is the following:
2013-09-11 11:58:41.747749 < HCI Command: LE Create Connection (0x08|0x000d) plen 25
    bdaddr D5:EA:8B:A9:EC:70 type 1
2013-09-11 11:58:41.751989 > HCI Event: Command Status (0x0f) plen 4
    LE Create Connection (0x08|0x000d) status 0x00 ncmd 1
2013-09-11 11:58:44.311996 > HCI Event: LE Meta Event (0x3e) plen 19
    LE Connection Complete
      status 0x00 handle 75, role master
      bdaddr D5:EA:8B:A9:EC:70 (Random)
2013-09-11 11:58:44.312173 < ACL data: handle 75 flags 0x00 dlen 11
    SMP: Pairing Request (0x01)
      capability 0x04 oob 0x00 auth req 0x01
      max key size 0x10 init key dist 0x00 resp key dist 0x01
      Capability: KeyboardDisplay (OOB data not present)
      Authentication: Bonding (No MITM Protection)
      Initiator Key Distribution:    
      Responder Key Distribution:  LTK  
2013-09-11 11:58:44.348985 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 75 packets 1
2013-09-11 11:58:44.418969 > ACL data: handle 75 flags 0x02 dlen 6
    SMP: Pairing Failed (0x05)
      reason 0x05
      Reason Pairing Not Supported
2013-09-11 11:58:44.560004 > HCI Event: Disconn Complete (0x05) plen 4
    status 0x00 handle 75 reason 0x13
    Reason: Remote User Terminated Connection

This device is using random device address, but I do not know how to pair with it in that case. I try to pair with it using a smartphone with support and it is working. Any help, or input on this?

Looking forward to reply;

Kind regards,
Nedim Hadzic
---------------------------------------------------------------------
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [Bluetooth Low Energy] Pairing and writing characteristic property issue
  2013-09-11 12:34 [Bluetooth Low Energy] Pairing and writing characteristic property issue Nedim Hadzic
@ 2013-09-12 16:55 ` Nedim Hadzic
  2013-09-13 12:39   ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 5+ messages in thread
From: Nedim Hadzic @ 2013-09-12 16:55 UTC (permalink / raw)
  To: linux-bluetooth

Hi again,

I am not sure if I sent mail to wrong list, but if I did can someone inform me. I am still having a problems with this issues so I would appreciate some help.

Kind regards,
Nedim
________________________________________
From: linux-bluetooth-owner@vger.kernel.org [linux-bluetooth-owner@vger.kernel.org] on behalf of Nedim Hadzic [nhadzic@blackberry.com]
Sent: 11 September 2013 07:34
To: linux-bluetooth@vger.kernel.org
Subject: [Bluetooth Low Energy] Pairing and writing characteristic property issue

Hello everyone,

Recently I started working with Bluetooth Low Energy devices on Linux (developing some applications, testing devices etc). I am using two Bluetooth Low Energy devices SensorTag from Texas Instruments and HearRateMonitor BlueHR.

Bluez version: 4.101-0ubuntu8b1

SensorTag: I can connect to the device, read and write characteristic values using gatttool and I can pair with the device using a simple-agent tool for this. After I pair with the device, I want to change value of the characteristic using org.bluez.Characteristic interface and SetProperty method, but it does not change; nor PropertyChanged signal is emitted nor I get any error. I checked hcidump:
2013-09-11 12:07:15.827211 < ACL data: handle 75 flags 0x00 dlen 8
    ATT: Write cmd (0x52)
      handle 0x0029 value  0x01

In case of changing the characteristic value with gatttool hcidump is following:
2013-09-11 12:20:07.239012 < ACL data: handle 75 flags 0x00 dlen 8
    ATT: Write req (0x12)
      handle 0x0029 value  0x01

Difference is in part of write cmd and req. Only difference between these two approaches is that with gatttool, you first connect to LE device (LE Create Connection in hcidump), and in hcdump when accessing through interface and using method SetProperty there is no interface or method for connecting. Any guesses what can be done?


HearRateMonitor: I can connect to the device, read characteristic values using gatttool ( with adding "-t random" part to the command), but I can not pair with the device using simple-agent: Error: Creating device failed: org.bluez.Error.AuthenticationFailed: Authentication Failed.
Hcidump is the following:
2013-09-11 11:58:41.747749 < HCI Command: LE Create Connection (0x08|0x000d) plen 25
    bdaddr D5:EA:8B:A9:EC:70 type 1
2013-09-11 11:58:41.751989 > HCI Event: Command Status (0x0f) plen 4
    LE Create Connection (0x08|0x000d) status 0x00 ncmd 1
2013-09-11 11:58:44.311996 > HCI Event: LE Meta Event (0x3e) plen 19
    LE Connection Complete
      status 0x00 handle 75, role master
      bdaddr D5:EA:8B:A9:EC:70 (Random)
2013-09-11 11:58:44.312173 < ACL data: handle 75 flags 0x00 dlen 11
    SMP: Pairing Request (0x01)
      capability 0x04 oob 0x00 auth req 0x01
      max key size 0x10 init key dist 0x00 resp key dist 0x01
      Capability: KeyboardDisplay (OOB data not present)
      Authentication: Bonding (No MITM Protection)
      Initiator Key Distribution:
      Responder Key Distribution:  LTK
2013-09-11 11:58:44.348985 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 75 packets 1
2013-09-11 11:58:44.418969 > ACL data: handle 75 flags 0x02 dlen 6
    SMP: Pairing Failed (0x05)
      reason 0x05
      Reason Pairing Not Supported
2013-09-11 11:58:44.560004 > HCI Event: Disconn Complete (0x05) plen 4
    status 0x00 handle 75 reason 0x13
    Reason: Remote User Terminated Connection

This device is using random device address, but I do not know how to pair with it in that case. I try to pair with it using a smartphone with support and it is working. Any help, or input on this?


Looking forward to reply;

Kind regards,
Nedim Hadzic
---------------------------------------------------------------------
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.
--
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 transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bluetooth Low Energy] Pairing and writing characteristic property issue
  2013-09-12 16:55 ` Nedim Hadzic
@ 2013-09-13 12:39   ` Luiz Augusto von Dentz
  2013-09-13 12:57     ` Johan Hedberg
  0 siblings, 1 reply; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2013-09-13 12:39 UTC (permalink / raw)
  To: Nedim Hadzic; +Cc: linux-bluetooth

Hi Nedim,

On Thu, Sep 12, 2013 at 7:55 PM, Nedim Hadzic <nhadzic@blackberry.com> wrote:
> Hi again,
>
> I am not sure if I sent mail to wrong list, but if I did can someone inform me. I am still having a problems with this issues so I would appreciate some help.

First I should let you know that we don't top post on linux-bluetooth,
so please when you reply please do inline comments.

> ________________________________________
> From: linux-bluetooth-owner@vger.kernel.org [linux-bluetooth-owner@vger.kernel.org] on behalf of Nedim Hadzic [nhadzic@blackberry.com]
> Sent: 11 September 2013 07:34
> To: linux-bluetooth@vger.kernel.org
> Subject: [Bluetooth Low Energy] Pairing and writing characteristic property issue
>
> Hello everyone,
>
> Recently I started working with Bluetooth Low Energy devices on Linux (developing some applications, testing devices etc). I am using two Bluetooth Low Energy devices SensorTag from Texas Instruments and HearRateMonitor BlueHR.
>
> Bluez version: 4.101-0ubuntu8b1
>
> SensorTag: I can connect to the device, read and write characteristic values using gatttool and I can pair with the device using a simple-agent tool for this. After I pair with the device, I want to change value of the characteristic using org.bluez.Characteristic interface and SetProperty method, but it does not change; nor PropertyChanged signal is emitted nor I get any error. I checked hcidump:
> 2013-09-11 12:07:15.827211 < ACL data: handle 75 flags 0x00 dlen 8
>     ATT: Write cmd (0x52)
>       handle 0x0029 value  0x01
>
> In case of changing the characteristic value with gatttool hcidump is following:
> 2013-09-11 12:20:07.239012 < ACL data: handle 75 flags 0x00 dlen 8
>     ATT: Write req (0x12)
>       handle 0x0029 value  0x01
>
> Difference is in part of write cmd and req. Only difference between these two approaches is that with gatttool, you first connect to LE device (LE Create Connection in hcidump), and in hcdump when accessing through interface and using method SetProperty there is no interface or method for connecting. Any guesses what can be done?
>
>
> HearRateMonitor: I can connect to the device, read characteristic values using gatttool ( with adding "-t random" part to the command), but I can not pair with the device using simple-agent: Error: Creating device failed: org.bluez.Error.AuthenticationFailed: Authentication Failed.
> Hcidump is the following:
> 2013-09-11 11:58:41.747749 < HCI Command: LE Create Connection (0x08|0x000d) plen 25
>     bdaddr D5:EA:8B:A9:EC:70 type 1
> 2013-09-11 11:58:41.751989 > HCI Event: Command Status (0x0f) plen 4
>     LE Create Connection (0x08|0x000d) status 0x00 ncmd 1
> 2013-09-11 11:58:44.311996 > HCI Event: LE Meta Event (0x3e) plen 19
>     LE Connection Complete
>       status 0x00 handle 75, role master
>       bdaddr D5:EA:8B:A9:EC:70 (Random)
> 2013-09-11 11:58:44.312173 < ACL data: handle 75 flags 0x00 dlen 11
>     SMP: Pairing Request (0x01)
>       capability 0x04 oob 0x00 auth req 0x01
>       max key size 0x10 init key dist 0x00 resp key dist 0x01
>       Capability: KeyboardDisplay (OOB data not present)
>       Authentication: Bonding (No MITM Protection)
>       Initiator Key Distribution:
>       Responder Key Distribution:  LTK
> 2013-09-11 11:58:44.348985 > HCI Event: Number of Completed Packets (0x13) plen 5
>     handle 75 packets 1
> 2013-09-11 11:58:44.418969 > ACL data: handle 75 flags 0x02 dlen 6
>     SMP: Pairing Failed (0x05)
>       reason 0x05
>       Reason Pairing Not Supported
> 2013-09-11 11:58:44.560004 > HCI Event: Disconn Complete (0x05) plen 4
>     status 0x00 handle 75 reason 0x13
>     Reason: Remote User Terminated Connection
>
> This device is using random device address, but I do not know how to pair with it in that case. I try to pair with it using a smartphone with support and it is working. Any help, or input on this?

I believe we don't support pairing with devices using random/private,
but you should probably upgrade if you are planning to use Bluetooth
LE BlueZ 5.x is recommended.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bluetooth Low Energy] Pairing and writing characteristic property issue
  2013-09-13 12:39   ` Luiz Augusto von Dentz
@ 2013-09-13 12:57     ` Johan Hedberg
  2013-09-13 13:05       ` Johan Hedberg
  0 siblings, 1 reply; 5+ messages in thread
From: Johan Hedberg @ 2013-09-13 12:57 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: Nedim Hadzic, linux-bluetooth

Hi Luiz,

On Fri, Sep 13, 2013, Luiz Augusto von Dentz wrote:
> > This device is using random device address, but I do not know how to
> > pair with it in that case. I try to pair with it using a smartphone
> > with support and it is working. Any help, or input on this?
> 
> I believe we don't support pairing with devices using random/private,
> but you should probably upgrade if you are planning to use Bluetooth
> LE BlueZ 5.x is recommended.

In general we don't really support any LE related stuff with BlueZ 4
simply because LE pairing requires the mgmt interface and it wasn't
stable yet during BlueZ 4 times.

Regarding pairing with random addressed devices, BlueZ 5 will allow that
but only for a single connection. Once you disconnect the pairing info
is gone since it'd anyway be unusable if the remote side changed its
address. Until we get IRK generation support for the kernel this is how
user space will keep behaving.

Johan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bluetooth Low Energy] Pairing and writing characteristic property issue
  2013-09-13 12:57     ` Johan Hedberg
@ 2013-09-13 13:05       ` Johan Hedberg
  0 siblings, 0 replies; 5+ messages in thread
From: Johan Hedberg @ 2013-09-13 13:05 UTC (permalink / raw)
  To: Luiz Augusto von Dentz, Nedim Hadzic, linux-bluetooth

Hi,

On Fri, Sep 13, 2013, Johan Hedberg wrote:
> On Fri, Sep 13, 2013, Luiz Augusto von Dentz wrote:
> > > This device is using random device address, but I do not know how to
> > > pair with it in that case. I try to pair with it using a smartphone
> > > with support and it is working. Any help, or input on this?
> > 
> > I believe we don't support pairing with devices using random/private,
> > but you should probably upgrade if you are planning to use Bluetooth
> > LE BlueZ 5.x is recommended.
> 
> In general we don't really support any LE related stuff with BlueZ 4
> simply because LE pairing requires the mgmt interface and it wasn't
> stable yet during BlueZ 4 times.
> 
> Regarding pairing with random addressed devices, BlueZ 5 will allow that
> but only for a single connection. Once you disconnect the pairing info
> is gone since it'd anyway be unusable if the remote side changed its
> address. Until we get IRK generation support for the kernel this is how
> user space will keep behaving.

Correcting myself: it's only private random address devices that will
have this behavior; static random addresses will work fine and keep the
pairing info persistent.

Johan

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-09-13 13:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-11 12:34 [Bluetooth Low Energy] Pairing and writing characteristic property issue Nedim Hadzic
2013-09-12 16:55 ` Nedim Hadzic
2013-09-13 12:39   ` Luiz Augusto von Dentz
2013-09-13 12:57     ` Johan Hedberg
2013-09-13 13:05       ` Johan Hedberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.