func (a *Advertisement) LocalName() string {
	v, _ := a.localNameWErr()
	return v
}
LocalName returns the LocalName of the remote peripheral.
package hci
import (
	"encoding/hex"
	"strings"
	"time"
	"github.com/pkg/errors"
	"github.com/rigado/ble"
	"github.com/rigado/ble/linux/adv"
	"github.com/rigado/ble/linux/hci/evt"
)
type RandomAddress struct {
	ble.Addr
}
const (
	evtTypAdvInd        = 0x00  
	evtTypAdvDirectInd  = 0x01  
	evtTypAdvScanInd    = 0x02  
	evtTypAdvNonconnInd = 0x03  
	evtTypScanRsp       = 0x04  
)
func newAdvertisement(e evt.LEAdvertisingReport, i int) (*Advertisement, error) {
	ad, err := e.DataWErr(i)
	if err != nil {
		return nil, err
	}
	p, err := adv.NewRawPacket(ad)
	if err != nil {
		a := e.Address(i)
		for i := len(a)/2 - 1; i >= 0; i-- {
			opp := len(a) - 1 - i
			a[i], a[opp] = a[opp], a[i]
		}
		return nil, errors.Wrap(err, hex.EncodeToString(a[:]))
	}
	ts := int64(time.Now().UnixNano() / 1000)
	a := &Advertisement{e: e, i: i, p: p, ts: ts}
	return a, nil
}
type Advertisement struct {
	e  evt.LEAdvertisingReport
	i  int
	sr *Advertisement
	ts int64
	p *adv.Packet
}
func (a *Advertisement) setScanResponse(sr *Advertisement) error {
	ad, err := a.e.DataWErr(a.i)
	if err != nil {
		return err
	}
	srd, err := sr.e.DataWErr(sr.i)
	if err != nil {
		return err
	}
	p, err := adv.NewRawPacket(ad, srd)
	if err != nil {
		return errors.Wrap(err, "setScanResp")
	}
	a.sr = sr
	a.p = p
	return nil
}