Skip to content

Conversation

@llamafilm
Copy link

@llamafilm llamafilm commented Nov 8, 2025

This is a no-op for anyone using pack_advertisement.

I could not find any way to use that function with adafruit_ble in CircuitPython, so I made pack_service_data public and changed its format for compatibility. That library has its own class to create Advertisements, which adds the AD type, length, and name.

Example usage:

from adafruit_ble import BLERadio
from adafruit_ble.advertising import Advertisement
from bthome import BTHome

beacon = BTHome(debug=True)
beacon.temperature = 25
bthome_service_data = beacon.pack_service_data(BTHome.TEMPERATURE_SINT16_X100)
bthome_advert = Advertisement()
bthome_advert.data_dict[0x16] = bthome_service_data

ble = BLERadio()
ble.name = "Feather Sense"
ble.start_advertising(bthome_advert)

This function can be used to create a `adafruit_ble.advertising.Advertisement`
@llamafilm llamafilm changed the title Compatibility with Adafruit Feather Compatibility with CircuitPython Nov 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant