Hamlib  4.0
Files | Functions
Amplifier

Files

file  amp_conf.c
 Amplifier Configuration Interface.
 
file  amp_settings.c
 amplifiter func/level/parm interface
 
file  amplifier.c
 Amplifier interface.
 

Functions

int frontamp_set_conf (AMP *amp, token_t token, const char *val)
 Set amplifier state info from alpha input. More...
 
int frontamp_get_conf (AMP *amp, token_t token, char *val)
 Get data from amplifier state in alpha form. More...
 
const struct confparams * amp_confparam_lookup (AMP *amp, const char *name)
 lookup conf token by its name, return pointer to confparams struct. More...
 
token_t amp_token_lookup (AMP *amp, const char *name)
 Simple lookup returning token id associated with name. More...
 
int amp_set_conf (AMP *amp, token_t token, const char *val)
 set a amplifier configuration parameter More...
 
int amp_get_conf (AMP *amp, token_t token, char *val)
 get the value of a configuration parameter More...
 
setting_t amp_has_get_level (AMP *amp, setting_t level)
 check retrieval ability of level settings More...
 
AMP * amp_init (amp_model_t amp_model)
 allocate a new AMP handle More...
 
int amp_open (AMP *amp)
 open the communication to the amp More...
 
int amp_close (AMP *amp)
 close the communication to the amp More...
 
int amp_cleanup (AMP *amp)
 release a amp handle and free associated memory More...
 
int amp_reset (AMP *amp, amp_reset_t reset)
 reset the amplifier More...
 
const char * amp_get_info (AMP *amp)
 get general information from the amplifier More...
 
int amp_set_powerstat (AMP *amp, powerstat_t status)
 turn on/off the amplifier or standby/operate toggle More...
 

Detailed Description

Amplifier interface

Amplifier can be any kind of azimuth or azimuth and elevation controlled antenna system.

Function Documentation

◆ amp_cleanup()

int amp_cleanup ( AMP *  amp)

release a amp handle and free associated memory

Parameters
ampThe AMP handle of the radio to be closed

Releases a amp struct which port has eventually been closed already 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).
See also
amp_init(), amp_close()

◆ amp_close()

int amp_close ( AMP *  amp)

close the communication to the amp

Parameters
ampThe AMP handle of the amplifier to be closed

Closes communication to a amplifier which AMP handle has been passed by argument that was previously open 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).
See also
amp_cleanup(), amp_open()

◆ amp_confparam_lookup()

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

lookup conf token by its name, return pointer to confparams struct.

Parameters
amp
name
Returns
confparams or NULL

lookup backend config table first, then fall back to frontend. TODO: should use Lex to speed it up, strcmp hurts!

◆ amp_get_conf()

int amp_get_conf ( AMP *  amp,
token_t  token,
char *  val 
)

get the value of a configuration parameter

Parameters
ampThe amp handle
tokenThe parameter
valThe location where to store the value of config 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).
See also
amp_set_conf()

◆ amp_get_info()

const char* amp_get_info ( AMP *  amp)

get 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 the ASCIIZ string if the operation has been successful, otherwise NULL if an error occurred or get_info not part of capabilities.

◆ amp_has_get_level()

setting_t amp_has_get_level ( AMP *  amp,
setting_t  level 
)

check retrieval ability of level settings

Parameters
ampThe amp handle
levelThe level settings

Checks if an amp 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)) disp_SWR();

Returns
a bit map of supported level settings that can be retrieved, otherwise 0 if none supported.
See also
amp_has_set_level(), amp_get_level()

◆ amp_init()

AMP* amp_init ( amp_model_t  amp_model)

allocate a new AMP handle

Parameters
amp_modelThe amp model for this new handle

Allocates a new AMP handle and initializes the associated data for amp_model.

Returns
a 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()

◆ amp_open()

int amp_open ( AMP *  amp)

open the communication to the amp

Parameters
ampThe AMP handle of the amplifier to be opened

Opens communication to a amplifier which AMP handle has been passed by argument.

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_EINVALamp is NULL or inconsistent.
See also
amp_init(), amp_close()

◆ amp_reset()

int amp_reset ( AMP *  amp,
amp_reset_t  reset 
)

reset the amplifier

Parameters
ampThe amp handle
resetThe reset operation to perform

Resets 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).

◆ amp_set_conf()

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

set a amplifier configuration parameter

Parameters
ampThe amp handle
tokenThe parameter
valThe value to set the parameter to

Sets a configuration parameter.

Returns
RIG_OK if the operation has been successful, otherwise a negative value if an error occurred (in which case, cause is set appropriately).
See also
amp_get_conf()

◆ amp_set_powerstat()

int amp_set_powerstat ( AMP *  amp,
powerstat_t  status 
)

turn on/off the amplifier or standby/operate toggle

Parameters
ampThe amp handle
statusThe status to set to

turns on/off the amplifier. See RIG_POWER_ON, RIG_POWER_OFF and RIG_POWER_STANDBY RIG_POWER_OPERATE defines for the status.

Returns
RIG_OK if the operation has been successful, ortherwise a negative value if an error occurred (in which case, cause is set appropriately).
See also
amp_get_powerstat()

◆ amp_token_lookup()

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

Simple lookup returning token id associated with name.

Parameters
amp
name
Returns
token enum

◆ frontamp_get_conf()

int frontamp_get_conf ( AMP *  amp,
token_t  token,
char *  val 
)

Get data from amplifier state in alpha form.

Parameters
ampnon-null
tokenTOK_... specifying which data to get
valresult non-null
Returns
RIG_OK or < 0 if error

◆ frontamp_set_conf()

int frontamp_set_conf ( AMP *  amp,
token_t  token,
const char *  val 
)

Set amplifier state info from alpha input.

Parameters
amp
tokenTOK_... specifying which info to set
valinput
Returns
RIG_OK or < 0 error

assumes amp!=NULL, val!=NULL


Generated by doxygen 1.9.1

Hamlib documentation for version 4.0
Project page: http://www.hamlib.org