Hamlib 4.7~git
Loading...
Searching...
No Matches
Amplifier API

Files

file  amp_state.h
 Hamlib amplifier state structure.
file  amplifier.h
 Hamlib amplifier data structures.
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.

Data Structures

struct  amp_state
 Amplifier state structure. More...
struct  amp_caps
 Amplifier capabilities. More...
struct  amp
 Master amplifier structure. More...

Macros

#define HAMLIB_AMPSTATE(a)
#define NETAMPCTL_RET   "RPRT "
 The token in the netampctl protocol for returning an error condition code.
#define AMP_MODEL(arg)
#define amp_debug   rig_debug
 Convenience macro for generating debugging messages.

Typedefs

typedef struct amp AMP
 Main amplifier handle type definition.
typedef float swr_t
 Type definition for SWR (Standing Wave Ratio).
typedef int tune_value_t
 Type definition for the transmatch tuning values of capacitance and inductance.
typedef enum amp_reset_e amp_reset_t
 Amplifier reset tokens.
typedef enum amp_type_e amp_type_t
 Amplifier type flags.

Enumerations

enum  amp_reset_e { AMP_RESET_MEM , AMP_RESET_FAULT , AMP_RESET_AMP }
 Amplifier reset tokens. More...
enum  amp_type_e { AMP_FLAG_1 = (1 << 1) , AMP_FLAG_2 = (1 << 2) }
 Amplifier type flags. More...

Functions

int amp_token_foreach (AMP *amp, int(*cfunc)(const struct confparams *, rig_ptr_t), rig_ptr_t data)
 Executes cfunc on all the elements stored in the configuration parameters table.
const struct confparamsamp_confparam_lookup (AMP *amp, const char *name)
 Query an amplifier configuration parameter token by its name.
hamlib_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, hamlib_token_t token, const char *val)
 Set an amplifier configuration parameter.
int amp_get_conf2 (AMP *amp, hamlib_token_t token, char *val, int val_len)
 Query the value of an amplifier configuration parameter.
int amp_get_conf (AMP *amp, hamlib_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.
AMPamp_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, hamlib_token_t level, value_t val)
 Set the value of a requested extension levels token.
int amp_get_ext_level (AMP *amp, hamlib_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.
void * amp_data_pointer (AMP *amp, rig_ptrx_t idx)
 Get the address of amplifier data structure(s)
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 confparamsamp_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 confparamsamp_ext_lookup_tok (AMP *amp, hamlib_token_t token)
 Search for an extension levels or parameters token by its constant value and return a pointer to the confparams structure member.
hamlib_token_t amp_ext_token_lookup (AMP *amp, const char *name)
 Simple search returning the extension token ID associated with name.
enum  amp_level_e {
  AMP_LEVEL_NONE = 0 , AMP_LEVEL_SWR = (1 << 0) , AMP_LEVEL_NH = (1 << 1) , AMP_LEVEL_PF = (1 << 2) ,
  AMP_LEVEL_PWR_INPUT = (1 << 3) , AMP_LEVEL_PWR_FWD = (1 << 4) , AMP_LEVEL_PWR_REFLECTED = (1 << 5) , AMP_LEVEL_PWR_PEAK = (1 << 6) ,
  AMP_LEVEL_FAULT = (1 << 7) , AMP_LEVEL_PWR = (1 << 8)
}
#define AMP_TYPE_MASK   (AMP_FLAG_1|AMP_FLAG_2)
#define AMP_TYPE_OTHER   0
#define AMP_TYPE_1   AMP_FLAG_1
#define AMP_TYPE_2   AMP_FLAG_2
#define AMP_TYPE_ALL   (AMP_FLAG_1|AMP_FLAG_2)

Detailed Description

Amplifier interface

An amplifier can be any kind of external power amplifier that is capable of CAT type control.

Macro Definition Documentation

◆ amp_debug

#define amp_debug   rig_debug

Convenience macro for generating debugging messages.

This is an alias of the rig_debug() function call and is used in the same manner.

◆ AMP_MODEL

#define AMP_MODEL ( arg)
Value:
.amp_model=arg,.macro_name=#arg

Convenience macro to map the amp_model number and macro_name string from amplist.h.

Used when populating a backend amp_caps structure.

◆ AMP_TYPE_1

#define AMP_TYPE_1   AMP_FLAG_1

Amplifier type bit masks.

◆ AMP_TYPE_2

#define AMP_TYPE_2   AMP_FLAG_2

Amplifier type bit masks.

◆ AMP_TYPE_ALL

#define AMP_TYPE_ALL   (AMP_FLAG_1|AMP_FLAG_2)

Amplifier type bit masks.

◆ AMP_TYPE_MASK

#define AMP_TYPE_MASK   (AMP_FLAG_1|AMP_FLAG_2)

Amplifier type bit masks.

◆ AMP_TYPE_OTHER

#define AMP_TYPE_OTHER   0

Amplifier type bit masks.

◆ HAMLIB_AMPSTATE

#define HAMLIB_AMPSTATE ( a)
Value:
((struct amp_state *)amp_data_pointer(a, RIG_PTRX_AMPSTATE))
void * amp_data_pointer(AMP *amp, rig_ptrx_t idx)
Get the address of amplifier data structure(s)
Definition amplifier.c:966
Amplifier state structure.
Definition amp_state.h:55

Macro for application access to amp_state data structure using the AMP handle.

Example code.

AMP *my_amp;
//Instantiate an amp
my_amp = amp_init(AMP_MODEL_DUMMY); // your amp (amplifier) model.
const struct amp_state *my_as = HAMLIB_AMPSTATE(my_amp);
#define HAMLIB_AMPSTATE(a)
Definition amp_state.h:96
AMP * amp_init(amp_model_t amp_model)
Allocate a new AMP handle.
Definition amplifier.c:184
struct amp AMP
Main amplifier handle type definition.
Definition amplifier.h:65
#define AMP_MODEL_DUMMY
A macro that returns the model number for DUMMY.
Definition amplist.h:98

Typedef Documentation

◆ AMP

typedef struct amp AMP

Main amplifier handle type definition.

The AMP handle is returned by amp_init() and is passed as a parameter to every amplifier specific API call.

amp_cleanup() must be called when this handle is no longer needed.

◆ swr_t

typedef float swr_t

Type definition for SWR (Standing Wave Ratio).

The unit of swr_t is 1.0 to the maximum value reported by the amplifier's internal antenna system tuner, i.e. transmatch, representing the ratio of 1.0:1 to Maximum:1.

◆ tune_value_t

typedef int tune_value_t

Type definition for the transmatch tuning values of capacitance and inductance.

The tune_value_t type is used as a parameter for amp_get_level().

The unit of tune_value_t is picoFarads (pF) or nanoHenrys (nH).

Enumeration Type Documentation

◆ amp_level_e

Amplifier levels as bit masks.

Enumerator
AMP_LEVEL_NONE 

'' – No Level.

AMP_LEVEL_SWR 

SWR 1.0 or greater.

AMP_LEVEL_NH 

Tune setting in nanohenries.

AMP_LEVEL_PF 

Tune setting in picofarads.

AMP_LEVEL_PWR_INPUT 

Power reading from amplifier.

AMP_LEVEL_PWR_FWD 

Power reading forward.

AMP_LEVEL_PWR_REFLECTED 

Power reading reverse.

AMP_LEVEL_PWR_PEAK 

Power reading peak.

AMP_LEVEL_FAULT 

Fault code.

AMP_LEVEL_PWR 

Power setting.

◆ amp_reset_e

Amplifier reset tokens.

Enumerator
AMP_RESET_MEM 

Erase tuner memory.

AMP_RESET_FAULT 

Reset any fault.

AMP_RESET_AMP 

For Elecraft KPA-1500.

◆ amp_type_e

enum amp_type_e

Amplifier type flags.

Enumerator
AMP_FLAG_1 

TBD

AMP_FLAG_2 

TBD

Function Documentation

◆ amp_cleanup()

int amp_cleanup ( AMP * amp)

Release an AMP handle and free associated memory.

Parameters
ampThe AMP handle to be released.

Releases an AMP handle for which the communications channel has been closed with amp_close().

Returns
RIG_OK if the operation has been successful, otherwise a negative value if an error occurred (in which case, cause is set appropriately).
Return values
RIG_OKAMP handle successfully released.
-RIG_EINVALamp is NULL or inconsistent.
See also
amp_init(), amp_close()
Here is the call graph for this function:

◆ amp_close()

int amp_close ( AMP * amp)

Close the communication channel to the amplifier.

Parameters
ampThe 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().

Returns
RIG_OK if the operation has been successful, otherwise a negative value if an error occurred (in which case, cause is set appropriately).
Return values
RIG_OKCommunication channel successfully closed.
-RIG_EINVALamp is NULL or inconsistent.
See also
amp_cleanup(), amp_open()
Here is the call graph for this function:

◆ amp_confparam_lookup()

const struct confparams * amp_confparam_lookup ( AMP * amp,
const char * name )

Query an amplifier configuration parameter token by its name.

Parameters
ampThe AMP handle.
nameConfiguration 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.

Returns
A pointer to the token in the confparams structure or NULL if amp is NULL or inconsistent or if name is not found (how can the caller know which occurred?).
See also
amp_token_lookup()

TODO: Should use Lex to speed it up, strcmp() hurts!

◆ amp_data_pointer()

void * amp_data_pointer ( AMP * amp,
rig_ptrx_t idx )

Get the address of amplifier data structure(s)

See also
rig_data_pointer(), rot_data_pointer()

◆ amp_ext_level_foreach()

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.

Parameters
ampThe AMP handle.
cfuncCallback function of each amp_caps::extlevels.
dataCookie to be passed to the callback function cfunc.

The callback function cfunc is called until it returns a value which is not strictly positive.

Returns
A zero value which means a normal end of iteration, or a negative value which means an abnormal end.
Return values
RIG_OKAll extension levels elements successfully processed.
-RIG_EINVALamp or cfunc is NULL or inconsistent.
Here is the call graph for this function:

◆ amp_ext_lookup()

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.

Parameters
ampThe AMP handle.
nameThe 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.

Note
As this function is called by amp_ext_token_lookup(), it can be considered a lower level API.
Returns
A pointer to the containing confparams structure member or NULL if nothing found or if amp is NULL or inconsistent.
See also
amp_ext_token_lookup()
Todo
Should use Lex to speed it up, strcmp() hurts!
Here is the call graph for this function:

◆ amp_ext_lookup_tok()

const struct confparams * amp_ext_lookup_tok ( AMP * amp,
hamlib_token_t token )

Search for an extension levels or parameters token by its constant value and return a pointer to the confparams structure member.

Parameters
ampThe AMP handle.
tokenThe token value (constant).

Searches the amp_caps::extlevels table first and then the amp_caps::extparms for the token by its constant value.

Returns
A pointer to the containing confparams structure member or NULL if nothing found or if amp is NULL or inconsistent.
Here is the call graph for this function:

◆ amp_ext_parm_foreach()

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.

Parameters
ampThe AMP handle.
cfuncCallback function of each amp_caps::extparms.
dataCookie to be passed to the callback function cfunc.

The callback function cfunc is called until it returns a value which is not strictly positive.

Returns
A zero value which means a normal end of iteration, or a negative value which means an abnormal end.
Return values
RIG_OKAll extension parameters elements successfully processed.
-RIG_EINVALamp or cfunc is NULL or inconsistent.
Here is the call graph for this function:

◆ amp_ext_token_lookup()

hamlib_token_t amp_ext_token_lookup ( AMP * amp,
const char * name )

Simple search returning the extension token ID associated with name.

Parameters
ampThe AMP handle.
nameThe token name string to search.
Note
As this function calls amp_ext_lookup(), it can be considered a higher level API.
Returns
The token ID or RIG_CONF_END if there is a lookup failure.
See also
amp_ext_lookup()
Here is the call graph for this function:

◆ amp_get_conf2()

int amp_get_conf2 ( AMP * amp,
hamlib_token_t token,
char * val,
int val_len )

Query the value of an amplifier configuration parameter.

Parameters
ampThe AMP handle.
tokenThe token of the parameter to query.
valThe location where to store the value of the configuration token.

Retrieves the value of a configuration parameter associated with token.

Returns
RIG_OK if the operation has been successful, otherwise a negative value if an error occurred (in which case, cause is set appropriately).
Return values
RIG_OKQuerying the parameter was successful.
-RIG_EINVALamp is NULL or inconsistent.
-RIG_ENAVAILamp_caps::get_conf() capability is not available.
See also
amp_set_conf()
Here is the call graph for this function:

◆ amp_get_ext_level()

int amp_get_ext_level ( AMP * amp,
hamlib_token_t level,
value_t * val )

Query the value of a requested extension levels token.

Parameters
ampThe AMP handle.
levelThe requested extension levels token.
valThe variable to store the extension level token value.

Query the val corresponding to the extension level token.

Returns
RIG_OK if the operation was successful, otherwise a negative value if an error occurred (in which case, cause is set appropriately).
Return values
RIG_OKThe query was successful.
-RIG_EINVALamp is NULL or inconsistent.
-RIG_ENAVAILamp_caps::get_ext_level() capability is not available.
See also
amp_get_level()

◆ amp_get_freq()

int amp_get_freq ( AMP * amp,
freq_t * freq )

Query the operating frequency of the amplifier.

Parameters
ampThe AMP handle.
freqThe variable to store the operating frequency.

Retrieves the operating frequency from the amplifier.

Returns
RIG_OK if the operation was successful, otherwise a negative value if an error occurred (in which case, cause is set appropriately).
Return values
RIG_OKThe query was successful.
-RIG_EINVALamp is NULL or inconsistent.
-RIG_ENAVAILamp_caps::get_freq() capability is not available.
See also
amp_set_freq()

◆ amp_get_info()

const char * amp_get_info ( AMP * amp)

Query general information from the amplifier.

Parameters
ampThe AMP handle.

Retrieves some general information from the amplifier. This can include firmware revision, exact model name, or just nothing.

Returns
A pointer to static memory containing an ASCII nul terminated string (C string) if the operation has been successful, otherwise NULL if amp is NULL or inconsistent or the amp_caps::get_info() capability is not available.

◆ amp_get_level()

int amp_get_level ( AMP * amp,
setting_t level,
value_t * val )

Query the value of a requested level.

Parameters
ampThe AMP handle.
levelThe requested level.
valThe variable to store the level value.

Query the val corresponding to the level.

Note
val can be any type defined by value_t.
Returns
RIG_OK if the operation was successful, otherwise a negative value if an error occurred (in which case, cause is set appropriately).
Return values
RIG_OKThe query was successful.
-RIG_EINVALamp is NULL or inconsistent.
-RIG_ENAVAILamp_caps::get_level() capability is not available.
See also
amp_get_ext_level()

◆ amp_get_powerstat()

int amp_get_powerstat ( AMP * amp,
powerstat_t * status )

Query the power or standby status of the amplifier.

Parameters
ampThe AMP handle.
statusThe 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.

Returns
RIG_OK if the query was successful, otherwise a negative value if an error occurred (in which case, cause is set appropriately).
Return values
RIG_OKQuerying the power/standby state was successful.
-RIG_EINVALamp is NULL or inconsistent.
-RIG_ENAVAILamp_caps::get_powerstat() capability is not available.
See also
amp_set_powerstat()

◆ amp_has_get_level()

setting_t amp_has_get_level ( AMP * amp,
setting_t level )

Check which level settings can be queried.

Parameters
ampThe AMP handle.
levelThe 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:

if (amp_has_get_level(my_amp, AMP_LVL_SWR))
my_disp_SWR();
setting_t amp_has_get_level(AMP *amp, setting_t level)
Check which level settings can be queried.
Definition amp_settings.c:103
Returns
A bit map of supported level settings that can be retrieved, otherwise 0 if none supported or amp is NULL or inconsistent.
See also
amp_has_set_level(), amp_get_level()
Here is the call graph for this function:

◆ amp_has_set_level()

setting_t amp_has_set_level ( AMP * amp,
setting_t level )

Check which level settings can be set.

Parameters
ampThe AMP handle.
levelThe 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:

if (amp_has_set_level(my_amp, AMP_LVL_PWR))
my_disp_PWR();
setting_t amp_has_set_level(AMP *amp, setting_t level)
Check which level settings can be set.
Definition amp_settings.c:70
Returns
A bit map of supported level settings that can be retrieved, otherwise 0 if none supported or amp is NULL or inconsistent.
See also
amp_has_set_level(), amp_set_level()
Here is the call graph for this function:

◆ amp_init()

AMP * amp_init ( amp_model_t amp_model)

Allocate a new AMP handle.

Parameters
amp_modelThe 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).

