def METHOD_NAME(pulses):
    array = bytearray()
    for pulse in pulses:
        pulse = int(pulse * 269 / 8192)
        if pulse < 256:
            array += bytearray(struct.pack('>B', pulse))
        else:
            array += bytearray([0x00])
            array += bytearray(struct.pack('>H', pulse))
    packet = bytearray([0x26, 0x00])
    packet += bytearray(struct.pack('<H', len(array)))
    packet += array
    packet += bytearray([0x0d, 0x05])
    # Add 0s to make ultimate packet size a multiple of 16 for 128-bit AES encryption.
    remainder = (len(packet) + 4) % 16
    if remainder:
        packet += bytearray(16 - remainder)
    return packe