Usage of "adverisement data" functions provided by servers?

9 views
Skip to first unread message

Joe Bibben

unread,
Aug 11, 2025, 6:31:35 PMAug 11
to btstack-dev
I'm looking at building a reusable GATT server like battery service / cycling power service.

Is there any documentation on how the advertisement functions work in these 2?

uint16_t battery_service_v1_server_get_broadcast_advertisement(uint16_t adv_interval, uint8_t * adv_buffer, uint16_t adv_size);
uint16_t battery_service_v1_server_get_broadcast_advertisement_single(battery_service_v1_t * service, uint16_t adv_interval, uint8_t * adv_buffer, uint16_t adv_size);
int cycling_power_get_measurement_adv(uint16_t adv_interval, uint8_t * adv_buffer, uint16_t adv_size);



I'd like to add a way to extend your existing advertisement with data provided by the server, which it sounds like the above are intended to do. How are the above intended to be used? Or am I misunderstanding their use?

Thanks,
Joe

Matthias Ringwald

unread,
Aug 12, 2025, 12:45:35 PMAug 12
to btsta...@googlegroups.com
Hi Joe

As there's no obvious way to automatically manage advertising, BTstack leaves this to the application. If you look at our examples, they setup their advertising manually.

In cycling_power_service_server and battery_service_v1_server, the advertisements had to be in a specific format, so we've provided helper functions for your convenience.

In most cases, it should be enough if you properly document the advertisement format / items that the user needs to provide.

Cheers
Matthias
> --
> You received this message because you are subscribed to the Google Groups "btstack-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to btstack-dev...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/btstack-dev/4bcc19c7-4a71-4b10-9f84-f2d50395aa64n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages