![]() |
Hamlib 4.5.5
|
Files | |
| file | amplist.h |
| Hamlib amplifier model definitions. | |
| file | amp_conf.c |
| Amplifier Configuration Interface. | |
| file | amp_settings.c |
| Amplifier function/level/parameter interface. | |
| file | amplifier.c |
| Amplifier interface. | |
| file | extamp.c |
| Amplifier extension parameters and levels interface. | |
Macros | |
| #define | AMP_MODEL_NONE 0 |
| A macro that returns the model number for an unknown model. | |
| #define | AMP_MODEL_DUMMY AMP_MAKE_MODEL(AMP_DUMMY, 1) |
| A macro that returns the model number for the DUMMY backend. | |
| #define | AMP_MODEL_NETAMPCTL AMP_MAKE_MODEL(AMP_DUMMY, 2) |
| A macro that returns the model number for the NETAMPCTL backend. | |
| #define | AMP_MODEL_ELECRAFT_KPA1500 AMP_MAKE_MODEL(AMP_ELECRAFT, 1) |
| A macro that returns the model number of the KPA1500 backend. | |
| #define | AMP_GEMINI 3 |
| #define | AMP_BACKEND_GEMINI "gemini" |
| #define | AMP_MODEL_GEMINI_DX1200 AMP_MAKE_MODEL(AMP_GEMINI, 1) |
Typedefs | |
| typedef int | amp_model_t |
| Convenience type definition for an amplifier model. | |
Functions | |
| const struct confparams * | amp_confparam_lookup (AMP *amp, const char *name) |
| Query an amplifier configuration parameter token by its name. | |
| token_t | amp_token_lookup (AMP *amp, const char *name) |
| Search for the token ID associated with an amplifier configuration parameter token name. | |
| int | amp_set_conf (AMP *amp, token_t token, const char *val) |
| Set an amplifier configuration parameter. | |
| int | amp_get_conf2 (AMP *amp, token_t token, char *val, int val_len) |
| Query the value of an amplifier configuration parameter. | |
| int | amp_get_conf (AMP *amp, token_t token, char *val) |
| setting_t | amp_has_set_level (AMP *amp, setting_t level) |
| Check which level settings can be set. | |
| setting_t | amp_has_get_level (AMP *amp, setting_t level) |
| Check which level settings can be queried. | |
| AMP * | amp_init (amp_model_t amp_model) |
| Allocate a new #AMP handle. | |
| int | amp_open (AMP *amp) |
| Open the communication channel to the amplifier. | |
| int | amp_close (AMP *amp) |
| Close the communication channel to the amplifier. | |
| int | amp_cleanup (AMP *amp) |
| Release an #AMP handle and free associated memory. | |
| int | amp_reset (AMP *amp, amp_reset_t reset) |
| Reset the amplifier. | |
| int | amp_get_freq (AMP *amp, freq_t *freq) |
| Query the operating frequency of the amplifier. | |
| int | amp_set_freq (AMP *amp, freq_t freq) |
| Set the operating frequency of the amplifier. | |
| const char * | amp_get_info (AMP *amp) |
| Query general information from the amplifier. | |
| int | amp_set_level (AMP *amp, setting_t level, value_t val) |
| Set the value of a requested level. | |
| int | amp_get_level (AMP *amp, setting_t level, value_t *val) |
| Query the value of a requested level. | |
| int | amp_set_ext_level (AMP *amp, token_t level, value_t val) |
| Set the value of a requested extension levels token. | |
| int | amp_get_ext_level (AMP *amp, token_t level, value_t *val) |
| Query the value of a requested extension levels token. | |
| int | amp_set_powerstat (AMP *amp, powerstat_t status) |
| Turn the amplifier On or Off or toggle the Standby or Operate status. | |
| int | amp_get_powerstat (AMP *amp, powerstat_t *status) |
| Query the power or standby status of the amplifier. | |
| int | amp_ext_level_foreach (AMP *amp, int(*cfunc)(AMP *, const struct confparams *, amp_ptr_t), amp_ptr_t data) |
| Executes cfunc on all the elements stored in the amp_caps::extlevels extension levels table. | |
| int | amp_ext_parm_foreach (AMP *amp, int(*cfunc)(AMP *, const struct confparams *, amp_ptr_t), amp_ptr_t data) |
| Executes cfunc on all the elements stored in the amp_caps::extparms extension parameters table. | |
| const struct confparams * | amp_ext_lookup (AMP *amp, const char *name) |
| Lookup an extension levels or parameters token by its name and return a pointer to the containing confparams structure member. | |
| const struct confparams * | amp_ext_lookup_tok (AMP *amp, token_t token) |
| Search for an extension levels or parameters token by its constant value and return a pointer to the confparams structure member. | |
| token_t | amp_ext_token_lookup (AMP *amp, const char *name) |
| Simple search returning the extension token ID associated with name. | |
| #define AMP_MODEL_DUMMY AMP_MAKE_MODEL(AMP_DUMMY, 1) |
A macro that returns the model number for the DUMMY backend.
The DUMMY backend, as the name suggests, is a backend which performs no hardware operations and always behaves as one would expect. It can be thought of as a hardware simulator and is very useful for testing client applications.
| #define AMP_MODEL_ELECRAFT_KPA1500 AMP_MAKE_MODEL(AMP_ELECRAFT, 1) |
A macro that returns the model number of the KPA1500 backend.
The KPA1500 backend can be used with amplifiers that support the Elecraft KPA-1500 protocol.
| #define AMP_MODEL_NETAMPCTL AMP_MAKE_MODEL(AMP_DUMMY, 2) |
A macro that returns the model number for the NETAMPCTL backend.
The NETAMPCTL backend allows use of the ampctld daemon through the normal Hamlib API.
| #define AMP_MODEL_NONE 0 |
A macro that returns the model number for an unknown model.
The none backend, as the name suggests, does nothing. It is mainly for internal use.
| int amp_cleanup | ( | AMP * | amp | ) |
Release an #AMP handle and free associated memory.
| amp | The #AMP handle to be released. |
Releases an #AMP handle for which the communications channel has been closed with amp_close().
| RIG_OK | #AMP handle successfully released. |
| RIG_EINVAL | amp is NULL or inconsistent. |
| int amp_close | ( | AMP * | amp | ) |
Close the communication channel to the amplifier.
| amp | The #AMP handle of the amplifier to be closed. |
Closes the communication channel to an amplifier for which the #AMP handle has been passed by argument that was previously opened with amp_open().
| RIG_OK | Communication channel successfully closed. |
| RIG_EINVAL | amp is NULL or inconsistent. |
| const struct confparams * amp_confparam_lookup | ( | AMP * | amp, |
| const char * | name | ||
| ) |
Query an amplifier configuration parameter token by its name.
| amp | The #AMP handle. |
| name | Configuration parameter token name string. |
Use this function to get a pointer to the token in the confparams structure. Searches the backend config params table first, then falls back to the frontend config params table.
TODO: Should use Lex to speed it up, strcmp() hurts!
| int amp_ext_level_foreach | ( | AMP * | amp, |
| int(*)(AMP *, const struct confparams *, amp_ptr_t) | cfunc, | ||
| amp_ptr_t | data | ||
| ) |
Executes cfunc on all the elements stored in the amp_caps::extlevels extension levels table.
| amp | The #AMP handle. |
| cfunc | Callback function of each amp_caps::extlevels. |
| data | Cookie to be passed to the callback function cfunc. |
The callback function cfunc is called until it returns a value which is not strictly positive.
| RIG_OK | All extension levels elements successfully processed. |
| RIG_EINVAL | amp or cfunc is NULL or inconsistent. |
| const struct confparams * amp_ext_lookup | ( | AMP * | amp, |
| const char * | name | ||
| ) |
Lookup an extension levels or parameters token by its name and return a pointer to the containing confparams structure member.
| amp | The #AMP handle. |
| name | The extension levels or parameters token name. |
Searches the amp_caps::extlevels table and then the amp_caps::extparms table for the token by its name.
| const struct confparams * amp_ext_lookup_tok | ( | AMP * | amp, |
| token_t | token | ||
| ) |
Search for an extension levels or parameters token by its constant value and return a pointer to the confparams structure member.
| amp | The #AMP handle. |
| token | The token value (constant). |
Searches the amp_caps::extlevels table first and then the amp_caps::extparms for the token by its constant value.
| int amp_ext_parm_foreach | ( | AMP * | amp, |
| int(*)(AMP *, const struct confparams *, amp_ptr_t) | cfunc, | ||
| amp_ptr_t | data | ||
| ) |
Executes cfunc on all the elements stored in the amp_caps::extparms extension parameters table.
| amp | The #AMP handle. |
| cfunc | Callback function of each amp_caps::extparms. |
| data | Cookie to be passed to the callback function cfunc. |
The callback function cfunc is called until it returns a value which is not strictly positive.
| RIG_OK | All extension parameters elements successfully processed. |
| RIG_EINVAL | amp or cfunc is NULL or inconsistent. |
| token_t amp_ext_token_lookup | ( | AMP * | amp, |
| const char * | name | ||
| ) |
Simple search returning the extension token ID associated with name.
| amp | The #AMP handle. |
| name | The token name string to search. |
| int amp_get_conf2 | ( | AMP * | amp, |
| token_t | token, | ||
| char * | val, | ||
| int | val_len | ||
| ) |
Query the value of an amplifier configuration parameter.
| amp | The #AMP handle. |
| token | The token of the parameter to query. |
| val | The location where to store the value of the configuration token. |
Retrieves the value of a configuration parameter associated with token.
| RIG_OK | Querying the parameter was successful. |
| RIG_EINVAL | amp is NULL or inconsistent. |
| RIG_ENAVAIL | amp_caps::get_conf() capability is not available. |
Query the value of a requested extension levels token.
| amp | The #AMP handle. |
| level | The requested extension levels token. |
| val | The variable to store the extension level token value. |
Query the val corresponding to the extension level token.
| RIG_OK | The query was successful. |
| RIG_EINVAL | amp is NULL or inconsistent. |
| RIG_ENAVAIL | amp_caps::get_ext_level() capability is not available. |
| int amp_get_freq | ( | AMP * | amp, |
| freq_t * | freq | ||
| ) |
Query the operating frequency of the amplifier.
| amp | The #AMP handle. |
| freq | The variable to store the operating frequency. |
Retrieves the operating frequency from the amplifier.
| RIG_OK | The query was successful. |
| RIG_EINVAL | amp is NULL or inconsistent. |
| RIG_ENAVAIL | amp_caps::get_freq() capability is not available. |
| const char * amp_get_info | ( | AMP * | amp | ) |
Query general information from the amplifier.
| amp | The #AMP handle. |
Retrieves some general information from the amplifier. This can include firmware revision, exact model name, or just nothing.
Query the value of a requested level.
| amp | The #AMP handle. |
| level | The requested level. |
| val | The variable to store the level value. |
Query the val corresponding to the level.
| RIG_OK | The query was successful. |
| RIG_EINVAL | amp is NULL or inconsistent. |
| RIG_ENAVAIL | amp_caps::get_level() capability is not available. |
| int amp_get_powerstat | ( | AMP * | amp, |
| powerstat_t * | status | ||
| ) |
Query the power or standby status of the amplifier.
| amp | The #AMP handle. |
| status | The variable to store the amplifier status. |
Query the amplifier's power or standby condition. The value stored in status will be one of RIG_POWER_ON, RIG_POWER_OFF and RIG_POWER_OPERATE, RIG_POWER_STANDBY, or RIG_POWER_UNKNOWN.
| RIG_OK | Querying the power/standby state was successful. |
| RIG_EINVAL | amp is NULL or inconsistent. |
| RIG_ENAVAIL | amp_caps::get_powerstat() capability is not available. |
Check which level settings can be queried.
| amp | The #AMP handle. |
| level | The level settings bitmap. |
Checks if an amplifier is capable of getting a level setting. Since the level is an OR'ed bitwise argument, more than one level can be checked at the same time.
EXAMPLE:
Check which level settings can be set.
| amp | The #AMP handle. |
| level | The level settings bitmap. |
Checks if an amplifier is capable of setting a level setting. Since the level is an OR'ed bitwise argument, more than one level can be checked at the same time.
EXAMPLE:
| AMP * amp_init | ( | amp_model_t | amp_model | ) |
Allocate a new #AMP handle.
| amp_model | The amplifier model for this new handle. |
Allocates a new #AMP handle and initializes the associated data for amp_model (see amplist.h or ampctl -l).
| int amp_open | ( | AMP * | amp | ) |
Open the communication channel to the amplifier.
| amp | The #AMP handle of the amplifier to be opened. |
Opens the communication channel to an amplifier for which the #AMP handle has been passed.
| RIG_OK | Communication channel successfully opened. |
| RIG_EINVAL | amp is NULL or inconsistent. |
| int amp_reset | ( | AMP * | amp, |
| amp_reset_t | reset | ||
| ) |
Reset the amplifier.
| amp | The #AMP handle. |
| reset | The reset operation to perform. |
Perform a reset of the amplifier.
| RIG_OK | The reset command was successful. |
| RIG_EINVAL | amp is NULL or inconsistent. |
| RIG_ENAVAIL | amp_caps::reset() capability is not available. |
| int amp_set_conf | ( | AMP * | amp, |
| token_t | token, | ||
| const char * | val | ||
| ) |
Set an amplifier configuration parameter.
| amp | The #AMP handle. |
| token | The token of the parameter to set. |
| val | The value to set the parameter to. |
Sets an amplifier configuration parameter to val.
| RIG_OK | The parameter was set successfully. |
| RIG_EINVAL | amp is NULL or inconsistent or token is invalid. |
| RIG_ENAVAIL | amp_caps::set_conf() capability is not available. |
Set the value of a requested extension levels token.
| amp | The #AMP handle. |
| level | The requested extension levels token. |
| val | The variable to set the extension level token value. |
Query the val corresponding to the extension level token.
| RIG_OK | The query was successful. |
| RIG_EINVAL | amp is NULL or inconsistent. |
| RIG_ENAVAIL | amp_caps::set_ext_level() capability is not available. |
| int amp_set_freq | ( | AMP * | amp, |
| freq_t | freq | ||
| ) |
Set the operating frequency of the amplifier.
| amp | The #AMP handle. |
| freq | The operating frequency. |
Set the operating frequency of the amplifier. Depending on the amplifier this may simply set the bandpass filters, etc.
| RIG_OK | Setting the frequency was successful. |
| RIG_EINVAL | amp is NULL or inconsistent. |
| RIG_ENAVAIL | amp_caps::set_freq() capability is not available. |
Set the value of a requested level.
| amp | The #AMP handle. |
| level | The requested level. |
| val | The variable to store the level value. |
Set the val corresponding to the level.
| RIG_OK | The query was successful. |
| RIG_EINVAL | amp is NULL or inconsistent. |
| RIG_ENAVAIL | amp_caps::get_level() capability is not available. |
| int amp_set_powerstat | ( | AMP * | amp, |
| powerstat_t | status | ||
| ) |
Turn the amplifier On or Off or toggle the Standby or Operate status.
| amp | The #AMP handle |
| status | The powerstat_t setting. |
Turns the amplifier On or Off or toggles the Standby or Operate status. See RIG_POWER_ON, RIG_POWER_OFF and RIG_POWER_OPERATE, RIG_POWER_STANDBY for the value of status.
| RIG_OK | The requested power/standby state was successful. |
| RIG_EINVAL | amp is NULL or inconsistent. |
| RIG_ENAVAIL | amp_caps::set_powerstat() capability is not available. |
| token_t amp_token_lookup | ( | AMP * | amp, |
| const char * | name | ||
| ) |
Search for the token ID associated with an amplifier configuration parameter token name.
| amp | The #AMP handle. |
| name | Configuration parameter token name string. |
Searches the backend and frontend configuration parameters tables for the token ID.