code: func NewDevice() (*Device, error) {
  	dev, err := hci.NewHCI()
  	if err != nil {
  		return nil, errors.Wrap(err, "can't create hci")
  	}
  	if err = dev.Init(); err != nil {
  		return nil, errors.Wrap(err, "can't init hci")
  	}
  
  	s, err := gatt.NewServer()
  	if err != nil {
  		return nil, errors.Wrap(err, "can't create server")
  	}
  
  	mtu := ble.DefaultMTU
  	mtu = ble.MaxMTU // TODO: get this from user using Option.
  	if mtu > ble.MaxMTU {
  		return nil, errors.Wrapf(err, "maximum ATT_MTU is %d", ble.MaxMTU)
  	}
  
  	go func() {
  		for {
  			l2c, err := dev.Accept()
  			if err != nil {
  				log.Printf("can't accept: %s", err)
  				return
  			}
  
  			// Initialize the per-connection cccd values.
  			l2c.SetContext(context.WithValue(l2c.Context(), "ccc", make(map[uint16]uint16)))
  			l2c.SetRxMTU(mtu)
  
  			s.Lock()
  			as, err := att.NewServer(s.DB(), l2c)
  			s.Unlock()
  			if err != nil {
  				log.Printf("can't create ATT server: %s", err)
  				continue
  
  			}
  			go as.Loop()
  		}
  	}()
  	return &Device{HCI: dev, Server: s}, nil
  }
docs: // NewDevice returns the default HCI device.