How to send more than 31 bytes custom data for a gatt server by start an advertisement?

Lowell Liu 21 Reputation points
2022-08-02T11:50:53.877+00:00

I want to sent more than 31 bytes in an advertisement for a gatt server.
Is any api or parameter able to support this case?
here is the code demo:
Bluetooth::GenericAttributeProfile::GattServiceProvider->StartAdvertising(Bluetooth::GenericAttributeProfile::GattServiceProviderAdvertisingParameters());

Universal Windows Platform (UWP)
{count} votes

1 answer

Sort by: Most helpful
  1. Nico Zhu (Shanghai Wicresoft Co,.Ltd.) 12,856 Reputation points
    2022-08-04T02:05:35.973+00:00

    Hello,
    Welcome to Microsoft Q&A!

    How to send more than 31 bytes custom data for a gatt server by start an advertisement?

    Please use the following API:

    1) To check if feature is supported on the system the App is running on: BluetoothAdapter.IsExtendedAdvertisingSupported Property (Windows.Devices.Bluetooth) - Windows UWP applications | Microsoft Learn
    2) Enabling it: BluetoothLEAdvertisementPublisher.UseExtendedAdvertisement Property (Windows.Devices.Bluetooth.Advertisement) - Windows UWP applications | Microsoft Learn

    Essentially, the app needs to dynamically verify if the system running the app has support for such a feature before enabling it.

    Also, for the GATT server API, step 2 above should not be necessary as long as the feature is supported (checked via step 1)

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments