[Hamlib-cvs-digest] CVS: hamlib/src rig.c,1.9,1.10
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Stephane F. <f4...@us...> - 2000-12-04 23:39:20
|
Update of /cvsroot/hamlib/hamlib/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv6495/src Modified Files: rig.c Log Message: * removed [sg]et_passband in favor of an enhanced [sg]et_mode which includes the passband, since most rigs tie these parameters together quite often. For exemple, WFM is (RIG_MODE_FM,RIG_PASSBAND_WIDE) in Hamlib. Another set of functions will be needed to fine tune aditional frequency response/filters. Index: rig.c =================================================================== RCS file: /cvsroot/hamlib/hamlib/src/rig.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** rig.c 2000/11/28 22:33:37 1.9 --- rig.c 2000/12/04 23:39:18 1.10 *************** *** 399,404 **** --- 399,407 ---- * @rig: The rig handle * @mode: The mode to set to + * @width: The passband width to set to * * The rig_set_mode() function sets the mode of the current VFO. + * As a begining, the backend is free to ignore the @width argument, + * however, it would be nice to at least honor the WFM case. * * RETURN VALUE: The rig_set_mode() function returns %RIG_OK *************** *** 409,413 **** */ ! int rig_set_mode(RIG *rig, rmode_t mode) { if (!rig || !rig->caps) --- 412,416 ---- */ ! int rig_set_mode(RIG *rig, rmode_t mode, pbwidth_t width) { if (!rig || !rig->caps) *************** *** 417,421 **** return -RIG_ENAVAIL; else ! return rig->caps->set_mode(rig, mode); } --- 420,424 ---- return -RIG_ENAVAIL; else ! return rig->caps->set_mode(rig, mode, width); } *************** *** 424,429 **** --- 427,435 ---- * @rig: The rig handle * @mode: The location where to store the current mode + * @width: The location where to store the current passband width * * The rig_set_mode() function retrieves the mode of the current VFO. + * If the backend is unable to determine the width, it must + * return %RIG_PASSBAND_NORMAL as a default. * * RETURN VALUE: The rig_get_mode() function returns %RIG_OK *************** *** 434,440 **** */ ! int rig_get_mode(RIG *rig, rmode_t *mode) { ! if (!rig || !rig->caps || !mode) return -RIG_EINVAL; --- 440,446 ---- */ ! int rig_get_mode(RIG *rig, rmode_t *mode, pbwidth_t *width) { ! if (!rig || !rig->caps || !mode || !width) return -RIG_EINVAL; *************** *** 442,478 **** return -RIG_ENAVAIL; else ! return rig->caps->get_mode(rig, mode); ! } ! ! /* ! * rig_set_passband ! * ! */ ! ! int rig_set_passband(RIG *rig, pbwidth_t width) ! { ! if (!rig || !rig->caps) ! return -RIG_EINVAL; ! ! if (rig->caps->set_passband == NULL) ! return -RIG_ENAVAIL; ! else ! return rig->caps->set_passband(rig, width); ! } ! ! /* ! * rig_get_passband ! * ! */ ! ! int rig_get_passband(RIG *rig, pbwidth_t *width) ! { ! if (!rig || !rig->caps || !width) ! return -RIG_EINVAL; ! ! if (rig->caps->get_passband == NULL) ! return -RIG_ENAVAIL; ! else ! return rig->caps->get_passband(rig, width); } --- 448,452 ---- return -RIG_ENAVAIL; else ! return rig->caps->get_mode(rig, mode, width); } |