Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages | Examples

settings.c File Reference

func/level/parm interface More...

#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "hamlib/rig.h"
#include "cal.h"

Functions

int rig_set_level (RIG *rig, vfo_t vfo, setting_t level, value_t val)
 set a radio level setting
int rig_get_level (RIG *rig, vfo_t vfo, setting_t level, value_t *val)
 get the value of a level
int rig_set_parm (RIG *rig, setting_t parm, value_t val)
 set a radio parameter
int rig_get_parm (RIG *rig, setting_t parm, value_t *val)
 get the value of a parameter
setting_t rig_has_get_level (RIG *rig, setting_t level)
 check retrieval ability of level settings
setting_t rig_has_set_level (RIG *rig, setting_t level)
 check settable ability of level settings
setting_t rig_has_get_parm (RIG *rig, setting_t parm)
 check retrieval ability of parameter settings
setting_t rig_has_set_parm (RIG *rig, setting_t parm)
 check settable ability of parameter settings
setting_t rig_has_get_func (RIG *rig, setting_t func)
 check ability of radio functions
setting_t rig_has_set_func (RIG *rig, setting_t func)
 check ability of radio functions
int rig_set_func (RIG *rig, vfo_t vfo, setting_t func, int status)
 activate/desactivate functions of radio
int rig_get_func (RIG *rig, vfo_t vfo, setting_t func, int *status)
 get the status of functions of the radio
int rig_set_ext_level (RIG *rig, vfo_t vfo, token_t token, value_t val)
 set a radio level extra parameter
int rig_get_ext_level (RIG *rig, vfo_t vfo, token_t token, value_t *val)
 get the value of a level extra parameter
int rig_set_ext_parm (RIG *rig, token_t token, value_t val)
 set a radio parm extra parameter
int rig_get_ext_parm (RIG *rig, token_t token, value_t *val)
 get the value of a parm extra parameter
int rig_setting2idx (setting_t s)
 basically convert setting_t expressed 2^n to n


Detailed Description

func/level/parm interface

Author:
Stephane Fillod
Date:
2000-2006
Hamlib interface is a frontend implementing wrapper functions.

Function Documentation

int rig_get_ext_level RIG rig,
vfo_t  vfo,
token_t  token,
value_t val
 

get the value of a level extra parameter

Parameters:
rig The rig handle
vfo The target VFO
token The parameter
val The location where to store the value of token
Retrieves the value of a level extra 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:
rig_set_ext_level()

int rig_get_ext_parm RIG rig,
token_t  token,
value_t val
 

get the value of a parm extra parameter

Parameters:
rig The rig handle
token The parameter
val The location where to store the value of token
Retrieves the value of a parm extra 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:
rig_set_ext_parm()

int rig_get_func RIG rig,
vfo_t  vfo,
setting_t  func,
int *  status
 

get the status of functions of the radio

Parameters:
rig The rig handle
vfo The target VFO
func The functions to get the status
status The location where to store the function status
Retrieves the status (on/off) of a function of the radio. Upon return, status will hold the status of the function, The value pointer to by the status argument is a non null value for "on", "off" otherwise, much as true/false definitions in C language.

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:
rig_set_func()

int rig_get_level RIG rig,
vfo_t  vfo,
setting_t  level,
value_t val
 

get the value of a level

Parameters:
rig The rig handle
vfo The target VFO
level The level setting
val The location where to store the value of level
Retrieves the value of a level. The level value val can be a float or an integer. See value_t for more information.

RIG_LEVEL_STRENGTH: val is an integer, representing the S Meter level in dB, according to the ideal S Meter scale. The ideal S Meter scale is as follow: S0=-54, S1=-48, S2=-42, S3=-36, S4=-30, S5=-24, S6=-18, S7=-12, S8=-6, S9=0, +10=10, +20=20, +30=30, +40=40, +50=50 and +60=60. This is the responsability of the backend to return values calibrated for this scale.

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:
rig_has_get_level(), rig_set_level()

int rig_get_parm RIG rig,
setting_t  parm,
value_t val
 

get the value of a parameter

Parameters:
rig The rig handle
parm The parameter
val The location where to store the value of parm
Retrieves the value of a parm. The parameter value val can be a float or an integer. See value_t for more information.

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:
rig_has_get_parm(), rig_set_parm()

setting_t rig_has_get_func RIG rig,
setting_t  func
 

check ability of radio functions

Parameters:
rig The rig handle
func The functions
Checks if a rig supports a set of functions. Since the func is an OR'ed bitwise argument, more than one function can be checked at the same time.

EXAMPLE: if (rig_has_get_func(my_rig,RIG_FUNC_FAGC)) disp_fagc_button();

