public static int calculateHeartbeatCount(final int countLog) {
        if (countLog > 0x11 && countLog < 0xFF)
            throw new IllegalArgumentException("Prohibited, count log must be a value from 0x00 to 0x11 and 0xFF");
        if (countLog == 0x11)
            return (int) Math.pow(2, countLog - 1) - 2;
        return (int) Math.pow(2, countLog - 1);
    }
Calculates the heart beat publication count which is the number of publications to be sent

@param countLog count value
mesh/src/main/java/no/nordicsemi/android/mesh/utils/Heartbeat.java