Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

128 bit version for service id "FEA6" #37

Closed
sultanmyrza opened this issue Aug 16, 2021 · 1 comment
Closed

128 bit version for service id "FEA6" #37

sultanmyrza opened this issue Aug 16, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@sultanmyrza
Copy link
Contributor

I use ionic and run on android.
To connect to goPro bluetooth I use this packet

In code I connect like this

await BleClient.requestLEScan(
        { services: ["FEA6"], allowDuplicates: false },
        (result) => doSomethingWithResult(result)
      );

on android I got this error

V/Capacitor: callback: 74973120, pluginId: BluetoothLe, methodName: requestLEScan, methodData: {"services":["FEA6"],"allowDuplicates":false}
D/Capacitor: Sending plugin error: {"save":false,"callbackId":"74973120","pluginId":"BluetoothLe","methodName":"requestLEScan","success":false,"error":{"message":"Invalid service UUID."}}

But If I don't specify service id aka (it connects fine)

await BleClient.requestLEScan(
        { services: [], allowDuplicates: false },
        (result) => doSomethingWithResutl(result)
      );

But still want to know is there such thing? 128 bit version for GoPro service id "FEA6" 😅

@sultanmyrza sultanmyrza added the bug Something isn't working label Aug 16, 2021
@tcamise-gpsw
Copy link
Collaborator

Hello. The "Control and Query" service UUID is 0xFEA6 which is a 16-bit UUID. It is not possible to refer to this UUID as as 128-bit UUID. Note that UUID's in Bluetooth can either be 16 or 128 bits so this is acceptable behavior.

I've never used Ionic but I found this after a quick search:
"UUIDs are always strings and not numbers. Some 16-bit UUIDs, such as '2220' look like integers, but they're not. (The integer 2220 is 0x8AC in hex.) This isn't a problem with 128 bit UUIDs since they look like strings 82b9e6e1-593a-456f-be9b-9215160ebcac. All 16-bit UUIDs should also be passed to methods as strings."

So it seems that there might be some special handling needed for non-128 bit UUID's.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants