bluetooth
bluetooth copied to clipboard
AdvertisementPayload.Bytes() is nil on linux
It appears as if AdvertisementPayload.Bytes() is nil on linux.
What I specifically need is the ManufacturerData however I'm not sure how to fit that into the AdvertisementPayload.Bytes() interface.
You mean you want to publish this data? AdvertisementPayload is for when you want to act as a peripheral.
You mean you want to publish this data?
No, i want the ManufacturerData which from the advertisement of other peripherals
AdvertisementPayloadis for when you want to act as a peripheral.
Are you sure about that?
Adapter.Scan takes a func(*Adapter, ScanResult) which contains an AdvertisementPayload.
Obviously I can be mistaken but I couldn't find how to get the manufacturerdata when trying earlier today.
AdvertisementPayload.Bytes() will always be nil on Linux, because BlueZ does not expose this information.
That said, adding manufacturer data to the AdvertisementPayload should not be very difficult to do, as BlueZ does expose this information. It's just not implemented yet.
AdvertisementPayload.Bytes() will always be nil on Linux, because BlueZ does not expose this information.
Alright, good to know.
That said, adding manufacturer data to the AdvertisementPayload should not be very difficult to do, as BlueZ does expose this information. It's just not implemented yet.
Are you suggesting doing something like this:
type AdvertisementPayload interface {
LocalName() string
HasServiceUUID(UUID) bool
Bytes() []byte
ManufacturerData() map[uint16]interface{} // map[uint16][]byte ?
}
Yes something like that (with map[uint16][]byteinstead ofmap[uint16]interface{}`), or maybe even this:
type AdvertisementPayload interface {
LocalName() string
HasServiceUUID(UUID) bool
ManufacturerData(key uint16) []byte
Bytes() []byte
}