2012-01-03 09:47:11

by Vijaykumar Dadmode

[permalink] [raw]
Subject: Multiple Thermometer device connections.

Hi,
Could you please help me with below query?

Usecase:
Have 2 temperature devices connected and set the CCC(Client Char Config) to receive the temperature updates.

Issue:
-- In attio_connected_cb we are calling g_attrib_register(user_data) were we are passing the "user_data" which has the "Device Reference".

So in the callback function "notif_handler" we are getting notified from the 1st connected device, using the "user_data" we are trying to get the "Device Reference", which has the data/info of the 2nd device rather than the 1st device.

How do we retrieve the handle/device reference for the device which is sending the "NOTIFY"?


Thanks,
Vijay


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at http://www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at http://www.csr.com/blog


2012-06-13 11:58:51

by Vijaykumar Dadmode

[permalink] [raw]
Subject: RE: Bluetooth LE scan/pair using MGMT_OPS on Ubuntu 12.04 fails.



-----Original Message-----
From: Johan Hedberg [mailto:[email protected]]
Sent: Wednesday, June 13, 2012 3:35 PM
To: Vijaykumar Dadmode
Cc: '[email protected]'
Subject: Re: Bluetooth LE scan/pair using MGMT_OPS on Ubuntu 12.04 fails.

Hi Vijay,

On Wed, Jun 13, 2012, Vijaykumar Dadmode wrote:
> On Wed, Jun 13, 2012, Vijaykumar Dadmode wrote:
> > Hi,
> >
> > On Ubuntu 12.04 using Management OPS , when I launch the "Bluetooth New Device Setup" wizard, it does not show any device, but on console it will find LE Devices. Works good on Ubuntu 10.04.
> >
> > $ hcitool lescan
> > Scanning ...
> > 00:12:03:19:xx:yy Keyboard
> >
> > mgmt_start_discovery() returns write error "Unknown error 524"
> >
> > if (write(mgmt_sock, buf, sizeof(buf)) < 0)
> > return -errno;
>
> >> You'd need to be more specific of exactly what kernel version and what
> >> user space version of BlueZ you have. The management interface is only
> >> expected to work properly with latest user space bluez.git and kernel
> >> version 3.4 or later. And for LE you'll want to use the latest
> >> bluetooth.git or bluetooth-next.git or wait until the 3.5 kernel gets
> >> released.
>
> Sorry about that. Yes I am using latest from bluez.git and kernel from bluetooth-next.
>
> BlueZ userspace version: latest clone from "git://git.kernel.org/pub/scm/bluetooth/bluez.git".
> Kernel version: 3.4.0-rc5

>>>> bluetooth-next is currently based on top of 3.5-rc1 so it seems you have
>>>> an old kernel. Please do a fresh pull from the user space and kernel
>>>> trees and try again.

>From git I see not many changes being committed after 3.4.0-rc5. Which Ubuntu version is it tested/works using "Bluetooth New Device Setup" wizard and MGMT_OPS?


Johan


To report this email as spam click https://www.mailcontrol.com/sr/wQw0zmjPoHdJTZGyOCrrhg== .


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at http://www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at http://www.csr.com/blog

2012-06-13 09:51:35

by Vijaykumar Dadmode

[permalink] [raw]
Subject: RE: Bluetooth LE scan/pair using MGMT_OPS on Ubuntu 12.04 fails.

Hi Johan,

On Wed, Jun 13, 2012, Vijaykumar Dadmode wrote:
> Hi,
>
> On Ubuntu 12.04 using Management OPS , when I launch the "Bluetooth New Device Setup" wizard, it does not show any device, but on console it will find LE Devices. Works good on Ubuntu 10.04.
>
> $ hcitool lescan
> Scanning ...
> 00:12:03:19:xx:yy Keyboard
>
> mgmt_start_discovery() returns write error "Unknown error 524"
>
> if (write(mgmt_sock, buf, sizeof(buf)) < 0)
> return -errno;

