Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

advertising data elements missing #241

Closed
dnlwgnd opened this issue Feb 14, 2024 · 4 comments
Closed

advertising data elements missing #241

dnlwgnd opened this issue Feb 14, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@dnlwgnd
Copy link
Contributor

dnlwgnd commented Feb 14, 2024

Hi,
I continue to explore this package.
I am working on a nrf52 device, my goal is to implement the BTHome protocol
This seems to require me to add the
0x16 = Service Data - 16-bit UUID
advertising data element.
From what I found in the codebase, this particular element (and many more) are not possible to configure, i.e. in

// AdvertisementOptions configures an advertisement instance. More options may
// be added over time.
type AdvertisementOptions struct {
	// The (complete) local name that will be advertised. Optional, omitted if
	// this is a zero-length string.
	LocalName string

	// ServiceUUIDs are the services (16-bit or 128-bit) that are broadcast as
	// part of the advertisement packet, in data types such as "complete list of
	// 128-bit UUIDs".
	ServiceUUIDs []UUID

	// Interval in BLE-specific units. Create an interval by using NewDuration.
	Interval Duration

	// ManufacturerData stores Advertising Data.
	// Keys are the Manufacturer ID to associate with the data.
	ManufacturerData map[uint16]interface{}
}

there is only following elements coverd

0x01: Flags //though not configurable
0x09: Complete Local Name
0x03: Complete List of 16-bit Service Class UUIDs
0x07: Complete List of 128-bit Service Class UUIDs
0xFF: Manufacturer Specific Data

is this by design? or would you consider extending it?

@nickajacks1
Copy link

Check out #123

@dnlwgnd
Copy link
Contributor Author

dnlwgnd commented Feb 15, 2024

thanks for the pointer to #123. i briefly looked at it and it seems it does add the Service Data elements only on the receiving pieces of the code, i.e. in

type AdvertisementOptions struct {

and

func (buf *rawAdvertisementPayload) addFromOptions(options AdvertisementOptions) (ok bool) {

Service Data was not implemented.
How can we go forward on this?
I could try to whip s.th. up but would require some guidance.

@aykevl
Copy link
Member

aykevl commented Feb 17, 2024

@dnlwgnd it appears that #123 was abandoned. Perhaps you can try to make a new PR based on that PR, including support for service data on the SoftDevice?

@deadprogram
Copy link
Member

Now closing since 0.9.0 has been released. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants