code: func (s *Server) handleReadRequest(r ReadRequest) []byte {
  	// Validate the request.
  	switch {
  	case len(r) != 3:
  		return newErrorResponse(r.AttributeOpcode(), 0x0000, ble.ErrInvalidPDU)
  	}
  
  	rsp := ReadResponse(s.txBuf)
  	rsp.SetAttributeOpcode()
  	buf := bytes.NewBuffer(rsp.AttributeValue())
  	buf.Reset()
  
  	a, ok := s.db.at(r.AttributeHandle())
  	if !ok {
  		return newErrorResponse(r.AttributeOpcode(), r.AttributeHandle(), ble.ErrInvalidHandle)
  	}
  
  	// Simple case. Read-only, no-authorization, no-authentication.
  	if a.v != nil {
  		binary.Write(buf, binary.LittleEndian, a.v)
  		return rsp[:1+buf.Len()]
  	}
  
  	// Pass the request to upper layer with the ResponseWriter, which caps
  	// the buffer to a valid length of payload.
  	if e := handleATT(a, s.conn, r, ble.NewResponseWriter(buf)); e != ble.ErrSuccess {
  		return newErrorResponse(r.AttributeOpcode(), r.AttributeHandle(), e)
  	}
  	return rsp[:1+buf.Len()]
  }
docs: // handle Read request. [Vol 3, Part F, 3.4.4.3 & 3.4.4.4]