notjosh / bleno-mac

Bleno MacOS bindings using the official CoreBluetooth API
MIT License
23 stars 24 forks source link

Advertising service UUID not actually being advertised #4

Closed DaBs closed 5 years ago

DaBs commented 5 years ago

It seems advertising service UUIDs are not correctly being advertised, even though the log indicates it is.

This is the output from the advertising call: startAdvertising:SOMEBOX #212222 serviceUUIDs:( "445B9FFB-348F-4E1B-A417-3559B8138390" )

But when I detect it via e.g. nRF Connect on an Android, or Bluecap on iOS, the advertised service IDs turns out to be an empty array. I'm digging some more into it, but it becomes rather problematic.

aaronrogers commented 5 years ago

I'm having the same problem. I'm using the echo example.

The console output is:

 peripheralManagerDidAddService: <CBMutableService: 0x102a22680 Primary = YES, UUID = EC00, Included Services = (null), Characteristics = (
    "<CBMutableCharacteristic: 0x102a23f10 UUID = EC0E, Value = (null), Properties = 0x1A, Permissions = 0x3, Descriptors = (\n), SubscribedCentrals = (\n)>"
)> (null)

But then LightBlue has my mac with no services advertised. IMG_2A5A99952EC9-1

When I go deeper on my mac, the service doesn't show up under the advertisement info. IMG_1290D5F82933-1

Even though the service shows up in the list of services. IMG_019FC2573A13-1

DaBs commented 5 years ago

@aaronrogers Advertised services and actual services does not necessarily correspond, and it sounds like your problem is a separate one in terms of actual services.

ankidave commented 5 years ago

I just encountered this same issue, and threw up a PR that fixes the issue for me. LMK if you think this looks good or want any changes. https://github.com/notjosh/bleno-mac/pull/7

DaBs commented 5 years ago

@ankidave I just checked our your branch and it fixes the issues. Thanks for providing the fix! This issue is resolved by PR #7