All of lore.kernel.org
 help / color / mirror / Atom feed
* UUIDs for every single physical peripheral's service and characteristics?
@ 2020-05-26 14:37 Christopher de Vidal
  2020-05-26 14:57 ` Alain Michaud
  0 siblings, 1 reply; 5+ messages in thread
From: Christopher de Vidal @ 2020-05-26 14:37 UTC (permalink / raw)
  To: linux-bluetooth

Help a newbie? I'm seeking to build a niche product for sale, a
Raspberry Pi-based device which during the initial setup acts a BLE
peripheral. (Python using dbus to Bluez.) It has a single service and
19 characteristics. I get that the first "U" in UUID stands for
unique. Must that be unique among each physical product, or may it be
unique among the product line?

So if I sell 1,000 units (which would be a success), would I need to
obtain 1,000 service UUIDs and 19,000 characteristic UUIDs? Or just 20
total, for the entire product line?

The goal is so that the iOS/Android app can have that pre-set in the
code and quickly discover the device, pair it automagically.

I suppose the risk is of a conflict of two similar devices which are
in the same vicinity of the phone, and both set into peripheral mode
at the same time. But that would be a minimal risk which I could
accommodate for.

Christopher de Vidal

Would you consider yourself a good person? Have you ever taken the
'Good Person' test? It's a fascinating five minute quiz. Google it.

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

* Re: UUIDs for every single physical peripheral's service and characteristics?
  2020-05-26 14:37 UUIDs for every single physical peripheral's service and characteristics? Christopher de Vidal
@ 2020-05-26 14:57 ` Alain Michaud
  2020-05-26 16:21   ` Christopher de Vidal
  0 siblings, 1 reply; 5+ messages in thread
From: Alain Michaud @ 2020-05-26 14:57 UTC (permalink / raw)
  To: Christopher de Vidal; +Cc: BlueZ

Hi Christopher,

The term "unique" will vary based on context.  In the context of a
Gatt Service and Characteristic, it is intended to uniquely identify
the "contract" defined by the service/characteristics.  For example a
Temperature Service would have a UUID that universally defines the
contract/interface defined by that service.

So for your custom service, you'll need to define a set of 20 128 bit
UUID (16 bit uuids are reserved for SIG defined uuids) that uniquely
identify the contract that's defined by your service/characteristics.
The devices can uniquely be identified/addressed by their respective
addresses.

I hope this is helpful.

Thanks!
Alain

On Tue, May 26, 2020 at 10:38 AM Christopher de Vidal
<cbdevidal.jk1@gmail.com> wrote:
>
> Help a newbie? I'm seeking to build a niche product for sale, a
> Raspberry Pi-based device which during the initial setup acts a BLE
> peripheral. (Python using dbus to Bluez.) It has a single service and
> 19 characteristics. I get that the first "U" in UUID stands for
> unique. Must that be unique among each physical product, or may it be
> unique among the product line?
>
> So if I sell 1,000 units (which would be a success), would I need to
> obtain 1,000 service UUIDs and 19,000 characteristic UUIDs? Or just 20
> total, for the entire product line?
>
> The goal is so that the iOS/Android app can have that pre-set in the
> code and quickly discover the device, pair it automagically.
>
> I suppose the risk is of a conflict of two similar devices which are
> in the same vicinity of the phone, and both set into peripheral mode
> at the same time. But that would be a minimal risk which I could
> accommodate for.
>
> Christopher de Vidal
>
> Would you consider yourself a good person? Have you ever taken the
> 'Good Person' test? It's a fascinating five minute quiz. Google it.

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

* Re: UUIDs for every single physical peripheral's service and characteristics?
  2020-05-26 14:57 ` Alain Michaud
@ 2020-05-26 16:21   ` Christopher de Vidal
  2020-05-26 19:25     ` Alain Michaud
  2020-05-26 21:38     ` Luiz Augusto von Dentz
  0 siblings, 2 replies; 5+ messages in thread
From: Christopher de Vidal @ 2020-05-26 16:21 UTC (permalink / raw)
  To: Alain Michaud; +Cc: BlueZ

So let me make sure I understand. The devices themselves have their
own Bluetooth addresses (similar to MAC addresses, I don't know the
proper term) which are unique among every physical device sold. And
also there is one (and only one) service UUID which is shared among
all 1,000+ peripherals which I sell, and 19 characteristic UUIDs that
are shared among the physical peripherals. The devices come with their
own Bluetooth "MAC" and I only need to obtain 20 UUIDs in total for
the product line. Did I get that right?

Christopher de Vidal

Would you consider yourself a good person? Have you ever taken the
'Good Person' test? It's a fascinating five minute quiz. Google it.

On Tue, May 26, 2020 at 10:57 AM Alain Michaud <alainmichaud@google.com> wrote:
>
> Hi Christopher,
>
> The term "unique" will vary based on context.  In the context of a
> Gatt Service and Characteristic, it is intended to uniquely identify
> the "contract" defined by the service/characteristics.  For example a
> Temperature Service would have a UUID that universally defines the
> contract/interface defined by that service.
>
> So for your custom service, you'll need to define a set of 20 128 bit
> UUID (16 bit uuids are reserved for SIG defined uuids) that uniquely
> identify the contract that's defined by your service/characteristics.
> The devices can uniquely be identified/addressed by their respective
> addresses.
>
> I hope this is helpful.
>
> Thanks!
> Alain
>
> On Tue, May 26, 2020 at 10:38 AM Christopher de Vidal
> <cbdevidal.jk1@gmail.com> wrote:
> >
> > Help a newbie? I'm seeking to build a niche product for sale, a
> > Raspberry Pi-based device which during the initial setup acts a BLE
> > peripheral. (Python using dbus to Bluez.) It has a single service and
> > 19 characteristics. I get that the first "U" in UUID stands for
> > unique. Must that be unique among each physical product, or may it be
> > unique among the product line?
> >
> > So if I sell 1,000 units (which would be a success), would I need to
> > obtain 1,000 service UUIDs and 19,000 characteristic UUIDs? Or just 20
> > total, for the entire product line?
> >
> > The goal is so that the iOS/Android app can have that pre-set in the
> > code and quickly discover the device, pair it automagically.
> >
> > I suppose the risk is of a conflict of two similar devices which are
> > in the same vicinity of the phone, and both set into peripheral mode
> > at the same time. But that would be a minimal risk which I could
> > accommodate for.
> >
> > Christopher de Vidal
> >
> > Would you consider yourself a good person? Have you ever taken the
> > 'Good Person' test? It's a fascinating five minute quiz. Google it.

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

* Re: UUIDs for every single physical peripheral's service and characteristics?
  2020-05-26 16:21   ` Christopher de Vidal
@ 2020-05-26 19:25     ` Alain Michaud
  2020-05-26 21:38     ` Luiz Augusto von Dentz
  1 sibling, 0 replies; 5+ messages in thread
From: Alain Michaud @ 2020-05-26 19:25 UTC (permalink / raw)
  To: Christopher de Vidal; +Cc: BlueZ

Yes.  Unless each of your 1000 devices will have a different
protocol/contract to interact with them, you don't need to have unique
UUIDs for the services/characteristics per device instance.

On Tue, May 26, 2020 at 12:22 PM Christopher de Vidal
<cbdevidal.jk1@gmail.com> wrote:
>
> So let me make sure I understand. The devices themselves have their
> own Bluetooth addresses (similar to MAC addresses, I don't know the
> proper term) which are unique among every physical device sold. And
> also there is one (and only one) service UUID which is shared among
> all 1,000+ peripherals which I sell, and 19 characteristic UUIDs that
> are shared among the physical peripherals. The devices come with their
> own Bluetooth "MAC" and I only need to obtain 20 UUIDs in total for
> the product line. Did I get that right?
>
> Christopher de Vidal
>
> Would you consider yourself a good person? Have you ever taken the
> 'Good Person' test? It's a fascinating five minute quiz. Google it.
>
> On Tue, May 26, 2020 at 10:57 AM Alain Michaud <alainmichaud@google.com> wrote:
> >
> > Hi Christopher,
> >
> > The term "unique" will vary based on context.  In the context of a
> > Gatt Service and Characteristic, it is intended to uniquely identify
> > the "contract" defined by the service/characteristics.  For example a
> > Temperature Service would have a UUID that universally defines the
> > contract/interface defined by that service.
> >
> > So for your custom service, you'll need to define a set of 20 128 bit
> > UUID (16 bit uuids are reserved for SIG defined uuids) that uniquely
> > identify the contract that's defined by your service/characteristics.
> > The devices can uniquely be identified/addressed by their respective
> > addresses.
> >
> > I hope this is helpful.
> >
> > Thanks!
> > Alain
> >
> > On Tue, May 26, 2020 at 10:38 AM Christopher de Vidal
> > <cbdevidal.jk1@gmail.com> wrote:
> > >
> > > Help a newbie? I'm seeking to build a niche product for sale, a
> > > Raspberry Pi-based device which during the initial setup acts a BLE
> > > peripheral. (Python using dbus to Bluez.) It has a single service and
> > > 19 characteristics. I get that the first "U" in UUID stands for
> > > unique. Must that be unique among each physical product, or may it be
> > > unique among the product line?
> > >
> > > So if I sell 1,000 units (which would be a success), would I need to
> > > obtain 1,000 service UUIDs and 19,000 characteristic UUIDs? Or just 20
> > > total, for the entire product line?
> > >
> > > The goal is so that the iOS/Android app can have that pre-set in the
> > > code and quickly discover the device, pair it automagically.
> > >
> > > I suppose the risk is of a conflict of two similar devices which are
> > > in the same vicinity of the phone, and both set into peripheral mode
> > > at the same time. But that would be a minimal risk which I could
> > > accommodate for.
> > >
> > > Christopher de Vidal
> > >
> > > Would you consider yourself a good person? Have you ever taken the
> > > 'Good Person' test? It's a fascinating five minute quiz. Google it.

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

* Re: UUIDs for every single physical peripheral's service and characteristics?
  2020-05-26 16:21   ` Christopher de Vidal
  2020-05-26 19:25     ` Alain Michaud
@ 2020-05-26 21:38     ` Luiz Augusto von Dentz
  1 sibling, 0 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2020-05-26 21:38 UTC (permalink / raw)
  To: Christopher de Vidal; +Cc: Alain Michaud, BlueZ

Hi Christopher,

On Tue, May 26, 2020 at 9:25 AM Christopher de Vidal
<cbdevidal.jk1@gmail.com> wrote:
>
> So let me make sure I understand. The devices themselves have their
> own Bluetooth addresses (similar to MAC addresses, I don't know the
> proper term) which are unique among every physical device sold. And
> also there is one (and only one) service UUID which is shared among
> all 1,000+ peripherals which I sell, and 19 characteristic UUIDs that
> are shared among the physical peripherals. The devices come with their
> own Bluetooth "MAC" and I only need to obtain 20 UUIDs in total for
> the product line. Did I get that right?

Check out this article (Step 4: Assign UUIDs to Custom Services and
Characteristics):

https://www.novelbits.io/bluetooth-gatt-services-characteristics/

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

end of thread, other threads:[~2020-05-26 21:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-26 14:37 UUIDs for every single physical peripheral's service and characteristics? Christopher de Vidal
2020-05-26 14:57 ` Alain Michaud
2020-05-26 16:21   ` Christopher de Vidal
2020-05-26 19:25     ` Alain Michaud
2020-05-26 21:38     ` Luiz Augusto von Dentz

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.