* \brief Set the value of a requested level. * * \param amp The #AMP handle. * \param level The requested level. * \param val The variable to store the \a level value. * * Set the \a val corresponding to the \a level. * * \note \a val can be any type defined by #value_t. * * \return RIG_OK if the operation was successful, otherwise a **negative * value** if an error occurred (in which c
| 759 | * \sa amp_set_ext_level() |
| 760 | */ |
| 761 | int HAMLIB_API amp_set_level(AMP *amp, setting_t level, value_t val) |
| 762 | { |
| 763 | amp_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); |
| 764 | |
| 765 | if (CHECK_AMP_ARG(amp)) |
| 766 | { |
| 767 | return -RIG_EINVAL; |
| 768 | } |
| 769 | |
| 770 | if (amp->caps->set_level == NULL) |
| 771 | { |
| 772 | return -RIG_ENAVAIL; |
| 773 | } |
| 774 | |
| 775 | return amp->caps->set_level(amp, level, val); |
| 776 | } |
| 777 | |
| 778 | /** |
| 779 | * \brief Query the value of a requested level. |