private CEMILData cEMI(final int mc, final KNXAddress dst, final Priority p, final byte[] nsdu) {
    final IndividualAddress src = medium.getDeviceAddress();
    // use default address 0 in system broadcast
    final KNXAddress d = dst == null ? new GroupAddress(0) : dst;
    final boolean repeat = mc == CEMILData.MC_LDATA_IND ? false : true;
    final boolean tp = medium.getMedium() == KNXMediumSettings.MEDIUM_TP1;
    if (nsdu.length <= 16 && tp) return new CEMILData(mc, src, d, nsdu, p, repeat, hopCount);

    final boolean pl = medium.getMedium() == KNXMediumSettings.MEDIUM_PL110;
    // TODO allow domain bcast for RF, currently we send all RF L_Data as system broadcast
    final boolean domainBcast = tp ? true : pl && dst != null ? true : false;
    final CEMILDataEx f =
        new CEMILDataEx(mc, src, d, nsdu, p, repeat, domainBcast, false, hopCount);
    addMediumInfo(f);
    return f;
  }
 private void addMediumInfo(final CEMILData msg) {
   String s = "";
   if (medium instanceof PLSettings) {
     final CEMILDataEx f = (CEMILDataEx) msg;
     if (f.getAdditionalInfo(CEMILDataEx.ADDINFO_PLMEDIUM) == null)
       f.addAdditionalInfo(CEMILDataEx.ADDINFO_PLMEDIUM, ((PLSettings) medium).getDomainAddress());
   } else if (medium.getMedium() == KNXMediumSettings.MEDIUM_RF) {
     final CEMILDataEx f = (CEMILDataEx) msg;
     if (f.getAdditionalInfo(CEMILDataEx.ADDINFO_RFMEDIUM) == null) {
       final RFSettings rf = (RFSettings) medium;
       final byte[] sn = f.isDomainBroadcast() ? rf.getDomainAddress() : rf.getSerialNumber();
       final byte[] ai = new RFMediumInfo(true, rf.isUnidirectional(), sn, 255).getInfo();
       f.addAdditionalInfo(CEMILDataEx.ADDINFO_RFMEDIUM, ai);
       s = f.isDomainBroadcast() ? "(using domain address)" : "(using device SN)";
     }
   } else return;
   logger.trace("add cEMI additional info for {} {}", medium.getMediumString(), s);
 }