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

Secondary Services #58

Open
justintconroy opened this issue Sep 7, 2021 · 8 comments
Open

Secondary Services #58

justintconroy opened this issue Sep 7, 2021 · 8 comments

Comments

@justintconroy
Copy link

Is there any way to add a secondary service? It looks like I can only add primary services. I may need to reuse a secondary service as part of another primary service on the same device.

@h2zero
Copy link
Owner

h2zero commented Sep 7, 2021

Hi, there is currently no support for that but it should be easy to add. I've never had a request for it or even seen this used anywhere before.

@justintconroy
Copy link
Author

A few of the standard BLE services say they can be or should be implemented as secondary services.

are a few of the one's I've encountered. Right now, I'm specifically looking at Object Transfer Service. I've implemented a scaled down version of that (Connection Oriented Channels aren't supported on the ESP32 as far as I can tell, so I had to improvise a bit). I have another, distinct set of objects that I might want to throw this on top of. In that case, I want both services to be secondary services included in separate primary services.

@h2zero
Copy link
Owner

h2zero commented Sep 8, 2021

Thanks for the info, I guess bluetooth had to have a reason for secondary services somewhere and I haven't seen those before.
As a user, how would you like to see the interface for this work?

Connection Oriented Channels aren't supported on the ESP32 as far as I can tell

I believe they are, there are options in menuconfig for them (for NimBLE I thought I saw them at least).

@justintconroy
Copy link
Author

There's a config for "max number of CoCs", but I couldn't find the APIs to actually access them. Nor could I find any examples. Maybe I just didn't look hard enough...

@justintconroy
Copy link
Author

Sorry, I didn't actually answer your question. I think maybe just something like NimBLEService::addService(...) or NimBLEService::createService(...) similar to how characteristics are added to a service.

@h2zero
Copy link
Owner

h2zero commented Sep 8, 2021

Thanks, I'll have a look at adding this. NimBLE internals might dictate a different interface but I'll see what I can do.

@h2zero
Copy link
Owner

h2zero commented Sep 12, 2021

I've created PR #59, If you could test it and provide feedback it would be greatly appreciated 😄

@mickeyl
Copy link

mickeyl commented Apr 28, 2023

@justintconroy Any feedback on this yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants