Skip to content

Compatibility with CircuitPython - #13

Open
llamafilm wants to merge 1 commit into
DavesCodeMusings:mainfrom
llamafilm:compat-adafruit
Open

Compatibility with CircuitPython#13
llamafilm wants to merge 1 commit into
DavesCodeMusings:mainfrom
llamafilm:compat-adafruit

Conversation

@llamafilm

@llamafilmllamafilm commented Nov 8, 2025

Copy link
Copy Markdown

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:

fromadafruit_bleimportBLERadiofromadafruit_ble.advertisingimportAdvertisementfrombthomeimportBTHomebeacon=BTHome(debug=True)
beacon.temperature=25bthome_service_data=beacon.pack_service_data(BTHome.TEMPERATURE_SINT16_X100)
bthome_advert=Advertisement()
bthome_advert.data_dict[0x16] =bthome_service_datable=BLERadio()
ble.name="Feather Sense"ble.start_advertising(bthome_advert)

This function can be used to create a `adafruit_ble.advertising.Advertisement`
@llamafilmllamafilm changed the title Compatibility with Adafruit FeatherCompatibility with CircuitPythonNov 8, 2025
Sign up for freeto 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

@llamafilm