user2782
user2782

Reputation: 488

Web Bluetooth with a Custom GATT Service?

First, the source code for the BLE Peripheral Simulator is a tremendous resource for anyone investigating Web Bluetooth.

There is a an approved list of GATT Services.

When I modified the Android source code to use a custom defined GATT service (easy to do by simply specifying your own UUID in the Android code) pairing from the web page to the Android app running the GATT sever fails.

The Web Bluetooth documentation does state, "If device’s advertised Service UUIDs have a non-empty intersection with the set of Service UUIDs, add device to result and abort these sub-steps [for pairing]."

Does this mean only services in the approved GATT list are supported? If so, what is the rational? It seems that such a restriction would limit innovation.

Upvotes: 0

Views: 497

Answers (2)

mr.Deepwest
mr.Deepwest

Reputation: 73

I am working with web-bluetooth also and i was able to talk with custom services, yet to read data from them you have to have device docs explaining how to talk to that services. I think this approved list is like generally used list which doesn't require unique logic to get data. However there is difference since some characteristics are blacklisted for web-bluetooth yet available to fetch data from using ios/android stuff.

Upvotes: 2

user2782
user2782

Reputation: 488

If I had done some more research on Stack Overflow I would have realized the UUID spec requires lowercase a-f. Type of Character generated by UUID

The following values work for a custom defined service and characteristic:

private static final UUID SERVICE_UUID = UUID.fromString("29143321-ef6c-4761-947c-c858f9a2e8f1");

private static final UUID CHARACTERISTIC_UUID = UUID.fromString("92f3131b-ffa8-4dd1-a12b-641d65a78857");

Upvotes: 1

Related Questions