-
Notifications
You must be signed in to change notification settings - Fork 26
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
Setting serviceData,but sanner not found #92
Comments
Which platform are you running on? |
I also couldn't get the serviceData on Windows |
I'm afraid that is a normal behavior on Windows, The GATT server and advertisement broadcast are two different concepts, when you advertising and act as a GATT server at the same time on Windows, the scanner will find two devices instead of one. One is the GATT server device and the other is advertising device(also known as iBeacon). I also wonder why the API is designed like this by Microsoft. Here is a QA about this: https://learn.microsoft.com/en-us/answers/questions/189891/windows10-uwp-app-conflict-ble-advertisement-and-g Here is the official docs about BLE on Windows, you can see the |
Do you mean you can't discover service data using this plugin? From the debugging tool, there is no service data in the advertisement. The servcie data type should be 0x16 or 0x20 or 0x21, but there is no this type in the advertisement. Is that peripheral is developed using this plugin? |
I see, now I understand. Our hardware development engineer customized a broadcast data type as 0xFF. How can I retrieve this data? |
0xff means the manufacturer specific data. So you can get the customized data form the |
Thank you, I understand now. |
See the #92 (comment) above to see the limitation on Windows when act as a Peripheral. Also notice that the |
I'm afraid we can't publish these data on Windows after looked up the Microsoft's docs. According to this docs, the following data sections are reserved by system and not allowed to use for us. |
Now that the advertisement data sections on Windows only support manufacturer specific data, we need to throws an |
@yanshouwang Here's the current example provided in the source: auto parameters = winrt::Windows::Devices::Bluetooth::GenericAttributeProfile::GattServiceProviderAdvertisingParameters(); parameters.ServiceData(data); auto parameters = winrt::Windows::Devices::Bluetooth::GenericAttributeProfile::GattServiceProviderAdvertisingParameters(); Thank you! |
Oh. I have missed that the ServiceProvider can include the service data. Thanks for your advice. You can pull a request to add this feature! |
@JUV-666 @yanshouwang And how to set the broadcast data, I configured it in the immutable value of the service's GATTCharacteristic. Is this correct?
|
@tangdekun After this feature is added. You can get the service uuids which are added by addService and service data set in the startAdvertising method parameters. Other data sections will be disabled as it can't be included in the connectable GATT server. You will need to call startAdvertising. Just call the addService will not start the advertising. |
This issue is stale because it has been open for 30 days with no activity. |
The text was updated successfully, but these errors were encountered: