/* * USB FM Radio Control utility * Copyright (c) 2002-2004 Nicola S. Vitale * All rights reserved. */ /* * NAME * get_stereo * * DESCRIPTION * The function checks if the radio is in stereo mode. * * ARGUMENTS * A file descriptor as returned from the open_radio * function. * * RETURN VALUES * 1 if in stereo mode. * 0 if not in stereo mode. * -1 on failure * * NOTES * This function could be used to tune in the broadcasters. * * $Id: get_stereo.c,v 1.3 2004/01/03 09:47:45 nivit Exp $ */ #include #include "libufm.h" int get_stereo(int radio_handle) { int error, status; error = ioctl(radio_handle, FM_GET_STAT, &status); if (error != -1) return (status & 0x01); else return -1; }