>> You'd need to be more specific of exactly what kernel version and what
>> user space version of BlueZ you have. The management interface is only
>> expected to work properly with latest user space bluez.git and kernel
>> version 3.4 or later. And for LE you'll want to use the latest
>> bluetooth.git or bluetooth-next.git or wait until the 3.5 kernel gets
>> released.

Sorry about that. Yes I am using latest from bluez.git and kernel from bluetooth-next.

BlueZ userspace version: latest clone from "git://git.kernel.org/pub/scm/bluetooth/bluez.git".
Kernel version: 3.4.0-rc5

Thanks,
Vijay


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at http://www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at http://www.csr.com/blog

2012-06-13 10:04:50

by Johan Hedberg

[permalink] [raw]
Subject: Re: Bluetooth LE scan/pair using MGMT_OPS on Ubuntu 12.04 fails.

Hi Vijay,

On Wed, Jun 13, 2012, Vijaykumar Dadmode wrote:
> On Wed, Jun 13, 2012, Vijaykumar Dadmode wrote:
> > Hi,
> >
> > On Ubuntu 12.04 using Management OPS , when I launch the "Bluetooth New Device Setup" wizard, it does not show any device, but on console it will find LE Devices. Works good on Ubuntu 10.04.
> >
> > $ hcitool lescan
> > Scanning ...
> > 00:12:03:19:xx:yy Keyboard
> >
> > mgmt_start_discovery() returns write error "Unknown error 524"
> >
> > if (write(mgmt_sock, buf, sizeof(buf)) < 0)
> > return -errno;
>
> >> You'd need to be more specific of exactly what kernel version and what
> >> user space version of BlueZ you have. The management interface is only
> >> expected to work properly with latest user space bluez.git and kernel
> >> version 3.4 or later. And for LE you'll want to use the latest
> >> bluetooth.git or bluetooth-next.git or wait until the 3.5 kernel gets
> >> released.
>
> Sorry about that. Yes I am using latest from bluez.git and kernel from bluetooth-next.
>
> BlueZ userspace version: latest clone from "git://git.kernel.org/pub/scm/bluetooth/bluez.git".
> Kernel version: 3.4.0-rc5

bluetooth-next is currently based on top of 3.5-rc1 so it seems you have
an old kernel. Please do a fresh pull from the user space and kernel
trees and try again.

Johan

2012-06-13 09:35:44

by Johan Hedberg

[permalink] [raw]
Subject: Re: Bluetooth LE scan/pair using MGMT_OPS on Ubuntu 12.04 fails.

Hi Vijay,

On Wed, Jun 13, 2012, Vijaykumar Dadmode wrote:
> Hi,
>
> On Ubuntu 12.04 using Management OPS , when I launch the "Bluetooth New Device Setup" wizard, it does not show any device, but on console it will find LE Devices. Works good on Ubuntu 10.04.
>
> $ hcitool lescan
> Scanning ...
> 00:12:03:19:xx:yy Keyboard
>
> mgmt_start_discovery() returns write error "Unknown error 524"
>
> if (write(mgmt_sock, buf, sizeof(buf)) < 0)
> return -errno;

You'd need to be more specific of exactly what kernel version and what
user space version of BlueZ you have. The management interface is only
expected to work properly with latest user space bluez.git and kernel
version 3.4 or later. And for LE you'll want to use the latest
bluetooth.git or bluetooth-next.git or wait until the 3.5 kernel gets
released.

Johan

2012-06-13 09:18:31

by Vijaykumar Dadmode

[permalink] [raw]
Subject: Bluetooth LE scan/pair using MGMT_OPS on Ubuntu 12.04 fails.

Hi,

On Ubuntu 12.04 using Management OPS , when I launch the "Bluetooth New Device Setup" wizard, it does not show any device, but on console it will find LE Devices. Works good on Ubuntu 10.04.

$ hcitool lescan
Scanning ...
00:12:03:19:xx:yy Keyboard

mgmt_start_discovery() returns write error "Unknown error 524"

if (write(mgmt_sock, buf, sizeof(buf)) < 0)
return -errno;

Thanks,
Vijay


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at http://www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at http://www.csr.com/blog