Loading...
Searching...
No Matches
rotator.h
Go to the documentation of this file.
/*
* Hamlib Interface - Rotator API header
* Copyright (c) 2000-2005 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#ifndef _ROTATOR_H
#define _ROTATOR_H 1
#include <hamlib/rig.h>
#include <hamlib/rotlist.h>
__BEGIN_DECLS
/* Forward struct references */
struct rot;
struct rot_state;
typedef struct s_rot ROT;
typedef float elevation_t;
typedef float azimuth_t;
#define NETROTCTL_RET "RPRT "
#define ROT_RESET_ALL 1
typedef int rot_reset_t;
typedef enum {
ROT_FLAG_AZIMUTH = (1 << 1),
ROT_FLAG_ELEVATION = (1 << 2)
} rot_type_t;
/* So far only used in ests/dumpcaps_rot.c. */
#define ROT_TYPE_MASK (ROT_FLAG_AZIMUTH|ROT_FLAG_ELEVATION)
#define ROT_TYPE_OTHER 0
#define ROT_TYPE_AZIMUTH ROT_FLAG_AZIMUTH
#define ROT_TYPE_ELEVATION ROT_FLAG_ELEVATION
#define ROT_TYPE_AZEL (ROT_FLAG_AZIMUTH|ROT_FLAG_ELEVATION)
#define ROT_MOVE_UP (1<<1)
#define ROT_MOVE_DOWN (1<<2)
#define ROT_MOVE_LEFT (1<<3)
#define ROT_MOVE_CCW ROT_MOVE_LEFT
#define ROT_MOVE_RIGHT (1<<4)
#define ROT_MOVE_CW ROT_MOVE_RIGHT
#define ROT_MOVE_UP_LEFT (1<<5)
#define ROT_MOVE_UP_CCW ROT_MOVE_UP_LEFT
#define ROT_MOVE_UP_RIGHT (1<<6)
#define ROT_MOVE_UP_CW ROT_MOVE_UP_RIGHT
#define ROT_MOVE_DOWN_LEFT (1 << 7)
#define ROT_MOVE_DOWN_CCW ROT_MOVE_DOWN_LEFT
#define ROT_MOVE_DOWN_RIGHT (1 << 8)
#define ROT_MOVE_DOWN_CW ROT_MOVE_DOWN_RIGHT
typedef enum {
ROT_STATUS_NONE = 0,
ROT_STATUS_BUSY = (1 << 0),
ROT_STATUS_MOVING = (1 << 1),
ROT_STATUS_MOVING_AZ = (1 << 2),
ROT_STATUS_MOVING_LEFT = (1 << 3),
ROT_STATUS_MOVING_RIGHT = (1 << 4),
ROT_STATUS_MOVING_EL = (1 << 5),
ROT_STATUS_MOVING_UP = (1 << 6),
ROT_STATUS_MOVING_DOWN = (1 << 7),
ROT_STATUS_LIMIT_UP = (1 << 8),
ROT_STATUS_LIMIT_DOWN = (1 << 9),
ROT_STATUS_LIMIT_LEFT = (1 << 10),
ROT_STATUS_LIMIT_RIGHT = (1 << 11),
ROT_STATUS_OVERLAP_UP = (1 << 12),
ROT_STATUS_OVERLAP_DOWN = (1 << 13),
ROT_STATUS_OVERLAP_LEFT = (1 << 14),
ROT_STATUS_OVERLAP_RIGHT = (1 << 16),
} rot_status_t;
// Update this if any additions to status definitions
#define HAMLIB_MAX_ROTOR_STATUS 16
/* So far only used in tests/sprintflst.c. */
#define ROT_STATUS_N(n) (1u<<(n))
#define ROT_SPEED_NOCHANGE (-1)
enum rot_level_e {
ROT_LEVEL_NONE = 0,
ROT_LEVEL_SPEED = (1 << 0),
ROT_LEVEL_63 = CONSTANT_64BIT_FLAG(63),
};
#define ROT_LEVEL_FLOAT_LIST (0)
#define ROT_LEVEL_READONLY_LIST (0)
#define ROT_LEVEL_IS_FLOAT(l) ((l)&ROT_LEVEL_FLOAT_LIST)
#define ROT_LEVEL_SET(l) ((l)&~ROT_LEVEL_READONLY_LIST)
enum rot_parm_e {
ROT_PARM_NONE = 0,
};
#define ROT_PARM_FLOAT_LIST (0)
#define ROT_PARM_READONLY_LIST (0)
#define ROT_PARM_IS_FLOAT(l) ((l)&ROT_PARM_FLOAT_LIST)
#define ROT_PARM_SET(l) ((l)&~ROT_PARM_READONLY_LIST)
#define ROT_FUNC_NONE 0
#ifndef SWIGLUAHIDE
/* Hide the top 32 bits from the old Lua binding as they can't be represented */
#define ROT_FUNC_BIT63 CONSTANT_64BIT_FLAG (63)
/* 63 is this highest bit number that can be used */
#endif
/* Basic rot type, can store some useful info about different rotators. Each
* lib must be able to populate this structure, so we can make useful
* enquiries about capabilities.
*/
struct rot_caps {
rot_model_t rot_model;
const char *model_name;
const char *mfg_name;
const char *version;
const char *copyright;
enum rig_status_e status;
int rot_type;
enum rig_port_e port_type;
int serial_rate_min;
int serial_rate_max;
int serial_data_bits;
int serial_stop_bits;
enum serial_parity_e serial_parity;
enum serial_handshake_e serial_handshake;
int write_delay;
int post_write_delay;
int timeout;
int retry;
setting_t has_get_func;
setting_t has_set_func;
setting_t has_get_level;
setting_t has_set_level;
setting_t has_get_parm;
setting_t has_set_parm;
rot_status_t has_status;
gran_t level_gran[RIG_SETTING_MAX];
gran_t parm_gran[RIG_SETTING_MAX];
const struct confparams *extparms;
const struct confparams *extlevels;
const struct confparams *extfuncs;
int *ext_tokens;
/*
* Movement range, az is relative to North
* negative values allowed for overlap
*/
azimuth_t min_az;
azimuth_t max_az;
elevation_t
min_el;
elevation_t
max_el;
const struct confparams *cfgparams;
const rig_ptr_t priv;
/*
* Rot Admin API
*
*/
int (*rot_init)(ROT *rot);
int (*rot_cleanup)(ROT *rot);
int (*rot_open)(ROT *rot);
int (*rot_close)(ROT *rot);
int (*set_conf)(ROT *rot, hamlib_token_t token, const char *val);
int (*get_conf)(ROT *rot, hamlib_token_t token, char *val);
/*
* General API commands, from most primitive to least.. :()
* List Set/Get functions pairs
*/
int (*set_position)(ROT *rot, azimuth_t azimuth, elevation_t elevation);
int (*get_position)(ROT *rot, azimuth_t *azimuth, elevation_t *elevation);
int (*stop)(ROT *rot);
int (*park)(ROT *rot);
int (*reset)(ROT *rot, rot_reset_t reset);
int (*move)(ROT *rot, int direction, int speed);
/* get firmware info, etc. */
const char * (*get_info)(ROT *rot);
int (*set_level)(ROT *rot, setting_t level, value_t val);
int (*get_level)(ROT *rot, setting_t level, value_t *val);
int (*set_func)(ROT *rot, setting_t func, int status);
int (*get_func)(ROT *rot, setting_t func, int *status);
int (*set_parm)(ROT *rot, setting_t parm, value_t val);
int (*get_parm)(ROT *rot, setting_t parm, value_t *val);
int (*set_ext_level)(ROT *rot, hamlib_token_t token, value_t val);
int (*get_ext_level)(ROT *rot, hamlib_token_t token, value_t *val);
int (*set_ext_func)(ROT *rot, hamlib_token_t token, int status);
int (*get_ext_func)(ROT *rot, hamlib_token_t token, int *status);
int (*set_ext_parm)(ROT *rot, hamlib_token_t token, value_t val);
int (*get_ext_parm)(ROT *rot, hamlib_token_t token, value_t *val);
int (*get_status)(ROT *rot, rot_status_t *status);
const char *macro_name;
int (*get_conf2)(ROT *rot, hamlib_token_t token, char *val, int val_len);
};
#define ROT_MODEL(arg) .rot_model=arg,.macro_name=#arg
struct rot_state {
/*
* overridable fields
*/
azimuth_t min_az;
azimuth_t max_az;
elevation_t min_el;
elevation_t max_el;
int south_zero;
azimuth_t az_offset;
elevation_t el_offset;
setting_t has_get_func;
setting_t has_set_func;
setting_t has_get_level;
setting_t has_set_level;
setting_t has_get_parm;
setting_t has_set_parm;
rot_status_t has_status;
gran_t level_gran[RIG_SETTING_MAX];
gran_t parm_gran[RIG_SETTING_MAX];
/*
* non overridable fields, internal use
*/
hamlib_port_t_deprecated rotport_deprecated;
hamlib_port_t_deprecated rotport2_deprecated;
int comm_state;
rig_ptr_t priv;
rig_ptr_t obj;
int current_speed;
hamlib_port_t rotport;
hamlib_port_t rotport2;
rig_ptr_t *pstrotator_handler_priv_data;
deferred_config_header_t config_queue;
};
struct s_rot {
struct rot_caps *caps;
struct rot_state state;
};
/* --------------- API function prototypes -----------------*/
extern HAMLIB_EXPORT(ROT *)
rot_init HAMLIB_PARAMS((rot_model_t rot_model));
extern HAMLIB_EXPORT(int)
rot_open HAMLIB_PARAMS((ROT *rot));
extern HAMLIB_EXPORT(int)
rot_close HAMLIB_PARAMS((ROT *rot));
extern HAMLIB_EXPORT(int)
rot_cleanup HAMLIB_PARAMS((ROT *rot));
extern HAMLIB_EXPORT(int)
rot_set_conf HAMLIB_PARAMS((ROT *rot,
hamlib_token_t token,
const char *val));
extern HAMLIB_EXPORT(int)
rot_get_conf HAMLIB_PARAMS((ROT *rot,
hamlib_token_t token,
char *val));
extern HAMLIB_EXPORT(int)
rot_get_conf2 HAMLIB_PARAMS((ROT *rot,
hamlib_token_t token,
char *val,
int val_len));
/*
* General API commands, from most primitive to least.. )
* List Set/Get functions pairs
*/
extern HAMLIB_EXPORT(int)
rot_set_position HAMLIB_PARAMS((ROT *rot,
azimuth_t azimuth,
elevation_t elevation));
extern HAMLIB_EXPORT(int)
rot_get_position HAMLIB_PARAMS((ROT *rot,
azimuth_t *azimuth,
elevation_t *elevation));
extern HAMLIB_EXPORT(int)
rot_stop HAMLIB_PARAMS((ROT *rot));
extern HAMLIB_EXPORT(int)
rot_park HAMLIB_PARAMS((ROT *rot));
extern HAMLIB_EXPORT(int)
rot_reset HAMLIB_PARAMS((ROT *rot,
rot_reset_t reset));
extern HAMLIB_EXPORT(int)
rot_move HAMLIB_PARAMS((ROT *rot,
int direction,
int speed));
extern HAMLIB_EXPORT(setting_t)
rot_has_get_level HAMLIB_PARAMS((ROT *rot,
setting_t level));
extern HAMLIB_EXPORT(setting_t)
rot_has_set_level HAMLIB_PARAMS((ROT *rot,
setting_t level));
extern HAMLIB_EXPORT(setting_t)
rot_has_get_parm HAMLIB_PARAMS((ROT *rot,
setting_t parm));
extern HAMLIB_EXPORT(setting_t)
rot_has_set_parm HAMLIB_PARAMS((ROT *rot,
setting_t parm));
extern HAMLIB_EXPORT(setting_t)
rot_has_get_func HAMLIB_PARAMS((ROT *rot,
setting_t func));
extern HAMLIB_EXPORT(setting_t)
rot_has_set_func HAMLIB_PARAMS((ROT *rot,
setting_t func));
extern HAMLIB_EXPORT(int)
rot_set_func HAMLIB_PARAMS((ROT *rot,
setting_t func,
int status));
extern HAMLIB_EXPORT(int)
rot_get_func HAMLIB_PARAMS((ROT *rot,
setting_t func,
int *status));
extern HAMLIB_EXPORT(int)
rot_set_level HAMLIB_PARAMS((ROT *rig,
setting_t level,
value_t val));
extern HAMLIB_EXPORT(int)
rot_get_level HAMLIB_PARAMS((ROT *rig,
setting_t level,
value_t *val));
extern HAMLIB_EXPORT(int)
rot_set_parm HAMLIB_PARAMS((ROT *rig,
setting_t parm,
value_t val));
extern HAMLIB_EXPORT(int)
rot_get_parm HAMLIB_PARAMS((ROT *rig,
setting_t parm,
value_t *val));
extern HAMLIB_EXPORT(int)
rot_set_ext_level HAMLIB_PARAMS((ROT *rig,
hamlib_token_t token,
value_t val));
extern HAMLIB_EXPORT(int)
rot_get_ext_level HAMLIB_PARAMS((ROT *rig,
hamlib_token_t token,
value_t *val));
extern HAMLIB_EXPORT(int)
rot_set_ext_func HAMLIB_PARAMS((ROT *rig,
hamlib_token_t token,
int status));
extern HAMLIB_EXPORT(int)
rot_get_ext_func HAMLIB_PARAMS((ROT *rig,
hamlib_token_t token,
int *status));
extern HAMLIB_EXPORT(int)
rot_set_ext_parm HAMLIB_PARAMS((ROT *rig,
hamlib_token_t token,
value_t val));
extern HAMLIB_EXPORT(int)
rot_get_ext_parm HAMLIB_PARAMS((ROT *rig,
hamlib_token_t token,
value_t *val));
extern HAMLIB_EXPORT(const char *)
rot_get_info HAMLIB_PARAMS((ROT *rot));
extern HAMLIB_EXPORT(int)
rot_get_status HAMLIB_PARAMS((ROT *rot,
rot_status_t *status));
extern HAMLIB_EXPORT(int)
rot_register HAMLIB_PARAMS((const struct rot_caps *caps));
extern HAMLIB_EXPORT(int)
rot_unregister HAMLIB_PARAMS((rot_model_t rot_model));
extern HAMLIB_EXPORT(int)
rot_list_foreach HAMLIB_PARAMS((int (*cfunc)(const struct rot_caps *,
rig_ptr_t),
rig_ptr_t data));
extern HAMLIB_EXPORT(int)
rot_load_backend HAMLIB_PARAMS((const char *be_name));
extern HAMLIB_EXPORT(int)
rot_check_backend HAMLIB_PARAMS((rot_model_t rot_model));
extern HAMLIB_EXPORT(int)
rot_load_all_backends HAMLIB_PARAMS((void));
extern HAMLIB_EXPORT(rot_model_t)
rot_probe_all HAMLIB_PARAMS((hamlib_port_t *p));
extern HAMLIB_EXPORT(int)
rot_token_foreach HAMLIB_PARAMS((ROT *rot,
int (*cfunc)(const struct confparams *,
rig_ptr_t),
rig_ptr_t data));
extern HAMLIB_EXPORT(const struct confparams *)
rot_confparam_lookup HAMLIB_PARAMS((ROT *rot,
const char *name));
extern HAMLIB_EXPORT(hamlib_token_t)
rot_token_lookup HAMLIB_PARAMS((ROT *rot,
const char *name));
extern HAMLIB_EXPORT(int)
rot_ext_func_foreach HAMLIB_PARAMS((ROT *rot,
int (*cfunc)(ROT *,
const struct confparams *,
rig_ptr_t),
rig_ptr_t data));
extern HAMLIB_EXPORT(int)
rot_ext_level_foreach HAMLIB_PARAMS((ROT *rot,
int (*cfunc)(ROT *,
const struct confparams *,
rig_ptr_t),
rig_ptr_t data));
extern HAMLIB_EXPORT(int)
rot_ext_parm_foreach HAMLIB_PARAMS((ROT *rot,
int (*cfunc)(ROT *,
const struct confparams *,
rig_ptr_t),
rig_ptr_t data));
extern HAMLIB_EXPORT(const struct confparams *)
rot_ext_lookup HAMLIB_PARAMS((ROT *rot,
const char *name));
extern HAMLIB_EXPORT(const struct confparams *)
rot_ext_lookup_tok HAMLIB_PARAMS((ROT *rot,
hamlib_token_t token));
extern HAMLIB_EXPORT(hamlib_token_t)
rot_ext_token_lookup HAMLIB_PARAMS((ROT *rot,
const char *name));
extern HAMLIB_EXPORT(const struct rot_caps *)
rot_get_caps HAMLIB_PARAMS((rot_model_t rot_model));
extern HAMLIB_EXPORT(int)
qrb HAMLIB_PARAMS((double lon1,
double lat1,
double lon2,
double lat2,
double *distance,
double *azimuth));
extern HAMLIB_EXPORT(double)
distance_long_path HAMLIB_PARAMS((double distance));
extern HAMLIB_EXPORT(double)
azimuth_long_path HAMLIB_PARAMS((double azimuth));
#if 0
extern HAMLIB_EXPORT(int)
longlat2locator HAMLIB_PARAMS((double longitude,
double latitude,
char *locator_res,
int pair_count));
extern HAMLIB_EXPORT(int)
locator2longlat HAMLIB_PARAMS((double *longitude,
double *latitude,
const char *locator));
#endif
extern HAMLIB_EXPORT(double)
dms2dec HAMLIB_PARAMS((int degrees,
int minutes,
double seconds,
int sw));
extern HAMLIB_EXPORT(int)
dec2dms HAMLIB_PARAMS((double dec,
int *degrees,
int *minutes,
double *seconds,
int *sw));
extern HAMLIB_EXPORT(int)
dec2dmmm HAMLIB_PARAMS((double dec,
int *degrees,
double *minutes,
int *sw));
extern HAMLIB_EXPORT(double)
dmmm2dec HAMLIB_PARAMS((int degrees,
double minutes,
double seconds,
int sw));
extern HAMLIB_EXPORT(setting_t) rot_parse_func(const char *s);
extern HAMLIB_EXPORT(setting_t) rot_parse_level(const char *s);
extern HAMLIB_EXPORT(setting_t) rot_parse_parm(const char *s);
extern HAMLIB_EXPORT(const char *) rot_strfunc(setting_t);
extern HAMLIB_EXPORT(const char *) rot_strlevel(setting_t);
extern HAMLIB_EXPORT(const char *) rot_strparm(setting_t);
extern HAMLIB_EXPORT(const char *) rot_strstatus(rot_status_t);
extern HAMLIB_EXPORT(void *) rot_data_pointer(ROT *rot, rig_ptrx_t idx);
#define rot_debug rig_debug
__END_DECLS
#endif /* _ROTATOR_H */
rot_strstatus
const char * rot_strstatus(rot_status_t status)
Convert enum ROT_STATUS_... to a string.
Definition misc.c:2344
rot_parse_level
setting_t rot_parse_level(const char *s)
Convert alpha string to enum ROT_LEVEL_...
Definition misc.c:1123
rot_strparm
const char * rot_strparm(setting_t parm)
Convert enum ROT_PARM_... to alpha string.
Definition misc.c:1383
rot_strlevel
const char * rot_strlevel(setting_t level)
Convert enum ROT_LEVEL_... to alpha string.
Definition misc.c:1209
rot_strfunc
const char * rot_strfunc(setting_t func)
Convert enum ROT_FUNC_... to alpha string.
Definition misc.c:917
rot_parse_func
setting_t rot_parse_func(const char *s)
Convert alpha string to enum ROT_FUNC_...
Definition misc.c:861
rot_parse_parm
setting_t rot_parse_parm(const char *s)
Convert alpha string to ROT_PARM_...
Definition misc.c:1328
serial_parity_e
serial_parity_e
Serial parity.
Definition rig.h:335
hamlib_token_t
long hamlib_token_t
configuration token
Definition rig.h:863
setting_t
uint64_t setting_t
Setting.
Definition rig.h:1204
rig_port_e
rig_port_e
Port type.
Definition rig.h:314
serial_handshake_e
serial_handshake_e
Serial handshake.
Definition rig.h:347
RIG_SETTING_MAX
#define RIG_SETTING_MAX
Maximum # of rig settings.
Definition rig.h:1210
gran_t
struct gran gran_t
gran_t type
Definition rig.h:1741
rig_status_e
rig_status_e
Development status of the backend.
Definition rig.h:419
rot_ext_parm_foreach
int rot_ext_parm_foreach(ROT *rot, int(*cfunc)(ROT *, const struct confparams *, rig_ptr_t), rig_ptr_t data)
Executes cfunc on all the elements stored in the rot_caps::extparms extension parameters table.
Definition rot_ext.c:204
rot_get_info
const char * rot_get_info(ROT *rot)
Get general information from the rotator.
Definition rotator.c:1038
rot_model_t
int rot_model_t
Convenience type definition for a rotator model.
Definition rotlist.h:723
rot_status_t
rot_status_t
Rotator status flags.
Definition rotator.h:342
rot_ext_lookup
const struct confparams * rot_ext_lookup(ROT *rot, const char *name)
Lookup an extension functions, levels, or parameters token by its name and return a pointer to the co...
Definition rot_ext.c:263
rot_parm_e
rot_parm_e
Rotator Parameters.
Definition rotator.h:416
rot_get_parm
int rot_get_parm(ROT *rot, setting_t parm, value_t *val)
Query the value of a requested rotator parameter.
Definition rot_settings.c:206
rot_get_func
int rot_get_func(ROT *rot, setting_t func, int *status)
Query the status of functions of the rotator.
Definition rot_settings.c:514
rot_set_parm
int rot_set_parm(ROT *rot, setting_t parm, value_t val)
Set a rotator parameter to a given value.
Definition rot_settings.c:166
rot_set_conf
int rot_set_conf(ROT *rot, hamlib_token_t token, const char *val)
Set a rotator configuration parameter.
Definition rot_conf.c:746
rot_reset_t
int rot_reset_t
Type definition for rotator reset.
Definition rotator.h:112
rot_set_position
int rot_set_position(ROT *rot, azimuth_t azimuth, elevation_t elevation)
Set the azimuth and elevation of the rotator.
Definition rotator.c:755
rot_set_func
int rot_set_func(ROT *rot, setting_t func, int status)
Activate or deactivate functions of a rotator.
Definition rot_settings.c:470
rot_reset
int rot_reset(ROT *rot, rot_reset_t reset)
Reset the rotator.
Definition rotator.c:962
ROT
struct s_rot ROT
Main rotator handle type definition.
Definition rotator.h:63
rot_get_status
int rot_get_status(ROT *rot, rot_status_t *status)
Query status flags of the rotator.
Definition rotator.c:1071
rot_token_foreach
int rot_token_foreach(ROT *rot, int(*cfunc)(const struct confparams *, rig_ptr_t), rig_ptr_t data)
Executes cfunc on all the elements stored in the configuration parameters table.
Definition rot_conf.c:582
rot_get_level
int rot_get_level(ROT *rot, setting_t level, value_t *val)
Query the value of a requested rotator level.
Definition rot_settings.c:121
rot_has_get_level
setting_t rot_has_get_level(ROT *rot, setting_t level)
Check which rotator level settings can be queried.
Definition rot_settings.c:248
rot_get_conf
int rot_get_conf(ROT *rot, hamlib_token_t token, char *val)
Query the value of a rotator configuration parameter.
Definition rot_conf.c:805
rot_set_level
int rot_set_level(ROT *rot, setting_t level, value_t val)
Set a rotator level to a given value.
Definition rot_settings.c:77
rot_set_ext_level
int rot_set_ext_level(ROT *rot, hamlib_token_t token, value_t val)
Set a rotator extension level to a given value.
Definition rot_settings.c:557
rot_has_get_parm
setting_t rot_has_get_parm(ROT *rot, setting_t parm)
Check which rotator parameter settings can be queried.
Definition rot_settings.c:324
rot_level_e
rot_level_e
Rotator Level Settings.
Definition rotator.h:384
rot_park
int rot_park(ROT *rot)
Park the rotator.
Definition rotator.c:887
rot_set_ext_parm
int rot_set_ext_parm(ROT *rot, hamlib_token_t token, value_t val)
Set a rotator extension parameter to a given value.
Definition rot_settings.c:727
rot_get_ext_func
int rot_get_ext_func(ROT *rot, hamlib_token_t token, int *status)
Query the status of extension functions of a rotator.
Definition rot_settings.c:685
rot_data_pointer
void * rot_data_pointer(ROT *rot, rig_ptrx_t idx)
Get the address of rotator data structure(s).
Definition rotator.c:1094
rot_set_ext_func
int rot_set_ext_func(ROT *rot, hamlib_token_t token, int status)
Activate or deactivate extension functions of a rotator.
Definition rot_settings.c:641
rot_move
int rot_move(ROT *rot, int direction, int speed)
Move the rotator in the specified direction and speed.
Definition rotator.c:1003
rot_ext_level_foreach
int rot_ext_level_foreach(ROT *rot, int(*cfunc)(ROT *, const struct confparams *, rig_ptr_t), rig_ptr_t data)
Executes cfunc on all the elements stored in the rot_caps::extlevels extension levels table.
Definition rot_ext.c:148
rot_has_set_level
setting_t rot_has_set_level(ROT *rot, setting_t level)
Query the rotator levels that may be set.
Definition rot_settings.c:286
rot_get_position
int rot_get_position(ROT *rot, azimuth_t *azimuth, elevation_t *elevation)
Query the azimuth and elevation of the rotator.
Definition rotator.c:827
rot_cleanup
int rot_cleanup(ROT *rot)
Release a ROT handle and free associated memory.
Definition rotator.c:699
rot_get_ext_parm
int rot_get_ext_parm(ROT *rot, hamlib_token_t token, value_t *val)
Query the value of a requested rotator extension parameter.
Definition rot_settings.c:765
elevation_t
float elevation_t
Type definition for elevation.
Definition rotator.h:75
rot_get_ext_level
int rot_get_ext_level(ROT *rot, hamlib_token_t token, value_t *val)
Query the value of a requested rotator extension level.
Definition rot_settings.c:597
rot_type_t
rot_type_t
Rotator type flags for bitmasks.
Definition rotator.h:118
rot_ext_lookup_tok
const struct confparams * rot_ext_lookup_tok(ROT *rot, hamlib_token_t token)
Searches for an extension levels, functions, or parameters token by its constant value and return a p...
Definition rot_ext.c:315
rot_has_set_func
setting_t rot_has_set_func(ROT *rot, setting_t func)
Query support of rotator functions.
Definition rot_settings.c:434
rot_confparam_lookup
const struct confparams * rot_confparam_lookup(ROT *rot, const char *name)
Query a rotator configuration parameter token by its name.
Definition rot_conf.c:646
rot_has_set_parm
setting_t rot_has_set_parm(ROT *rot, setting_t parm)
Query the rotator parameters that may be set.
Definition rot_settings.c:361
rot_has_get_func
setting_t rot_has_get_func(ROT *rot, setting_t func)
Check which rotator functions can be queried.
Definition rot_settings.c:397
rot_close
int rot_close(ROT *rot)
Close the communication channel to the rotator.
Definition rotator.c:610
rot_ext_token_lookup
hamlib_token_t rot_ext_token_lookup(ROT *rot, const char *name)
Simple search returning the extension token ID associated with name.
Definition rot_ext.c:369
rot_stop
int rot_stop(ROT *rot)
Stop the rotator.
Definition rotator.c:925
rot_token_lookup
hamlib_token_t rot_token_lookup(ROT *rot, const char *name)
Search for the token ID associated with a rotator configuration parameter token name.
Definition rot_conf.c:711
azimuth_t
float azimuth_t
Type definition for azimuth.
Definition rotator.h:87
rot_ext_func_foreach
int rot_ext_func_foreach(ROT *rot, int(*cfunc)(ROT *, const struct confparams *, rig_ptr_t), rig_ptr_t data)
Executes cfunc on all the elements stored in the rot_caps::extfuncs table.
Definition rot_ext.c:92
rot_open
int rot_open(ROT *rot)
Open the communication channel to the rotator.
Definition rotator.c:372
rot_init
ROT * rot_init(rot_model_t rot_model)
Allocate a new ROT handle.
Definition rotator.c:218
ROT_STATUS_OVERLAP_LEFT
@ ROT_STATUS_OVERLAP_LEFT
Definition rotator.h:358
ROT_STATUS_NONE
@ ROT_STATUS_NONE
Definition rotator.h:343
ROT_STATUS_LIMIT_LEFT
@ ROT_STATUS_LIMIT_LEFT
Definition rotator.h:354
ROT_STATUS_OVERLAP_UP
@ ROT_STATUS_OVERLAP_UP
Definition rotator.h:356
ROT_STATUS_MOVING_EL
@ ROT_STATUS_MOVING_EL
Definition rotator.h:349
ROT_STATUS_MOVING_RIGHT
@ ROT_STATUS_MOVING_RIGHT
Definition rotator.h:348
ROT_STATUS_MOVING_AZ
@ ROT_STATUS_MOVING_AZ
Definition rotator.h:346
ROT_STATUS_MOVING_LEFT
@ ROT_STATUS_MOVING_LEFT
Definition rotator.h:347
ROT_STATUS_MOVING
@ ROT_STATUS_MOVING
Definition rotator.h:345
ROT_STATUS_OVERLAP_RIGHT
@ ROT_STATUS_OVERLAP_RIGHT
Definition rotator.h:359
ROT_STATUS_LIMIT_UP
@ ROT_STATUS_LIMIT_UP
Definition rotator.h:352
ROT_STATUS_MOVING_UP
@ ROT_STATUS_MOVING_UP
Definition rotator.h:350
ROT_STATUS_OVERLAP_DOWN
@ ROT_STATUS_OVERLAP_DOWN
Definition rotator.h:357
ROT_STATUS_LIMIT_DOWN
@ ROT_STATUS_LIMIT_DOWN
Definition rotator.h:353
ROT_STATUS_LIMIT_RIGHT
@ ROT_STATUS_LIMIT_RIGHT
Definition rotator.h:355
ROT_STATUS_MOVING_DOWN
@ ROT_STATUS_MOVING_DOWN
Definition rotator.h:351
ROT_STATUS_BUSY
@ ROT_STATUS_BUSY
Definition rotator.h:344
ROT_PARM_NONE
@ ROT_PARM_NONE
Definition rotator.h:417
ROT_LEVEL_NONE
@ ROT_LEVEL_NONE
Definition rotator.h:385
ROT_LEVEL_63
@ ROT_LEVEL_63
Definition rotator.h:387
ROT_LEVEL_SPEED
@ ROT_LEVEL_SPEED
Definition rotator.h:386
ROT_FLAG_ELEVATION
@ ROT_FLAG_ELEVATION
Definition rotator.h:120
ROT_FLAG_AZIMUTH
@ ROT_FLAG_AZIMUTH
Definition rotator.h:119
locator2longlat
int locator2longlat(double *longitude, double *latitude, const char *locator)
Convert QRA locator (Maidenhead grid square) to Longitude/Latitude.
Definition locator.c:451
dms2dec
double dms2dec(int degrees, int minutes, double seconds, int sw)
Convert Degrees Minutes Seconds (DMS) notation to decimal degrees (D.DDD) angle.
Definition locator.c:180
longlat2locator
int longlat2locator(double longitude, double latitude, char *locator, int pair_count)
Convert longitude/latitude to QRA locator (Maidenhead grid square).
Definition locator.c:545
azimuth_long_path
double azimuth_long_path(double azimuth)
Calculate the long path bearing between two points.
Definition locator.c:759
qrb
int qrb(double lon1, double lat1, double lon2, double lat2, double *distance, double *azimuth)
Calculate the distance and bearing between two points.
Definition locator.c:619
dec2dms
int dec2dms(double dec, int *degrees, int *minutes, double *seconds, int *sw)
Convert a decimal degrees (D.DDD) angle into Degrees Minutes Seconds (DMS) notation.
Definition locator.c:297
distance_long_path
double distance_long_path(double distance)
Calculate the long path distance between two points.
Definition locator.c:739
dmmm2dec
double dmmm2dec(int degrees, double minutes, double seconds, int sw)
Convert degrees decimal minutes (D M.MMM) notation to decimal degrees (D.DDD) angle.
Definition locator.c:237
dec2dmmm
int dec2dmmm(double dec, int *degrees, double *minutes, int *sw)
Convert a decimal degrees (D.DDD) angle into degrees decimal minutes (D M.MMM) notation.
Definition locator.c:395
rig.h
Hamlib rig data structures.
rotlist.h
Hamlib rotator model definitions.
confparams
Configuration parameter structure.
Definition rig.h:903
rot_caps
Rotator capability data structure.
Definition rotator.h:474
rot_caps::get_func
int(* get_func)(ROT *rot, setting_t func, int *status)
Definition rotator.h:562
rot_caps::min_az
azimuth_t min_az
Definition rotator.h:518
rot_caps::macro_name
const char * macro_name
Definition rotator.h:578
rot_caps::has_set_parm
setting_t has_set_parm
Definition rotator.h:502
rot_caps::has_status
rot_status_t has_status
Definition rotator.h:504
rot_caps::port_type
enum rig_port_e port_type
Definition rotator.h:483
rot_caps::serial_handshake
enum serial_handshake_e serial_handshake
Definition rotator.h:490
rot_caps::get_parm
int(* get_parm)(ROT *rot, setting_t parm, value_t *val)
Definition rotator.h:565
rot_caps::get_conf2
int(* get_conf2)(ROT *rot, hamlib_token_t token, char *val, int val_len)
Definition rotator.h:579
rot_caps::serial_data_bits
int serial_data_bits
Definition rotator.h:487
rot_caps::rot_open
int(* rot_open)(ROT *rot)
Definition rotator.h:536
rot_caps::has_set_func
setting_t has_set_func
Definition rotator.h:498
rot_caps::ext_tokens
int * ext_tokens
Definition rotator.h:512
rot_caps::get_ext_parm
int(* get_ext_parm)(ROT *rot, hamlib_token_t token, value_t *val)
Definition rotator.h:574
rot_caps::extfuncs
const struct confparams * extfuncs
Definition rotator.h:511
rot_caps::get_conf
int(* get_conf)(ROT *rot, hamlib_token_t token, char *val)
Definition rotator.h:540
rot_caps::copyright
const char * copyright
Definition rotator.h:479
rot_caps::park
int(* park)(ROT *rot)
Definition rotator.h:551
rot_caps::serial_parity
enum serial_parity_e serial_parity
Definition rotator.h:489
rot_caps::priv
const rig_ptr_t priv
Definition rotator.h:527
rot_caps::rot_cleanup
int(* rot_cleanup)(ROT *rot)
Definition rotator.h:535
rot_caps::rot_model
rot_model_t rot_model
Definition rotator.h:475
rot_caps::post_write_delay
int post_write_delay
Definition rotator.h:493
rot_caps::serial_rate_min
int serial_rate_min
Definition rotator.h:485
rot_caps::write_delay
int write_delay
Definition rotator.h:492
rot_caps::get_ext_level
int(* get_ext_level)(ROT *rot, hamlib_token_t token, value_t *val)
Definition rotator.h:568
rot_caps::set_ext_func
int(* set_ext_func)(ROT *rot, hamlib_token_t token, int status)
Definition rotator.h:570
rot_caps::has_get_level
setting_t has_get_level
Definition rotator.h:499
rot_caps::get_status
int(* get_status)(ROT *rot, rot_status_t *status)
Definition rotator.h:576
rot_caps::serial_stop_bits
int serial_stop_bits
Definition rotator.h:488
rot_caps::set_conf
int(* set_conf)(ROT *rot, hamlib_token_t token, const char *val)
Definition rotator.h:539
rot_caps::set_ext_level
int(* set_ext_level)(ROT *rot, hamlib_token_t token, value_t val)
Definition rotator.h:567
rot_caps::set_position
int(* set_position)(ROT *rot, azimuth_t azimuth, elevation_t elevation)
Definition rotator.h:547
rot_caps::version
const char * version
Definition rotator.h:478
rot_caps::has_set_level
setting_t has_set_level
Definition rotator.h:500
rot_caps::min_el
elevation_t min_el
Definition rotator.h:521
rot_caps::move
int(* move)(ROT *rot, int direction, int speed)
Definition rotator.h:553
rot_caps::parm_gran
gran_t parm_gran[64]
Definition rotator.h:507
rot_caps::retry
int retry
Definition rotator.h:495
rot_caps::timeout
int timeout
Definition rotator.h:494
rot_caps::status
enum rig_status_e status
Definition rotator.h:480
rot_caps::get_level
int(* get_level)(ROT *rot, setting_t level, value_t *val)
Definition rotator.h:559
rot_caps::serial_rate_max
int serial_rate_max
Definition rotator.h:486
rot_caps::rot_type
int rot_type
Definition rotator.h:482
rot_caps::mfg_name
const char * mfg_name
Definition rotator.h:477
rot_caps::has_get_parm
setting_t has_get_parm
Definition rotator.h:501
rot_caps::get_position
int(* get_position)(ROT *rot, azimuth_t *azimuth, elevation_t *elevation)
Definition rotator.h:548
rot_caps::has_get_func
setting_t has_get_func
Definition rotator.h:497
rot_caps::reset
int(* reset)(ROT *rot, rot_reset_t reset)
Definition rotator.h:552
rot_caps::rot_init
int(* rot_init)(ROT *rot)
Definition rotator.h:534
rot_caps::rot_close
int(* rot_close)(ROT *rot)
Definition rotator.h:537
rot_caps::extparms
const struct confparams * extparms
Definition rotator.h:509
rot_caps::max_el
elevation_t max_el
Definition rotator.h:523
rot_caps::set_parm
int(* set_parm)(ROT *rot, setting_t parm, value_t val)
Definition rotator.h:564
rot_caps::set_ext_parm
int(* set_ext_parm)(ROT *rot, hamlib_token_t token, value_t val)
Definition rotator.h:573
rot_caps::extlevels
const struct confparams * extlevels
Definition rotator.h:510
rot_caps::max_az
azimuth_t max_az
Definition rotator.h:519
rot_caps::cfgparams
const struct confparams * cfgparams
Definition rotator.h:526
rot_caps::get_ext_func
int(* get_ext_func)(ROT *rot, hamlib_token_t token, int *status)
Definition rotator.h:571
rot_caps::model_name
const char * model_name
Definition rotator.h:476
rot_caps::level_gran
gran_t level_gran[64]
Definition rotator.h:506
rot_caps::set_level
int(* set_level)(ROT *rot, setting_t level, value_t val)
Definition rotator.h:558
rot_caps::stop
int(* stop)(ROT *rot)
Definition rotator.h:550
rot_caps::set_func
int(* set_func)(ROT *rot, setting_t func, int status)
Definition rotator.h:561
rot_state
Rotator state structure.
Definition rotator.h:596
rot_state::obj
rig_ptr_t obj
Definition rotator.h:628
rot_state::priv
rig_ptr_t priv
Definition rotator.h:627
rot_state::has_set_parm
setting_t has_set_parm
Definition rotator.h:613
rot_state::level_gran
gran_t level_gran[64]
Definition rotator.h:617
rot_state::az_offset
azimuth_t az_offset
Definition rotator.h:605
rot_state::has_set_func
setting_t has_set_func
Definition rotator.h:609
rot_state::parm_gran
gran_t parm_gran[64]
Definition rotator.h:618
rot_state::rotport_deprecated
hamlib_port_t_deprecated rotport_deprecated
Definition rotator.h:623
rot_state::max_az
azimuth_t max_az
Definition rotator.h:601
rot_state::has_status
rot_status_t has_status
Definition rotator.h:615
rot_state::current_speed
int current_speed
Definition rotator.h:630
rot_state::rotport2
hamlib_port_t rotport2
Definition rotator.h:632
rot_state::rotport2_deprecated
hamlib_port_t_deprecated rotport2_deprecated
Definition rotator.h:624
rot_state::has_get_parm
setting_t has_get_parm
Definition rotator.h:612
rot_state::min_az
azimuth_t min_az
Definition rotator.h:600
rot_state::rotport
hamlib_port_t rotport
Definition rotator.h:631
rot_state::has_get_func
setting_t has_get_func
Definition rotator.h:608
rot_state::has_get_level
setting_t has_get_level
Definition rotator.h:610
rot_state::comm_state
int comm_state
Definition rotator.h:626
rot_state::min_el
elevation_t min_el
Definition rotator.h:602
rot_state::max_el
elevation_t max_el
Definition rotator.h:603
rot_state::has_set_level
setting_t has_set_level
Definition rotator.h:611
rot_state::el_offset
elevation_t el_offset
Definition rotator.h:606
rot_state::south_zero
int south_zero
Definition rotator.h:604
s_rot
Master rotator structure.
Definition rotator.h:649
s_rot::state
struct rot_state state
Definition rotator.h:651
s_rot::caps
struct rot_caps * caps
Definition rotator.h:650
value_t
Universal approach for passing values.
Definition rig.h:1028