Returns:
a bit map of supported functions, otherwise 0 if none supported.
See also:
rig_has_set_func(), rig_get_func()

setting_t rig_has_get_level RIG rig,
setting_t  level
 

check retrieval ability of level settings

Parameters:
rig The rig handle
level The level settings
Checks if a rig 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 (rig_has_get_level(my_rig, RIG_LVL_STRENGTH)) disp_Smeter();

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

setting_t rig_has_get_parm RIG rig,
setting_t  parm
 

check retrieval ability of parameter settings

Parameters:
rig The rig handle
parm The parameter settings
Checks if a rig is capable of *getting* a parm setting. Since the parm is an OR'ed bitwise argument, more than one parameter can be checked at the same time.

EXAMPLE: if (rig_has_get_parm(my_rig, RIG_PARM_ANN)) good4you();

Returns:
a bit map of supported parameter settings that can be retrieved, otherwise 0 if none supported.
See also:
rig_has_set_parm(), rig_get_parm()

setting_t rig_has_set_func RIG rig,
setting_t  func
 

check ability of radio functions

Parameters:
rig The rig handle
func The functions
Checks if a rig supports a set of functions. Since the func is an OR'ed bitwise argument, more than one function can be checked at the same time.

EXAMPLE: if (rig_has_set_func(my_rig,RIG_FUNC_FAGC)) disp_fagc_button();

Returns:
a bit map of supported functions, otherwise 0 if none supported.
See also:
rig_set_func(), rig_has_get_func()

setting_t rig_has_set_level RIG rig,
setting_t  level
 

check settable ability of level settings

Parameters:
rig The rig handle
level The level settings
Checks if a rig can *set* a level setting. Since the level is an OR'ed bitwise argument, more than one level can be check at the same time.

EXAMPLE: if (rig_has_set_level(my_rig, RIG_LVL_RFPOWER)) crank_tx();

Returns:
a bit map of supported level settings that can be set, otherwise 0 if none supported.
See also:
rig_has_get_level(), rig_set_level()

setting_t rig_has_set_parm RIG rig,
setting_t  parm
 

check settable ability of parameter settings

Parameters:
rig The rig handle
parm The parameter settings
Checks if a rig can *set* a parameter setting. Since the parm is an OR'ed bitwise argument, more than one parameter can be check at the same time.

EXAMPLE: if (rig_has_set_parm(my_rig, RIG_PARM_ANN)) announce_all();

Returns:
a bit map of supported parameter settings that can be set, otherwise 0 if none supported.
See also:
rig_has_get_parm(), rig_set_parm()

int rig_set_ext_level RIG rig,
vfo_t  vfo,
token_t  token,
value_t  val
 

set a radio level extra parameter

Parameters:
rig The rig handle
vfo The target VFO
token The parameter
val The value to set the parameter to
Sets an level extra 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:
rig_get_ext_level()

int rig_set_ext_parm RIG rig,
token_t  token,
value_t  val
 

set a radio parm extra parameter

Parameters:
rig The rig handle
token The parameter
val The value to set the parameter to
Sets an parm extra 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:
rig_get_ext_parm()

int rig_set_func RIG rig,
vfo_t  vfo,
setting_t  func,
int  status
 

activate/desactivate functions of radio

Parameters:
rig The rig handle
vfo The target VFO
func The functions to activate
status The status (on or off) to set to
Activate/desactivate a function of the radio.

The status argument is a non null value for "activate", "desactivate" otherwise, much as true/false definitions in C language.

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:
rig_get_func()

int rig_set_level RIG rig,
vfo_t  vfo,
setting_t  level,
value_t  val
 

set a radio level setting

Parameters:
rig The rig handle
vfo The target VFO
level The level setting
val The value to set the level setting to
Sets the level of a setting. The level value val can be a float or an integer. See value_t for more information.

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:
rig_has_set_level(), rig_get_level()

int rig_set_parm RIG rig,
setting_t  parm,
value_t  val
 

set a radio parameter

Parameters:
rig The rig handle
parm The parameter
val The value to set the parameter to
Sets a parameter. The parameter value val can be a float or an integer. See value_t for more information.

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:
rig_has_set_parm(), rig_get_parm()

int rig_setting2idx setting_t  s  ) 
 

basically convert setting_t expressed 2^n to n

Parameters:
s The setting to convert to
Converts a setting_t value expressed by 2^n to the value of n.

Returns:
the index such that 2^n is the setting, otherwise 0 if the setting was not found.


Generated on Sat Sep 30 15:49:37 2006 for Hamlib - the C library reference by  doxygen 1.4.4