private CEMILData adjustMsgType(final CEMILData msg) {
   final boolean srcOk = msg.getSource().getRawAddress() != 0;
   // just return if we don't need to adjust source address and don't need LDataEx
   if ((srcOk || medium.getDeviceAddress().getRawAddress() == 0)
       && (medium instanceof TPSettings || msg instanceof CEMILDataEx)) return msg;
   return CEMIFactory.create(srcOk ? null : medium.getDeviceAddress(), null, msg, true);
 }
  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;
  }