protected COTPTpduSize getNearestMatchingTpduSize(short tpduSizeParameter) {
        for (COTPTpduSize value : COTPTpduSize.values()) {
            if (value.getSizeInBytes() >= tpduSizeParameter) {
                return value;
            }
        }
        return null;
    }
Iterate over all values until one is found that the given tpdu size will fit.

@param tpduSizeParameter requested tpdu size.
@return smallest {@link COTPTpduSize} which will fit a given size of tpdu.
plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7light/readwrite/context/S7DriverContext.java