85 #define NETROTCTL_RET "RPRT " 93 #define ROT_RESET_ALL 1 111 ROT_FLAG_AZIMUTH = (1 << 1),
112 ROT_FLAG_ELEVATION = (1 << 2)
115 #define ROT_TYPE_MASK (ROT_FLAG_AZIMUTH|ROT_FLAG_ELEVATION) 117 #define ROT_TYPE_OTHER 0 118 #define ROT_TYPE_AZIMUTH ROT_FLAG_AZIMUTH 119 #define ROT_TYPE_ELEVATION ROT_FLAG_ELEVATION 120 #define ROT_TYPE_AZEL (ROT_FLAG_AZIMUTH|ROT_FLAG_ELEVATION) 134 #define ROT_MOVE_UP (1<<1) 146 #define ROT_MOVE_DOWN (1<<2) 158 #define ROT_MOVE_LEFT (1<<3) 171 #define ROT_MOVE_CCW ROT_MOVE_LEFT 183 #define ROT_MOVE_RIGHT (1<<4) 196 #define ROT_MOVE_CW ROT_MOVE_RIGHT 222 #define ROT_STATUS_N(n) (1u<<(n)) 228 #define ROT_SPEED_NOCHANGE (-1) 247 #define ROT_LEVEL_FLOAT_LIST (0) 249 #define ROT_LEVEL_READONLY_LIST (0) 251 #define ROT_LEVEL_IS_FLOAT(l) ((l)&ROT_LEVEL_FLOAT_LIST) 252 #define ROT_LEVEL_SET(l) ((l)&~ROT_LEVEL_READONLY_LIST) 270 #define ROT_PARM_FLOAT_LIST (0) 271 #define ROT_PARM_READONLY_LIST (0) 273 #define ROT_PARM_IS_FLOAT(l) ((l)&ROT_PARM_FLOAT_LIST) 274 #define ROT_PARM_SET(l) ((l)&~ROT_PARM_READONLY_LIST) 286 #define ROT_FUNC_NONE 0 289 #define ROT_FUNC_BIT63 CONSTANT_64BIT_FLAG (63) 317 #define ROT_MODEL(arg) .rot_model=arg,.macro_name=#arg 321 const char *model_name;
322 const char *mfg_name;
324 const char *copyright;
332 int serial_data_bits;
333 int serial_stop_bits;
338 int post_write_delay;
372 const rig_ptr_t priv;
395 int (*stop)(
ROT *rot);
396 int (*park)(
ROT *rot);
398 int (*move)(
ROT *rot,
int direction,
int speed);
401 const char * (*get_info)(
ROT *rot);
423 const char *macro_name;
498 extern HAMLIB_EXPORT(
ROT *)
501 extern HAMLIB_EXPORT(
int)
504 extern HAMLIB_EXPORT(
int)
507 extern HAMLIB_EXPORT(
int)
510 extern HAMLIB_EXPORT(
int)
514 extern HAMLIB_EXPORT(
int)
523 extern HAMLIB_EXPORT(
int)
527 extern HAMLIB_EXPORT(
int)
532 extern HAMLIB_EXPORT(
int)
535 extern HAMLIB_EXPORT(
int)
538 extern HAMLIB_EXPORT(
int)
542 extern HAMLIB_EXPORT(
int)
568 extern HAMLIB_EXPORT(
int)
572 extern HAMLIB_EXPORT(
int)
577 extern HAMLIB_EXPORT(
int)
581 extern HAMLIB_EXPORT(
int)
586 extern HAMLIB_EXPORT(
int)
590 extern HAMLIB_EXPORT(
int)
595 extern HAMLIB_EXPORT(
int)
599 extern HAMLIB_EXPORT(
int)
604 extern HAMLIB_EXPORT(
int)
608 extern HAMLIB_EXPORT(
int)
613 extern HAMLIB_EXPORT(
int)
617 extern HAMLIB_EXPORT(
int)
622 extern HAMLIB_EXPORT(
const char *)
625 extern HAMLIB_EXPORT(
int)
629 extern HAMLIB_EXPORT(
int)
630 rot_register HAMLIB_PARAMS((
const struct rot_caps *caps));
632 extern HAMLIB_EXPORT(
int)
633 rot_unregister HAMLIB_PARAMS((
rot_model_t rot_model));
635 extern HAMLIB_EXPORT(
int)
636 rot_list_foreach HAMLIB_PARAMS((
int (*cfunc)(
const struct rot_caps *,
640 extern HAMLIB_EXPORT(
int)
641 rot_load_backend HAMLIB_PARAMS((
const char *be_name));
643 extern HAMLIB_EXPORT(
int)
644 rot_check_backend HAMLIB_PARAMS((
rot_model_t rot_model));
646 extern HAMLIB_EXPORT(
int)
647 rot_load_all_backends HAMLIB_PARAMS((
void));
650 rot_probe_all HAMLIB_PARAMS((hamlib_port_t *p));
652 extern HAMLIB_EXPORT(
int)
658 extern HAMLIB_EXPORT(
const struct confparams *)
666 extern HAMLIB_EXPORT(
int)
672 extern HAMLIB_EXPORT(
int)
678 extern HAMLIB_EXPORT(
int)
685 extern HAMLIB_EXPORT(
const struct confparams *)
689 extern HAMLIB_EXPORT(
const struct confparams *)
696 extern HAMLIB_EXPORT(
const struct rot_caps *)
697 rot_get_caps HAMLIB_PARAMS((
rot_model_t rot_model));
699 extern HAMLIB_EXPORT(
int)
700 qrb HAMLIB_PARAMS((
double lon1,
707 extern HAMLIB_EXPORT(
double)
710 extern HAMLIB_EXPORT(
double)
713 extern HAMLIB_EXPORT(
int)
719 extern HAMLIB_EXPORT(
int)
722 const char *locator));
724 extern HAMLIB_EXPORT(
double)
725 dms2dec HAMLIB_PARAMS((
int degrees,
730 extern HAMLIB_EXPORT(
int)
731 dec2dms HAMLIB_PARAMS((
double dec,
737 extern HAMLIB_EXPORT(
int)
743 extern HAMLIB_EXPORT(
double)
744 dmmm2dec HAMLIB_PARAMS((
int degrees,
755 extern HAMLIB_EXPORT(
const char *) rot_strstatus(
rot_status_t);
768 #define rot_debug rig_debug setting_t has_get_func
Definition: rotator.h:451
const struct confparams * rot_confparam_lookup(ROT *rot, const char *name)
lookup conf token by its name, return pointer to confparams struct.
Definition: rot_conf.c:554
Definition: rotator.h:217
rot_parm_e
Rotator Parameters.
Definition: rotator.h:264
int rot_get_func(ROT *rot, setting_t func, int *status)
get the status of functions of the rotator
Definition: rot_settings.c:440
Definition: rotator.h:207
Definition: rotator.h:208
setting_t rot_parse_parm(const char *s)
Convert alpha string to ROT_PARM_...
Definition: misc.c:1062
long token_t
configuration token
Definition: rig.h:649
Definition: rotator.h:216
int rot_reset_t
Type definition for rotator reset.
Definition: rotator.h:103
setting_t rot_parse_level(const char *s)
Convert alpha string to enum ROT_LEVEL_...
Definition: misc.c:863
int rot_set_ext_parm(ROT *rot, token_t token, value_t val)
set a rotator parm extra parameter
Definition: rot_settings.c:621
int rot_set_position(ROT *rot, azimuth_t azimuth, elevation_t elevation)
set the azimuth and elevation of the rotator
Definition: rotator.c:587
This is the master data structure, acting as a handle for the controlled rotator. ...
Definition: rotator.h:489
int rot_set_ext_func(ROT *rot, token_t token, int status)
set a rotator function extra parameter
Definition: rot_settings.c:549
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 extlevels table.
Definition: rot_ext.c:134
gran_t parm_gran[64]
Definition: rotator.h:461
int dec2dmmm(double dec, int *degrees, double *minutes, int *sw)
Convert a decimal angle into D M.MMM notation.
Definition: locator.c:345
Definition: rotator.h:210
setting_t rot_has_get_func(ROT *rot, setting_t func)
check ability of rotator functions
Definition: rot_settings.c:340
azimuth_t max_az
Definition: rotator.h:444
int rot_get_ext_level(ROT *rot, token_t token, value_t *val)
get the value of a level extra parameter
Definition: rot_settings.c:513
Definition: rotator.h:211
setting_t rot_has_set_level(ROT *rot, setting_t level)
check settable ability of level settings
Definition: rot_settings.c:252
Definition: rotator.h:213
int rot_set_conf(ROT *rot, token_t token, const char *val)
set a rotator configuration parameter
Definition: rot_conf.c:642
setting_t rot_has_set_parm(ROT *rot, setting_t parm)
check settable ability of parameter settings
Definition: rot_settings.c:311
Definition: rotator.h:205
serial_handshake_e
Serial handshake.
Definition: rig.h:238
azimuth_t min_az
Definition: rotator.h:443
const struct confparams * rot_ext_lookup(ROT *rot, const char *name)
lookup ext token by its name, return pointer to confparams struct.
Definition: rot_ext.c:234
Universal approach for passing values.
Definition: rig.h:825
Definition: rotator.h:219
setting_t has_set_level
Definition: rotator.h:454
const char * rot_strfunc(setting_t func)
Convert enum ROT_FUNC_... to alpha string.
Definition: misc.c:729
int rot_move(ROT *rot, int direction, int speed)
move the rotator in the specified direction
Definition: rotator.c:803
setting_t rot_has_set_func(ROT *rot, setting_t func)
check ability of rotator functions
Definition: rot_settings.c:370
rot_status_t
Rotator status flags.
Definition: rotator.h:202
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 extparms table.
Definition: rot_ext.c:184
int south_zero
Definition: rotator.h:447
Hamlib rotator model definitions.
rig_status_e
Development status of the backend.
Definition: rig.h:292
int rot_model_t
Convenience type definition for rotator model.
Definition: rotlist.h:500
Definition: rotator.h:206
int rot_get_level(ROT *rot, setting_t level, value_t *val)
get the value of a level
Definition: rot_settings.c:114
elevation_t el_offset
Definition: rotator.h:449
Definition: rotator.h:240
rot_status_t has_status
Definition: rotator.h:458
setting_t has_get_parm
Definition: rotator.h:455
token_t rot_token_lookup(ROT *rot, const char *name)
Simple lookup returning token id associated with name.
Definition: rot_conf.c:611
float elevation_t
Type definition for elevation.
Definition: rotator.h:67
int rot_close(ROT *rot)
close the communication to the rot
Definition: rotator.c:463
int rot_get_conf(ROT *rot, token_t token, char *val)
get the value of a configuration parameter
Definition: rot_conf.c:694
rig_ptr_t obj
Definition: rotator.h:470
#define RIG_SETTING_MAX
Maximum # of rig settings.
Definition: rig.h:968
elevation_t max_el
Definition: rotator.h:446
Definition: rotator.h:204
rot_level_e
Rotator Level Settings.
Definition: rotator.h:239
int comm_state
Definition: rotator.h:468
int rot_get_ext_func(ROT *rot, token_t token, int *status)
get the value of a function extra parameter
Definition: rot_settings.c:585
Definition: rotator.h:218
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 extfuncs table.
Definition: rot_ext.c:84
token_t token
Definition: rig.h:689
double distance_long_path(double distance)
Calculate the long path distance between two points.
Definition: locator.c:676
elevation_t min_el
Definition: rotator.h:445
double dmmm2dec(int degrees, double minutes, double seconds, int sw)
Convert D M.MMM notation to decimal degrees.
Definition: locator.c:196
int rot_park(ROT *rot)
park the antenna
Definition: rotator.c:705
const char * rot_strparm(setting_t parm)
Convert enum ROT_PARM_... to alpha string.
Definition: misc.c:1117
serial_parity_e
Serial parity.
Definition: rig.h:226
setting_t rot_has_get_parm(ROT *rot, setting_t parm)
check retrieval ability of parameter settings
Definition: rot_settings.c:282
Definition: rotator.h:242
int longlat2locator(double longitude, double latitude, char *locator, int pair_count)
Convert longitude/latitude to Maidenhead grid locator.
Definition: locator.c:485
double dms2dec(int degrees, int minutes, double seconds, int sw)
Convert DMS to decimal degrees.
Definition: locator.c:141
token_t rot_ext_token_lookup(ROT *rot, const char *name)
Simple lookup returning token id associated with name.
Definition: rot_ext.c:325
Definition: rotator.h:215
setting_t rot_parse_func(const char *s)
Convert alpha string to enum ROT_FUNC_...
Definition: misc.c:673
Hamlib rig data structures.
setting_t has_set_parm
Definition: rotator.h:456
const char * rot_get_info(ROT *rot)
get general information from the rotator
Definition: rotator.c:836
Definition: rotator.h:214
struct rot_caps * caps
Definition: rotator.h:490
double azimuth_long_path(double azimuth)
Calculate the long path bearing between two points.
Definition: locator.c:696
float azimuth_t
Type definition for azimuth.
Definition: rotator.h:79
int rot_get_status(ROT *rot, rot_status_t *status)
get status flags from the rotator
Definition: rotator.c:865
Definition: rotator.h:209
level/parm granularity definition
Definition: rig.h:1476
Definition: rotator.h:212
int rot_get_position(ROT *rot, azimuth_t *azimuth, elevation_t *elevation)
get the azimuth and elevation of the rotator
Definition: rotator.c:650
gran_t level_gran[64]
Definition: rotator.h:460
int rot_get_parm(ROT *rot, setting_t parm, value_t *val)
get the value of a parameter
Definition: rot_settings.c:187
Live data and customized fields.
Definition: rotator.h:439
int rot_stop(ROT *rot)
stop the rotator
Definition: rotator.c:738
azimuth_t az_offset
Definition: rotator.h:448
setting_t has_get_level
Definition: rotator.h:453
int locator2longlat(double *longitude, double *latitude, const char *locator)
Convert Maidenhead grid locator to Longitude/Latitude.
Definition: locator.c:397
int rot_reset(ROT *rot, rot_reset_t reset)
reset the rotator
Definition: rotator.c:772
Definition: rotator.h:265
int rot_set_func(ROT *rot, setting_t func, int status)
activate/de-activate functions of rotator
Definition: rot_settings.c:400
setting_t has_set_func
Definition: rotator.h:452
const char * rot_strlevel(setting_t level)
Convert enum ROT_LEVEL_... to alpha string.
Definition: misc.c:949
uint64_t setting_t
Setting.
Definition: rig.h:962
struct rot_state state
Definition: rotator.h:491
rig_ptr_t priv
Definition: rotator.h:469
int current_speed
Definition: rotator.h:472
setting_t rot_has_get_level(ROT *rot, setting_t level)
check retrieval ability of level settings
Definition: rot_settings.c:221
int rot_get_ext_parm(ROT *rot, token_t token, value_t *val)
get the value of a parm extra parameter
Definition: rot_settings.c:653
int rot_set_parm(ROT *rot, setting_t parm, value_t val)
set a rotator parameter
Definition: rot_settings.c:153
int rot_cleanup(ROT *rot)
release a rot handle and free associated memory
Definition: rotator.c:542
ROT * rot_init(rot_model_t rot_model)
allocate a new ROT handle
Definition: rotator.c:197
const struct confparams * rot_ext_lookup_tok(ROT *rot, token_t token)
lookup ext token, return pointer to confparams struct.
Definition: rot_ext.c:281
Configuration parameter structure.
Definition: rig.h:688
int rot_set_level(ROT *rot, setting_t level, value_t val)
set a rotator level setting
Definition: rot_settings.c:76
int dec2dms(double dec, int *degrees, int *minutes, double *seconds, int *sw)
Convert decimal degrees angle into DMS notation.
Definition: locator.c:252
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:557
rig_port_e
Port type.
Definition: rig.h:205
hamlib_port_t rotport
Definition: rotator.h:466
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 conf table.
Definition: rot_conf.c:500
int rot_set_ext_level(ROT *rot, token_t token, value_t val)
set a rotator level extra parameter
Definition: rot_settings.c:477
int rot_open(ROT *rot)
open the communication to the rot
Definition: rotator.c:331
Definition: rotator.h:241