Returns
Pointer to the AMP handle otherwise NULL if memory allocation failed or amp_model is unknown, e.g. backend autoload failed.
See also
amp_cleanup(), amp_open()
Todo
Read the Preferences here!

◆ amp_open()

int amp_open ( AMP * amp)

Open the communication channel to the amplifier.

Parameters
ampThe AMP handle of the amplifier to be opened.

Opens the communication channel to an amplifier for which the AMP handle has been passed.

Returns
RIG_OK if the operation has been successful, otherwise a negative value if an error occurred (in which case, cause is set appropriately).
Return values
RIG_OKCommunication channel successfully opened.
-RIG_EINVALamp is NULL or inconsistent.
See also
amp_init(), amp_close()
Here is the call graph for this function:

◆ amp_reset()

int amp_reset ( AMP * amp,
amp_reset_t reset )

Reset the amplifier.

Parameters
ampThe AMP handle.
resetThe reset operation to perform.

Perform a reset of the amplifier.

Returns
RIG_OK if the operation has been successful, otherwise a negative value if an error occurred (in which case, cause is set appropriately).
Return values
RIG_OKThe reset command was successful.
-RIG_EINVALamp is NULL or inconsistent.
-RIG_ENAVAILamp_caps::reset() capability is not available.

◆ amp_set_conf()

