/* * USB FM Radio Control utility * Copyright (c) 2002-2004 Nicola S. Vitale * All rights reserved. */ /* * NAME * get_freq * * DESCRIPTION * This function returns the current frequency. * * ARGUMENTS * The file descriptor of the radio device. * * RETURN VALUES * A positive integer if successful. * -1 on failure. * * $Id: get_freq.c,v 1.3 2004/01/03 09:47:45 nivit Exp $ */ #include #include "libufm.h" int get_freq (int radio_handle) { int error, freq; error = ioctl(radio_handle, FM_GET_FREQ, &freq); if (error != -1) return freq / (10 * kHz); else { DPRINT("impossible to get the frequency"); return error; } }