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

GATT Server name no longer advertising correctly #78

Closed
Avstn1 opened this issue Apr 21, 2022 · 7 comments
Closed

GATT Server name no longer advertising correctly #78

Avstn1 opened this issue Apr 21, 2022 · 7 comments
Labels
backend: CoreBluetooth Problem specific to CoreBluetooth bug Something isn't working help wanted Extra attention is needed

Comments

@Avstn1
Copy link

Avstn1 commented Apr 21, 2022

The problem
After updating to macOS Monterey 12.3.1 with an iPhone running iOS 15.4.2, the specified GATT Server name is no longer advertising and I'm given a default name of "Mac" whenever starting the Bless server. I've confirmed that it's advertising my data, it's just that the name is incorrect.

Reproduction

my_service_name = "server-test"
server = BlessServer(name=my_service_name, loop=loop)

Expected behavior
The server would advertise as "server-test".

Screenshots
Screen Shot 2022-04-21 at 4 10 02 PM

Desktop (please complete the following information):

  • OS: macOS Monterey 12.3.1
@Crudough
Copy link

Crudough commented May 2, 2022

@kevincar I am also seeing this after updating to Monterey. @Avstn1 have you been able to find any solution?

Thanks!

@kevincar
Copy link
Owner

kevincar commented May 2, 2022

Thanks @Crudough and @Avstn1, I'll try to take a look this weekend. Pull requests are certainly welcome if a solution is found in the interim.

@Crudough
Copy link

Crudough commented May 2, 2022

I'l continue investigating as well -- thanks @kevincar appreciate the response!

@kevincar kevincar added bug Something isn't working backend: CoreBluetooth Problem specific to CoreBluetooth labels May 28, 2022
@kevincar
Copy link
Owner

kevincar commented Jun 1, 2022

This seems to be an issue with the pyobjc library. Just submitted an issue there. Will continue to tease apart the issue.

I'll see if I can supply a temporary workaround that will need to rely on compiled code.

@kevincar kevincar added the help wanted Extra attention is needed label Jun 1, 2022
@kevincar
Copy link
Owner

kevincar commented Jun 4, 2022

@Crudough, @Avstn1

Can you confirm that you were seeing the local device name prior to Monterey? The backend of bless utilizes the CoreBluetooth framework which has a limit on the amount of data that is advertised. Since bless, advertises the primary service UUID by default, it may limit the size of the local name field.

I'm assuming this wasn't a problem in the past given that you've created this issue but want to see if you can still see the local name if you shorten it to a name with < 10 bytes in length.

@kevincar
Copy link
Owner

kevincar commented Jun 6, 2022

Tested this issue again using Objective-C and found that MacOS Mojave allows long local names to be advertised, but no longer in Monterey. This behavior seems to be a result of how apple has coded the CoreBluetooth framework.

I've currently implemented a "work around" in which service UUIDs are dropped from the advertisement when the local name is longer than 10 bytes.

If there are other possible implementations to be suggested, please reopen this issue with those suggestions, ideas, or references.

@kevincar kevincar closed this as completed Jun 6, 2022
@kevincar kevincar mentioned this issue Jun 6, 2022
@Crudough
Copy link

Crudough commented Jun 8, 2022

@kevincar thank you for getting back to this. I can confirm that the local name I was using was never more than 10-bytes. I will check the workaround that you implemented but have also just changed some other tooling to expect the default name that is being advertised.

Thank you again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend: CoreBluetooth Problem specific to CoreBluetooth bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants