code: func (c *Conn) writePDU(pdu []byte) (int, error) {
  	sent := 0
  	flags := uint16(pbfHostToControllerStart << 4) // ACL boundary flags
  
  	// All L2CAP fragments associated with an L2CAP PDU shall be processed for
  	// transmission by the Controller before any other L2CAP PDU for the same
  	// logical transport shall be processed.
  	c.txBuffer.LockPool()
  	defer c.txBuffer.UnlockPool()
  
  	for len(pdu) > 0 {
  		// Get a buffer from our pre-allocated and flow-controlled pool.
  		pkt := c.txBuffer.Get() // ACL pkt
  		flen := len(pdu)        // fragment length
  		if flen > pkt.Cap()-1-4 {
  			flen = pkt.Cap() - 1 - 4
  		}
  
  		// Prepare the Headers
  		binary.Write(pkt, binary.LittleEndian, uint8(pktTypeACLData))                         // HCI Header: pkt Type
  		binary.Write(pkt, binary.LittleEndian, uint16(c.param.ConnectionHandle()|(flags<<8))) // ACL Header: handle and flags
  		binary.Write(pkt, binary.LittleEndian, uint16(flen))                                  // ACL Header: data len
  		binary.Write(pkt, binary.LittleEndian, pdu[:flen])                                    // Append payload
  
  		// Flush the pkt to HCI
  		select {
  		case <-c.chDone:
  			return 0, io.ErrClosedPipe
  		default:
  		}
  
  		if _, err := c.hci.skt.Write(pkt.Bytes()); err != nil {
  			return sent, err
  		}
  		sent += flen
  
  		flags = (pbfContinuing << 4) // Set "continuing" in the boundary flags for the rest of fragments, if any.
  		pdu = pdu[flen:]             // Advence the point
  	}
  	return sent, nil
  }
docs: // writePDU breaks down a L2CAP PDU into fragments if it's larger than the HCI buffer size. [Vol 3, Part A, 7.2.1]