def determine_band_channel(kal_out):
    """Return band, channel, target frequency from kal output."""
    band = None
    channel = None
    tgt_freq = None
    while band is None:
        for line in kal_out.splitlines():
            line = line.decode("utf-8")
            if "Using " in line and " channel " in line:
                band = line.split()[1]
                channel = line.split()[3]
                tgt_freq = line.split()[4].replace(
                    "(", "").replace(")", "")
    return(band, channel, tgt_freq)