* \brief get the normal passband of a mode * \param rig The rig handle * \param mode The mode to get the passband * * Returns the normal (default) passband for the given \a mode. * * \return the passband in Hz if the operation has been successful, * or a 0 if an error occurred (passband not found, whatever). * * \sa rig_passband_narrow(), rig_passband_wide() */
| 3205 | * \sa rig_passband_narrow(), rig_passband_wide() |
| 3206 | */ |
| 3207 | pbwidth_t HAMLIB_API rig_passband_normal(RIG *rig, rmode_t mode) |
| 3208 | { |
| 3209 | const struct rig_state *rs; |
| 3210 | int i; |
| 3211 | |
| 3212 | if (!rig) |
| 3213 | { |
| 3214 | rig_debug(RIG_DEBUG_ERR, "%s: rig or rig->caps is null\n", __func__); |
| 3215 | return (RIG_PASSBAND_NORMAL); /* huhu! */ |
| 3216 | } |
| 3217 | |
| 3218 | ENTERFUNC; |
| 3219 | |
| 3220 | rs = STATE(rig); |
| 3221 | |
| 3222 | // return CW for CWR and RTTY for RTTYR |
| 3223 | if (mode == RIG_MODE_CWR) { mode = RIG_MODE_CW; } |
| 3224 | |
| 3225 | if (mode == RIG_MODE_RTTYR) { mode = RIG_MODE_RTTY; } |
| 3226 | |
| 3227 | for (i = 0; i < HAMLIB_FLTLSTSIZ && rs->filters[i].modes; i++) |
| 3228 | { |
| 3229 | if (rs->filters[i].modes & mode) |
| 3230 | { |
| 3231 | rig_debug(RIG_DEBUG_VERBOSE, "%s: Return filter#%d, width=%d\n", __func__, i, |
| 3232 | (int)rs->filters[i].width); |
| 3233 | RETURNFUNC(rs->filters[i].width); |
| 3234 | } |
| 3235 | } |
| 3236 | |
| 3237 | rig_debug(RIG_DEBUG_VERBOSE, |
| 3238 | "%s: filter not found...returning %d\n", __func__, |
| 3239 | 0); |
| 3240 | RETURNFUNC(0); |
| 3241 | } |
| 3242 | |
| 3243 | |
| 3244 | /** |