int amp_set_conf ( AMP * amp,
hamlib_token_t token,
const char * val )

Set an amplifier configuration parameter.

Parameters
ampThe AMP handle.
tokenThe token of the parameter to set.
valThe value to set the parameter to.

Sets an amplifier configuration parameter to val.

Returns
RIG_OK if the operation has been successful, otherwise a negative value if an error occurred (in which case, cause is set appropriately).
Return values
RIG_OKThe parameter was set successfully.
-RIG_EINVALamp is NULL or inconsistent or token is invalid.
-RIG_ENAVAILamp_caps::set_conf() capability is not available.
See also
amp_get_conf()
Here is the call graph for this function:

◆ amp_set_ext_level()

int amp_set_ext_level ( AMP * amp,
hamlib_token_t level,
value_t val )

Set the value of a requested extension levels token.

Parameters
ampThe AMP handle.
levelThe requested extension levels token.
valThe variable to set the extension level token value.

Query the val corresponding to the extension level token.

Returns
RIG_OK if the operation was successful, otherwise a negative value if an error occurred (in which case, cause is set appropriately).
Return values
RIG_OKThe query was successful.
-RIG_EINVALamp is NULL or inconsistent.
-RIG_ENAVAILamp_caps::set_ext_level() capability is not available.
See also
amp_set_level()

