def decode_qwikcord(packet, channel=1):
    """Extract the qwikcord current measurements from val (CTavg, CTsum)."""
    val = str(packet.get('val', ''))
    if len(val) != 16:
        return None
    if channel == 1:
        return int(val[6:12], 16)  # CTavg
    return int(val[12:], 16)