Hamlib  4.0~git
Files | Data Structures | Macros | Typedefs | Functions
Amplifier

Files

file  amp_conf.c
 Amplifier Configuration Interface.
 
file  amplifier.c
 Amplifier interface.
 
file  rotlist.h
 Hamlib amplifier model definitions.
 

Data Structures

struct  opened_amp_l
 

Macros

#define CHECK_AMP_ARG(r)   (!(r) || !(r)->caps || !(r)->state.comm_state)
 
#define AMP_MODEL_NONE   0
 
#define AMP_MODEL_DUMMY   AMP_MAKE_MODEL(AMP_DUMMY, 1)
 A macro that returns the model number for the dummy backend. More...
 
#define AMP_MODEL_NETAMPCTL   AMP_MAKE_MODEL(AMP_DUMMY, 2)
 A macro that returns the model number for the Network backend. More...
 
#define AMP_DUMMY   0
 
#define AMP_BACKEND_DUMMY   "dummy"
 
#define AMP_ELECRAFT   2
 
#define AMP_BACKEND_ELECRAFT   "elecraft"
 
#define AMP_MODEL_ELECRAFT_KPA1500   AMP_MAKE_MODEL(AMP_ELECRAFT, 1)
 

Typedefs

typedef int amp_model_t
 Convenience type definition for amplifier model.
 

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...
 
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...
 
int amp_get_freq (AMP *amp, freq_t *freq)
 
int amp_set_freq (AMP *amp, freq_t freq)
 
const char * amp_get_info (AMP *amp)
 get general information from the amplifier More...
 
int amp_get_level (AMP *amp, setting_t level, value_t *val)
 
int amp_get_ext_level (AMP *amp, token_t level, value_t *val)
 
int amp_set_powerstat (AMP *amp, powerstat_t status)
 turn on/off the amplifier or standby/operate toggle More...
 
int amp_get_powerstat (AMP *amp, powerstat_t *status)
 

Detailed Description

Amplifier interface

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

Macro Definition Documentation

◆ AMP_MODEL_DUMMY

#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 usefull for testing client applications.

◆ AMP_MODEL_NETAMPCTL

#define AMP_MODEL_NETAMPCTL   AMP_MAKE_MODEL(AMP_DUMMY, 2)

A macro that returns the model number for the Network backend.

This backend allows use of the rotctld daemon through the normal Hamlib API.

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 eventualy been closed already with amp_close().

Returns
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (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 sucessful, otherwise a negative value if an error occured (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 paramter associated with token.

Returns
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (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 sucessful, otherwise NULL if an error occured or get_info not part of capabilities.

◆ 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 sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
Return values
RIG_EINVALamp is NULL or unconsistent.
RIG_ENIMPLport type communication is not implemented yet.
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 sucessful, otherwise a negative value if an error occured (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 sucessful, otherwise a negative value if an error occured (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 sucessful, ortherwise a negative value if an error occured (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.8.14

Hamlib documentation for version 4.0~git -- Sat Apr 4 2020 16:42:11
Project page: http://www.hamlib.org