Exemple #1
0
int
rt_get_info(void *v, struct radio_info *ri)
{
	struct rt_softc *sc = v;

	switch (sc->sc_ct) {
	case CARD_RADIOTRACK:
		ri->caps = RTRACK_CAPABILITIES;
		ri->info = 3 & rt_state(sc->lm.iot, sc->lm.ioh);
		ri->volume = rt_unconv_vol(sc->sc_vol);
		break;
	case CARD_SF16FMI:
		ri->caps = SF16FMI_CAPABILITIES;
		ri->volume = sc->sc_vol ? 255 : 0;
		ri->info = 0; /* UNSUPPORTED */
		break;
	default:
		/* No such card */
		return (1);
	}

	ri->mute = sc->sc_mute;
	ri->stereo = sc->sc_stereo == LM700X_STEREO ? 0 : 1;
	ri->rfreq = lm700x_decode_ref(sc->sc_rf);
	ri->freq = sc->sc_freq;

	/* UNSUPPORTED */
	ri->lock = 0;

	return (0);
}
    ob::ScopedState<> SetStateConfig(std::vector<double>& state_config, ob::SpaceInformationPtr smp_space)
    {
        ob::ScopedState<> rt_state(smp_space);
        if(state_config.size())
        {
            std::vector<double>::iterator iter = state_config.begin();
            for(int i = 0;iter!= state_config.end();iter++,i++)
            {
                rt_state->as<ob::RealVectorStateSpace::StateType>()->values[i] = *iter;
            }
        }

        return rt_state;
    }
int
rt_get_info(void *v, struct radio_info *ri)
{
    struct rt_softc *sc = v;

    ri->mute = sc->mute;
    ri->volume = rt_unconv_vol(sc->vol);
    ri->stereo = sc->stereo == LM700X_STEREO ? 0 : 1;
    ri->caps = RTRACK_CAPABILITIES;
    ri->rfreq = lm700x_decode_ref(sc->rf);
    ri->info = 3 & rt_state(sc->lm.iot, sc->lm.ioh);
    ri->freq = sc->freq;

    /* UNSUPPORTED */
    ri->lock = 0;

    return (0);
}
int
rt_find(bus_space_tag_t iot, bus_space_handle_t ioh)
{
    struct rt_softc sc;
#if 0
    u_int i, scanres = 0;
#endif

    sc.lm.iot = iot;
    sc.lm.ioh = ioh;
    sc.lm.offset = 0;
    sc.lm.wzcl = RT_WREN_ON | RT_CLCK_OFF | RT_DATA_OFF;
    sc.lm.wzch = RT_WREN_ON | RT_CLCK_ON  | RT_DATA_OFF;
    sc.lm.wocl = RT_WREN_ON | RT_CLCK_OFF | RT_DATA_ON;
    sc.lm.woch = RT_WREN_ON | RT_CLCK_ON  | RT_DATA_ON;
    sc.lm.initdata = 0;
    sc.lm.rsetdata = RT_SIGNAL_METER;
    sc.lm.init = rt_lm700x_init;
    sc.lm.rset = rt_lm700x_rset;
    sc.rf = LM700X_REF_050;
    sc.mute = 0;
    sc.stereo = LM700X_STEREO;
    sc.vol = 0;

    /*
     * Scan whole FM range. If there is a card it'll
     * respond on some frequency.
     */
    return 0;
#if 0
    for (i = MIN_FM_FREQ; !scanres && i < MAX_FM_FREQ; i += 10) {
        rt_set_freq(&sc, i);
        scanres += rt_state(iot, ioh);
    }

    return scanres;
#endif
}