code: func (c *Client) Loop() {
  
  	type asyncWork struct {
  		handle func([]byte)
  		data   []byte
  	}
  
  	ch := make(chan asyncWork, 16)
  	defer close(ch)
  	go func() {
  		for w := range ch {
  			w.handle(w.data)
  		}
  	}()
  
  	confirmation := []byte{HandleValueConfirmationCode}
  	for {
  		n, err := c.l2c.Read(c.rxBuf)
  		logger.Debug("client", "rsp", fmt.Sprintf("% X", c.rxBuf[:n]))
  		if err != nil {
  			// We don't expect any error from the bearer (L2CAP ACL-U)
  			// Pass it along to the pending request, if any, and escape.
  			c.chErr <- err
  			return
  		}
  
  		b := make([]byte, n)
  		copy(b, c.rxBuf)
  
  		if (b[0] != HandleValueNotificationCode) && (b[0] != HandleValueIndicationCode) {
  			c.rspc <- b
  			continue
  		}
  
  		// Deliver the full request to upper layer.
  		select {
  		case ch <- asyncWork{handle: c.handler.HandleNotification, data: b}:
  		default:
  			// If this really happens, especially on a slow machine, enlarge the channel buffer.
  			logger.Error("client", "req", "can't enqueue incoming notification.")
  		}
  
  		// Always write aknowledgement for an indication, even it was an invalid request.
  		if b[0] == HandleValueIndicationCode {
  			logger.Debug("client", "req", fmt.Sprintf("% X", b))
  			c.l2c.Write(confirmation)
  		}
  	}
  }
docs: // Loop ...