#Help with BLE service subscription.

1 messages · Page 1 of 1 (latest)

hollow sequoia
#

Hello I am using the https://github.com/Velorexe/Unity-Android-Bluetooth-Low-Energy
as the BLE library and https://github.com/yasirkula/UnityAndroidRuntimePermissions
for getting android permissions.
I am able to connect to the sensor, but am not able to subscribe to the sensor's service.

GitHub

A Unity Android plugin to support basic Bluetooth Low Energy interactions. - GitHub - Velorexe/Unity-Android-Bluetooth-Low-Energy: A Unity Android plugin to support basic Bluetooth Low Energy inter...

GitHub

A native Unity plugin to handle runtime permissions on Android M+ - GitHub - yasirkula/UnityAndroidRuntimePermissions: A native Unity plugin to handle runtime permissions on Android M+

blissful kayak
#

[]nocode

red notchBOT
#

It's hard to answer a programming question without code

Resolving a bug is almost impossible when the question doesn't include any of the buggy code. In order to help fix the problem, answerers are going to have to see what the code is.
Source: https://idownvotedbecau.se/nocode

Please isolate the problematic code and send it as a codeblock. If you don't know how to send a codeblock, type []cb

hollow sequoia
# blissful kayak []nocode

Actually the code is distributed all over the project in a lot files, and is the same as in the libraries.
So I didn't include it....

blissful kayak
#

Your code?

hollow sequoia
#

I didn't code anything, just patched these two libraries together and got them working

blissful kayak
#

You patched the two libraries together... With no code?

hollow sequoia
#

Kinda yeah,
the first one needs permission form the android device which it was not getting,
so I used this library to ask for permissions

blissful kayak
#

Kinda? Yes or no did you write code

hollow sequoia
#

I added one line to the android mainfest...

#

[]cb

red notchBOT
#

Use codeblocks to send code in a message!

To make a codeblock, surround your code with ```
To use C# syntax highlighting add cs after the three back ticks.

For example:
```cs
Console.WriteLine("Hello World");
```

Produces:

Console.WriteLine("Hello World");

To send lengthy code, paste it into https://paste.myst.rs/ and send the link of the paste into chat.

blissful kayak
#

We literally cannot help you if you didn't write code we're not debugging a library

hollow sequoia
#
    <uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
#

oh!
okay, but it's like... the library has the functionnality but I'm unable to find it

blissful kayak
#

you said you tried to subscribe to the sensor's service... you did this without code?

hollow sequoia
#

yeah the library comes with an example scene already that gives GUI for that

#

I was able to connect to the sensor from that GUI itself

blissful kayak
#

your own device BLE service matched the example scene BLE service??

#

seems unlikely

hollow sequoia
#

That's the part where I'm struck at...
I am not able to understand where to change that service details either through code or GUI

blissful kayak
#

Why didn't you lead with that question LOL

#

You made it sound like you already knew how to subscribe and it just wasn't working

hollow sequoia
#

hmmge
now I feel dumb!

Thanks a ton man, probably would've wasted hours if it weren't for your help

blissful kayak
#

No problem. Can I suggest how I would have asked the question?

hollow sequoia
#

yeah sure bro I'll learn from that

blissful kayak
#

Hello,

I am using [library 1] and [library 2] to connect to a BLE device and subscribe to a service. [Library 1] has an example scene and through the GUI I am able to connect to the device, but I can't subscribe to the service. I know I need to change the service details, but I can't find where. Could you help with this?

hollow sequoia
#

Now that you say it out, this sounds obvious... HmmmmStare

From next time I'll proof-read myself more than once while posting