92 #define NETROTCTL_RET "RPRT "
101 #define ROT_RESET_ALL 1
124 #define ROT_TYPE_MASK (ROT_FLAG_AZIMUTH|ROT_FLAG_ELEVATION)
137 #define ROT_TYPE_OTHER 0
138 #define ROT_TYPE_AZIMUTH ROT_FLAG_AZIMUTH
139 #define ROT_TYPE_ELEVATION ROT_FLAG_ELEVATION
140 #define ROT_TYPE_AZEL (ROT_FLAG_AZIMUTH|ROT_FLAG_ELEVATION)
153 #define ROT_MOVE_UP (1<<1)
165 #define ROT_MOVE_DOWN (1<<2)
177 #define ROT_MOVE_LEFT (1<<3)
190 #define ROT_MOVE_CCW ROT_MOVE_LEFT
202 #define ROT_MOVE_RIGHT (1<<4)
215 #define ROT_MOVE_CW ROT_MOVE_RIGHT
243 #define ROT_STATUS_N(n) (1u<<(n))
249 #define ROT_SPEED_NOCHANGE (-1)
269 #define ROT_LEVEL_FLOAT_LIST (0)
271 #define ROT_LEVEL_READONLY_LIST (0)
273 #define ROT_LEVEL_IS_FLOAT(l) ((l)&ROT_LEVEL_FLOAT_LIST)
274 #define ROT_LEVEL_SET(l) ((l)&~ROT_LEVEL_READONLY_LIST)
299 #define ROT_PARM_FLOAT_LIST (0)
300 #define ROT_PARM_READONLY_LIST (0)
302 #define ROT_PARM_IS_FLOAT(l) ((l)&ROT_PARM_FLOAT_LIST)
303 #define ROT_PARM_SET(l) ((l)&~ROT_PARM_READONLY_LIST)
321 #define ROT_FUNC_NONE 0
324 #define ROT_FUNC_BIT63 CONSTANT_64BIT_FLAG (63)
430 int (*
move)(
ROT *rot,
int direction,
int speed);
433 const char * (*get_info)(
ROT *rot);
458 #define ROT_MODEL(arg) .rot_model=arg,.macro_name=#arg
531 extern HAMLIB_EXPORT(
ROT *)
534 extern HAMLIB_EXPORT(
int)
537 extern HAMLIB_EXPORT(
int)
540 extern HAMLIB_EXPORT(
int)
543 extern HAMLIB_EXPORT(
int)
547 extern HAMLIB_EXPORT(
int)
556 extern HAMLIB_EXPORT(
int)
560 extern HAMLIB_EXPORT(
int)
565 extern HAMLIB_EXPORT(
int)
568 extern HAMLIB_EXPORT(
int)
571 extern HAMLIB_EXPORT(
int)
575 extern HAMLIB_EXPORT(
int)
601 extern HAMLIB_EXPORT(
int)
605 extern HAMLIB_EXPORT(
int)
610 extern HAMLIB_EXPORT(
int)
614 extern HAMLIB_EXPORT(
int)
619 extern HAMLIB_EXPORT(
int)
623 extern HAMLIB_EXPORT(
int)
628 extern HAMLIB_EXPORT(
int)
632 extern HAMLIB_EXPORT(
int)
637 extern HAMLIB_EXPORT(
int)
641 extern HAMLIB_EXPORT(
int)
646 extern HAMLIB_EXPORT(
int)
650 extern HAMLIB_EXPORT(
int)
655 extern HAMLIB_EXPORT(
const char *)
658 extern HAMLIB_EXPORT(
int)
662 extern HAMLIB_EXPORT(
int)
663 rot_register HAMLIB_PARAMS((
const struct rot_caps *caps));
665 extern HAMLIB_EXPORT(
int)
666 rot_unregister HAMLIB_PARAMS((
rot_model_t rot_model));
668 extern HAMLIB_EXPORT(
int)
669 rot_list_foreach HAMLIB_PARAMS((
int (*cfunc)(
const struct rot_caps *,
673 extern HAMLIB_EXPORT(
int)
674 rot_load_backend HAMLIB_PARAMS((
const char *be_name));
676 extern HAMLIB_EXPORT(
int)
677 rot_check_backend HAMLIB_PARAMS((
rot_model_t rot_model));
679 extern HAMLIB_EXPORT(
int)
680 rot_load_all_backends HAMLIB_PARAMS((
void));
683 rot_probe_all HAMLIB_PARAMS((hamlib_port_t *p));
685 extern HAMLIB_EXPORT(
int)
691 extern HAMLIB_EXPORT(
const struct confparams *)
699 extern HAMLIB_EXPORT(
int)
705 extern HAMLIB_EXPORT(
int)
711 extern HAMLIB_EXPORT(
int)
718 extern HAMLIB_EXPORT(
const struct confparams *)
722 extern HAMLIB_EXPORT(
const struct confparams *)
729 extern HAMLIB_EXPORT(
const struct rot_caps *)
730 rot_get_caps HAMLIB_PARAMS((
rot_model_t rot_model));
732 extern HAMLIB_EXPORT(
int)
733 qrb HAMLIB_PARAMS((
double lon1,
740 extern HAMLIB_EXPORT(
double)
743 extern HAMLIB_EXPORT(
double)
746 extern HAMLIB_EXPORT(
int)
752 extern HAMLIB_EXPORT(
int)
755 const char *locator));
757 extern HAMLIB_EXPORT(
double)
758 dms2dec HAMLIB_PARAMS((
int degrees,
763 extern HAMLIB_EXPORT(
int)
764 dec2dms HAMLIB_PARAMS((
double dec,
770 extern HAMLIB_EXPORT(
int)
776 extern HAMLIB_EXPORT(
double)
777 dmmm2dec HAMLIB_PARAMS((
int degrees,
788 extern HAMLIB_EXPORT(
const char *) rot_strstatus(
rot_status_t);
799 #define rot_debug rig_debug
const char * rot_strlevel(setting_t level)
Convert enum ROT_LEVEL_... to alpha string.
Definition: misc.c:1025
const char * rot_strfunc(setting_t func)
Convert enum ROT_FUNC_... to alpha string.
Definition: misc.c:797
setting_t rot_parse_level(const char *s)
Convert alpha string to enum ROT_LEVEL_...
Definition: misc.c:939
const char * rot_strparm(setting_t parm)
Convert enum ROT_PARM_... to alpha string.
Definition: misc.c:1193
setting_t rot_parse_func(const char *s)
Convert alpha string to enum ROT_FUNC_...
Definition: misc.c:741
setting_t rot_parse_parm(const char *s)
Convert alpha string to ROT_PARM_...
Definition: misc.c:1138
serial_parity_e
Serial parity.
Definition: rig.h:260
uint64_t setting_t
Setting.
Definition: rig.h:1032
rig_port_e
Port type.
Definition: rig.h:239
serial_handshake_e
Serial handshake.
Definition: rig.h:272
#define RIG_SETTING_MAX
Maximum # of rig settings.
Definition: rig.h:1038
long token_t
configuration token
Definition: rig.h:695
rig_status_e
Development status of the backend.
Definition: rig.h:326
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:206
int rot_model_t
Convenience type definition for a rotator model.
Definition: rotlist.h:627
const struct confparams * rot_confparam_lookup(ROT *rot, const char *name)
Query a rotator configuration parameter token by its name.
Definition: rot_conf.c:603
rot_status_t
Rotator status flags.
Definition: rotator.h:221
rot_parm_e
Rotator Parameters.
Definition: rotator.h:293
ROT * rot_init(rot_model_t rot_model)
Allocate a new ROT handle.
Definition: rotator.c:218
int rot_get_parm(ROT *rot, setting_t parm, value_t *val)
Query the value of a requested rotator parameter.
Definition: rot_settings.c:213
int rot_get_func(ROT *rot, setting_t func, int *status)
Query the status of functions of the rotator.
Definition: rot_settings.c:521
int rot_set_parm(ROT *rot, setting_t parm, value_t val)
Set a rotator parameter to a given value.
Definition: rot_settings.c:173
int rot_get_conf(ROT *rot, token_t token, char *val)
Query the value of a rotator configuration parameter.
Definition: rot_conf.c:759
int rot_set_ext_func(ROT *rot, token_t token, int status)
Activate or deactivate extension functions of a rotator.
Definition: rot_settings.c:648
int rot_reset_t
Type definition for rotator reset.
Definition: rotator.h:111
const char * rot_get_info(ROT *rot)
Get general information from the rotator.
Definition: rotator.c:928
int rot_set_position(ROT *rot, azimuth_t azimuth, elevation_t elevation)
Set the azimuth and elevation of the rotator.
Definition: rotator.c:646
int rot_set_func(ROT *rot, setting_t func, int status)
Activate or deactivate functions of a rotator.
Definition: rot_settings.c:477
int rot_reset(ROT *rot, rot_reset_t reset)
Reset the rotator.
Definition: rotator.c:853
int rot_get_status(ROT *rot, rot_status_t *status)
Query status flags of the rotator.
Definition: rotator.c:961
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:539
int rot_set_ext_level(ROT *rot, token_t token, value_t val)
Set a rotator extension level to a given value.
Definition: rot_settings.c:564
int rot_get_level(ROT *rot, setting_t level, value_t *val)
Query the value of a requested rotator level.
Definition: rot_settings.c:128
setting_t rot_has_get_level(ROT *rot, setting_t level)
Check which rotator level settings can be queried.
Definition: rot_settings.c:255
int rot_set_level(ROT *rot, setting_t level, value_t val)
Set a rotator level to a given value.
Definition: rot_settings.c:84
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:370
setting_t rot_has_get_parm(ROT *rot, setting_t parm)
Check which rotator parameter settings can be queried.
Definition: rot_settings.c:331
rot_level_e
Rotator Level Settings.
Definition: rotator.h:261
int rot_park(ROT *rot)
Park the rotator.
Definition: rotator.c:778
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:668
int rot_move(ROT *rot, int direction, int speed)
Move the rotator in the specified direction and speed.
Definition: rotator.c:893
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:150
setting_t rot_has_set_level(ROT *rot, setting_t level)
Query the rotator levels that may be set.
Definition: rot_settings.c:293
int rot_get_position(ROT *rot, azimuth_t *azimuth, elevation_t *elevation)
Query the azimuth and elevation of the rotator.
Definition: rotator.c:718
int rot_cleanup(ROT *rot)
Release a ROT handle and free associated memory.
Definition: rotator.c:592
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:265
float elevation_t
Type definition for elevation.
Definition: rotator.h:74
rot_type_t
Rotator type flags for bitmasks.
Definition: rotator.h:117
setting_t rot_has_set_func(ROT *rot, setting_t func)
Query support of rotator functions.
Definition: rot_settings.c:441
int rot_get_ext_parm(ROT *rot, token_t token, value_t *val)
Query the value of a requested rotator extension parameter.
Definition: rot_settings.c:772
setting_t rot_has_set_parm(ROT *rot, setting_t parm)
Query the rotator parameters that may be set.
Definition: rot_settings.c:368
setting_t rot_has_get_func(ROT *rot, setting_t func)
Check which rotator functions can be queried.
Definition: rot_settings.c:404
int rot_close(ROT *rot)
Close the communication channel to the rotator.
Definition: rotator.c:507
int rot_get_ext_level(ROT *rot, token_t token, value_t *val)
Query the value of a requested rotator extension level.
Definition: rot_settings.c:604
int rot_stop(ROT *rot)
Stop the rotator.
Definition: rotator.c:816
int rot_set_ext_parm(ROT *rot, token_t token, value_t val)
Set a rotator extension parameter to a given value.
Definition: rot_settings.c:734
int rot_get_ext_func(ROT *rot, token_t token, int *status)
Query the status of extension functions of a rotator.
Definition: rot_settings.c:692
float azimuth_t
Type definition for azimuth.
Definition: rotator.h:86
const struct confparams * rot_ext_lookup_tok(ROT *rot, token_t token)
Searches for an extension levels, functions, or parameters token by its constant value and return a p...
Definition: rot_ext.c:317
int rot_set_conf(ROT *rot, token_t token, const char *val)
Set a rotator configuration parameter.
Definition: rot_conf.c:703
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:94
int rot_open(ROT *rot)
Open the communication channel to the rotator.
Definition: rotator.c:355
@ ROT_STATUS_OVERLAP_LEFT
Definition: rotator.h:237
@ ROT_STATUS_NONE
Definition: rotator.h:222
@ ROT_STATUS_LIMIT_LEFT
Definition: rotator.h:233
@ ROT_STATUS_OVERLAP_UP
Definition: rotator.h:235
@ ROT_STATUS_MOVING_EL
Definition: rotator.h:228
@ ROT_STATUS_MOVING_RIGHT
Definition: rotator.h:227
@ ROT_STATUS_MOVING_AZ
Definition: rotator.h:225
@ ROT_STATUS_MOVING_LEFT
Definition: rotator.h:226
@ ROT_STATUS_MOVING
Definition: rotator.h:224
@ ROT_STATUS_OVERLAP_RIGHT
Definition: rotator.h:238
@ ROT_STATUS_LIMIT_UP
Definition: rotator.h:231
@ ROT_STATUS_MOVING_UP
Definition: rotator.h:229
@ ROT_STATUS_OVERLAP_DOWN
Definition: rotator.h:236
@ ROT_STATUS_LIMIT_DOWN
Definition: rotator.h:232
@ ROT_STATUS_LIMIT_RIGHT
Definition: rotator.h:234
@ ROT_STATUS_MOVING_DOWN
Definition: rotator.h:230
@ ROT_STATUS_BUSY
Definition: rotator.h:223
@ ROT_PARM_NONE
Definition: rotator.h:294
@ ROT_LEVEL_NONE
Definition: rotator.h:262
@ ROT_LEVEL_63
Definition: rotator.h:264
@ ROT_LEVEL_SPEED
Definition: rotator.h:263
@ ROT_FLAG_ELEVATION
Definition: rotator.h:119
@ ROT_FLAG_AZIMUTH
Definition: rotator.h:118
int locator2longlat(double *longitude, double *latitude, const char *locator)
Convert QRA locator (Maidenhead grid square) to Longitude/Latitude.
Definition: locator.c:454
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:183
int longlat2locator(double longitude, double latitude, char *locator, int pair_count)
Convert longitude/latitude to QRA locator (Maidenhead grid square).
Definition: locator.c:548
double azimuth_long_path(double azimuth)
Calculate the long path bearing between two points.
Definition: locator.c:762
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:622
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:300
double distance_long_path(double distance)
Calculate the long path distance between two points.
Definition: locator.c:742
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:240
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:398
Hamlib rig data structures.
Hamlib rotator model definitions.
Configuration parameter structure.
Definition: rig.h:734
token_t token
Definition: rig.h:735
level/parm granularity definition
Definition: rig.h:1546
Rotator capability data structure.
Definition: rotator.h:351
int(* get_func)(ROT *rot, setting_t func, int *status)
Definition: rotator.h:439
azimuth_t min_az
Definition: rotator.h:395
const char * macro_name
Definition: rotator.h:455
setting_t has_set_parm
Definition: rotator.h:379
rot_status_t has_status
Definition: rotator.h:381
int(* get_ext_parm)(ROT *rot, token_t token, value_t *val)
Definition: rotator.h:451
enum rig_port_e port_type
Definition: rotator.h:360
enum serial_handshake_e serial_handshake
Definition: rotator.h:367
int(* get_parm)(ROT *rot, setting_t parm, value_t *val)
Definition: rotator.h:442
int serial_data_bits
Definition: rotator.h:364
int(* set_ext_parm)(ROT *rot, token_t token, value_t val)
Definition: rotator.h:450
int(* rot_open)(ROT *rot)
Definition: rotator.h:413
setting_t has_set_func
Definition: rotator.h:375
int * ext_tokens
Definition: rotator.h:389
const struct confparams * extfuncs
Definition: rotator.h:388
const char * copyright
Definition: rotator.h:356
int(* park)(ROT *rot)
Definition: rotator.h:428
enum serial_parity_e serial_parity
Definition: rotator.h:366
const rig_ptr_t priv
Definition: rotator.h:404
int(* rot_cleanup)(ROT *rot)
Definition: rotator.h:412
rot_model_t rot_model
Definition: rotator.h:352
int post_write_delay
Definition: rotator.h:370
int serial_rate_min
Definition: rotator.h:362
int write_delay
Definition: rotator.h:369
setting_t has_get_level
Definition: rotator.h:376
int(* get_status)(ROT *rot, rot_status_t *status)
Definition: rotator.h:453
int serial_stop_bits
Definition: rotator.h:365
int(* set_position)(ROT *rot, azimuth_t azimuth, elevation_t elevation)
Definition: rotator.h:424
int(* get_ext_func)(ROT *rot, token_t token, int *status)
Definition: rotator.h:448
const char * version
Definition: rotator.h:355
setting_t has_set_level
Definition: rotator.h:377
elevation_t min_el
Definition: rotator.h:398
int(* move)(ROT *rot, int direction, int speed)
Definition: rotator.h:430
gran_t parm_gran[64]
Definition: rotator.h:384
int retry
Definition: rotator.h:372
int timeout
Definition: rotator.h:371
enum rig_status_e status
Definition: rotator.h:357
int(* get_level)(ROT *rot, setting_t level, value_t *val)
Definition: rotator.h:436
int serial_rate_max
Definition: rotator.h:363
int rot_type
Definition: rotator.h:359
const char * mfg_name
Definition: rotator.h:354
setting_t has_get_parm
Definition: rotator.h:378
int(* get_ext_level)(ROT *rot, token_t token, value_t *val)
Definition: rotator.h:445
int(* get_position)(ROT *rot, azimuth_t *azimuth, elevation_t *elevation)
Definition: rotator.h:425
setting_t has_get_func
Definition: rotator.h:374
int(* reset)(ROT *rot, rot_reset_t reset)
Definition: rotator.h:429
int(* set_ext_func)(ROT *rot, token_t token, int status)
Definition: rotator.h:447
int(* rot_init)(ROT *rot)
Definition: rotator.h:411
int(* rot_close)(ROT *rot)
Definition: rotator.h:414
const struct confparams * extparms
Definition: rotator.h:386
elevation_t max_el
Definition: rotator.h:400
int(* set_parm)(ROT *rot, setting_t parm, value_t val)
Definition: rotator.h:441
int(* set_ext_level)(ROT *rot, token_t token, value_t val)
Definition: rotator.h:444
int(* set_conf)(ROT *rot, token_t token, const char *val)
Definition: rotator.h:416
int(* get_conf)(ROT *rot, token_t token, char *val)
Definition: rotator.h:417
const struct confparams * extlevels
Definition: rotator.h:387
azimuth_t max_az
Definition: rotator.h:396
const struct confparams * cfgparams
Definition: rotator.h:403
const char * model_name
Definition: rotator.h:353
gran_t level_gran[64]
Definition: rotator.h:383
int(* set_level)(ROT *rot, setting_t level, value_t val)
Definition: rotator.h:435
int(* stop)(ROT *rot)
Definition: rotator.h:427
int(* set_func)(ROT *rot, setting_t func, int status)
Definition: rotator.h:438
Rotator state structure.
Definition: rotator.h:472
rig_ptr_t obj
Definition: rotator.h:504
rig_ptr_t priv
Definition: rotator.h:503
setting_t has_set_parm
Definition: rotator.h:489
gran_t level_gran[64]
Definition: rotator.h:493
azimuth_t az_offset
Definition: rotator.h:481
setting_t has_set_func
Definition: rotator.h:485
gran_t parm_gran[64]
Definition: rotator.h:494
azimuth_t max_az
Definition: rotator.h:477
rot_status_t has_status
Definition: rotator.h:491
int current_speed
Definition: rotator.h:506
hamlib_port_t rotport2
Definition: rotator.h:500
setting_t has_get_parm
Definition: rotator.h:488
azimuth_t min_az
Definition: rotator.h:476
hamlib_port_t rotport
Definition: rotator.h:499
setting_t has_get_func
Definition: rotator.h:484
setting_t has_get_level
Definition: rotator.h:486
int comm_state
Definition: rotator.h:502
elevation_t min_el
Definition: rotator.h:478
elevation_t max_el
Definition: rotator.h:479
setting_t has_set_level
Definition: rotator.h:487
elevation_t el_offset
Definition: rotator.h:482
int south_zero
Definition: rotator.h:480
Master rotator structure.
Definition: rotator.h:522
struct rot_state state
Definition: rotator.h:524
struct rot_caps * caps
Definition: rotator.h:523
Universal approach for passing values.
Definition: rig.h:871