Hello,
Welcome to Microsoft Q&A!
First of all, based on the document - Bluetooth GATT Server, it is mentioned that - When a service is both Discoverable and Connectable, the system will add the Service Uuid to the advertisement packet. There are only 31 bytes in the Advertisement packet and a 128-bit UUID takes up 16 of them!. This is the default behavior. So what you are getting is expected.
Now with Bluetooth 5.0, the max payload for a single adv packet (AdvData) expands to 0-254 bytes. If you want to send more data than 31 bytes from a GATT server when communicating with a GATT client, you have to check if the system supports BLE 5.0. Be clear that this is not an advertisement, sending advertisements uses a different API.
Use the following API to check if the feature is supported on the system the App is running on:
If the system supported extended advertising, then you could send more data than 31 bytes.
Besides, if you want to send an advertisement using the BluetoothLEAdvertisementPublisher class . You have an extra step to enable it using this API: BluetoothLEAdvertisementPublisher.UseExtendedAdvertisement Property (Windows.Devices.Bluetooth.Advertisement) - Windows UWP applications | Microsoft Learn
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.