◆ amp_set_freq()

int amp_set_freq ( AMP * amp,
freq_t freq )

Set the operating frequency of the amplifier.

Parameters
ampThe AMP handle.
freqThe operating frequency.

Set the operating frequency of the amplifier. Depending on the amplifier this may simply set the bandpass filters, etc.

Returns
RIG_OK if the operation was successful, otherwise a negative value if an error occurred (in which case, cause is set appropriately).
Return values
RIG_OKSetting the frequency was successful.
-RIG_EINVALamp is NULL or inconsistent.
-RIG_ENAVAILamp_caps::set_freq() capability is not available.
See also
amp_get_freq()

◆ amp_set_level()

int amp_set_level ( AMP * amp,
setting_t level,
value_t val )

Set the value of a requested level.

Parameters
ampThe AMP handle.
levelThe requested level.
valThe variable to store the level value.

Set the val corresponding to the level.

Note
val can be any type defined by value_t.
Returns
RIG_OK if the operation was successful, otherwise a negative value if an error occurred (in which case, cause is set appropriately).
Return values
RIG_OKThe query was successful.
-RIG_EINVALamp is NULL or inconsistent.
-RIG_ENAVAILamp_caps::get_level() capability is not available.
See also
amp_set_ext_level()

◆ amp_set_powerstat()

int amp_set_powerstat ( AMP * amp,
powerstat_t status )

Turn the amplifier On or Off or toggle the Standby or Operate status.

Parameters
ampThe AMP handle
statusThe 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.

Returns
RIG_OK if the operation was successful, otherwise a negative value if an error occurred (in which case, cause is set appropriately).
Return values
RIG_OKThe requested power/standby state was successful.
-RIG_EINVALamp is NULL or inconsistent.
-RIG_ENAVAILamp_caps::set_powerstat() capability is not available.
See also
amp_get_powerstat()

◆ amp_token_foreach()

int amp_token_foreach ( AMP * amp,
int(* cfunc )(const struct confparams *, rig_ptr_t),
rig_ptr_t data )

Executes cfunc on all the elements stored in the configuration parameters table.

Parameters
ampThe AMP handle.
cfuncPointer to the callback function(...).
dataData for the callback function.

Start first with backend configuration parameters table, then finish with frontend configuration parameters table.

Returns
RIG_OK if the operation has been successful, otherwise a negative value if an error occurred (in which case, cause is set appropriately).
Return values
RIG_OKThe cfunc action completed successfully.
-RIG_EINVALamp is NULL or inconsistent or cfunc is NULL.

◆ amp_token_lookup()

hamlib_token_t amp_token_lookup ( AMP * amp,
const char * name )

Search for the token ID associated with an amplifier configuration parameter token name.

Parameters
ampThe AMP handle.
nameConfiguration parameter token name string.

Searches the backend and frontend configuration parameters tables for the token ID.

Returns
The token ID value or RIG_CONF_END if the lookup failed.
See also
amp_confparam_lookup()
Here is the call graph for this function: