Skip to content

Commit

Permalink
fix: ensure that HCI advertising interval is set to a default value, …
Browse files Browse the repository at this point in the history
…otherwise different adverting types do not work correctly

Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram committed Jan 5, 2025
1 parent 5795b60 commit afac5f0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gap_hci.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,9 @@ func (a *Advertisement) Configure(options AdvertisementOptions) error {

a.serviceUUIDs = append([]UUID{}, options.ServiceUUIDs...)
a.interval = uint16(options.Interval)
if a.interval == 0 {
a.interval = 0x0800 // default interval is 1.28 seconds
}
a.manufacturerData = append([]ManufacturerDataElement{}, options.ManufacturerData...)
a.serviceData = append([]ServiceDataElement{}, options.ServiceData...)

Expand Down

0 comments on commit afac5f0

Please sign in to comment.