def convert_schedule_to_repltimes(schedule):
    """Convert NTDS Connection schedule to replTime schedule.

    Schedule defined in  MS-ADTS 6.1.4.5.2
    ReplTimes defined in MS-DRSR 5.164.

    "Schedule" has 168 bytes but only the lower nibble of each is
    significant. There is one byte per hour. Bit 3 (0x08) represents
    the first 15 minutes of the hour and bit 0 (0x01) represents the
    last 15 minutes. The first byte presumably covers 12am - 1am
    Sunday, though the spec doesn't define the start of a week.

    "ReplTimes" has 84 bytes which are the 168 lower nibbles of
    "Schedule" packed together. Thus each byte covers 2 hours. Bits 7
    (i.e. 0x80) is the first 15 minutes and bit 0 is the last. The
    first byte covers Sunday 12am - 2am (per spec).

    Here we pack two elements of the NTDS Connection schedule slots
    into one element of the replTimes list.

    If no schedule appears in NTDS Connection then a default of 0x11
    is set in each replTimes slot as per behaviour noted in a Windows
    DC. That default would cause replication within the last 15
    minutes of each hour.
    """
    # note, NTDSConnection schedule == None means "once an hour"
    # repl_info == None means "always"
    if schedule is None or schedule.dataArray[0] is None:
        return [0x11] * 84

    times = []
    data = schedule.dataArray[0].slots

    for i in range(84):
        times.append((data[i * 2] & 0xF) << 4 | (data[i * 2 + 1] & 0xF))

    return times