def METHOD_NAME(protocol, packets, msg_names, t_min=None, t_max=None):
    ret = [{'time':[], 'data':[]} for m in msg_names]
    if t_min == None: t_min = packets[0][0]
    if t_max == None: t_max = packets[-1][0]
    for t, msgs in packets:
        if t>= t_min and t<= t_max:
            for id, payload in msgs:
                m = protocol.get_message_by_id('telemetry', id)
                try: i = msg_names.index(m.name)
                except: pass
                finally: ret[i]['time'].append(t);  ret[i]['data'].append(m.unpack_scaled_values(payload))
    return ret