93 #define NETROTCTL_RET "RPRT "
102 #define ROT_RESET_ALL 1
125 #define ROT_TYPE_MASK (ROT_FLAG_AZIMUTH|ROT_FLAG_ELEVATION)
138 #define ROT_TYPE_OTHER 0
139 #define ROT_TYPE_AZIMUTH ROT_FLAG_AZIMUTH
140 #define ROT_TYPE_ELEVATION ROT_FLAG_ELEVATION
141 #define ROT_TYPE_AZEL (ROT_FLAG_AZIMUTH|ROT_FLAG_ELEVATION)
154 #define ROT_MOVE_UP (1<<1)
166 #define ROT_MOVE_DOWN (1<<2)
178 #define ROT_MOVE_LEFT (1<<3)
191 #define ROT_MOVE_CCW ROT_MOVE_LEFT
203 #define ROT_MOVE_RIGHT (1<<4)
216 #define ROT_MOVE_CW ROT_MOVE_RIGHT
231 #define ROT_MOVE_UP_LEFT (1<<5)
246 #define ROT_MOVE_UP_CCW ROT_MOVE_UP_LEFT
261 #define ROT_MOVE_UP_RIGHT (1<<6)
276 #define ROT_MOVE_UP_CW ROT_MOVE_UP_RIGHT
291 #define ROT_MOVE_DOWN_LEFT (1 << 7)
307 #define ROT_MOVE_DOWN_CCW ROT_MOVE_DOWN_LEFT
322 #define ROT_MOVE_DOWN_RIGHT (1 << 8)
337 #define ROT_MOVE_DOWN_CW ROT_MOVE_DOWN_RIGHT
364 #define ROT_STATUS_N(n) (1u<<(n))
370 #define ROT_SPEED_NOCHANGE (-1)
390 #define ROT_LEVEL_FLOAT_LIST (0)
392 #define ROT_LEVEL_READONLY_LIST (0)
394 #define ROT_LEVEL_IS_FLOAT(l) ((l)&ROT_LEVEL_FLOAT_LIST)
395 #define ROT_LEVEL_SET(l) ((l)&~ROT_LEVEL_READONLY_LIST)
420 #define ROT_PARM_FLOAT_LIST (0)
421 #define ROT_PARM_READONLY_LIST (0)
423 #define ROT_PARM_IS_FLOAT(l) ((l)&ROT_PARM_FLOAT_LIST)
424 #define ROT_PARM_SET(l) ((l)&~ROT_PARM_READONLY_LIST)
442 #define ROT_FUNC_NONE 0
445 #define ROT_FUNC_BIT63 CONSTANT_64BIT_FLAG (63)
551 int (*
move)(
ROT *rot,
int direction,
int speed);
554 const char * (*get_info)(
ROT *rot);
580 #define ROT_MODEL(arg) .rot_model=arg,.macro_name=#arg
631 rig_ptr_t *pstrotator_handler_priv_data;
656 extern HAMLIB_EXPORT(
ROT *)
659 extern HAMLIB_EXPORT(
int)
662 extern HAMLIB_EXPORT(
int)
665 extern HAMLIB_EXPORT(
int)
668 extern HAMLIB_EXPORT(
int)
672 extern HAMLIB_EXPORT(
int)
677 extern HAMLIB_EXPORT(
int)
678 rot_get_conf2 HAMLIB_PARAMS((
ROT *rot,
687 extern HAMLIB_EXPORT(
int)
691 extern HAMLIB_EXPORT(
int)
696 extern HAMLIB_EXPORT(
int)
699 extern HAMLIB_EXPORT(
int)
702 extern HAMLIB_EXPORT(
int)
706 extern HAMLIB_EXPORT(
int)
732 extern HAMLIB_EXPORT(
int)
736 extern HAMLIB_EXPORT(
int)
741 extern HAMLIB_EXPORT(
int)
745 extern HAMLIB_EXPORT(
int)
750 extern HAMLIB_EXPORT(
int)
754 extern HAMLIB_EXPORT(
int)
759 extern HAMLIB_EXPORT(
int)
763 extern HAMLIB_EXPORT(
int)
768 extern HAMLIB_EXPORT(
int)
772 extern HAMLIB_EXPORT(
int)
777 extern HAMLIB_EXPORT(
int)
781 extern HAMLIB_EXPORT(
int)
786 extern HAMLIB_EXPORT(const
char *)
789 extern HAMLIB_EXPORT(
int)
793 extern HAMLIB_EXPORT(
int)
794 rot_register HAMLIB_PARAMS((const struct
rot_caps *caps));
796 extern HAMLIB_EXPORT(
int)
797 rot_unregister HAMLIB_PARAMS((
rot_model_t rot_model));
799 extern HAMLIB_EXPORT(
int)
800 rot_list_foreach HAMLIB_PARAMS((
int (*cfunc)(const struct
rot_caps *,
804 extern HAMLIB_EXPORT(
int)
805 rot_load_backend HAMLIB_PARAMS((const
char *be_name));
807 extern HAMLIB_EXPORT(
int)
808 rot_check_backend HAMLIB_PARAMS((
rot_model_t rot_model));
810 extern HAMLIB_EXPORT(
int)
811 rot_load_all_backends HAMLIB_PARAMS((
void));
814 rot_probe_all HAMLIB_PARAMS((hamlib_port_t *p));
816 extern HAMLIB_EXPORT(
int)
822 extern HAMLIB_EXPORT(const struct confparams *)
830 extern HAMLIB_EXPORT(
int)
833 const struct confparams *,
836 extern HAMLIB_EXPORT(
int)
839 const struct confparams *,
842 extern HAMLIB_EXPORT(
int)
845 const struct confparams *,
849 extern HAMLIB_EXPORT(const struct confparams *)
853 extern HAMLIB_EXPORT(const struct confparams *)
860 extern HAMLIB_EXPORT(const struct rot_caps *)
861 rot_get_caps HAMLIB_PARAMS((
rot_model_t rot_model));
863 extern HAMLIB_EXPORT(
int)
864 qrb HAMLIB_PARAMS((
double lon1,
871 extern HAMLIB_EXPORT(
double)
874 extern HAMLIB_EXPORT(
double)
878 extern HAMLIB_EXPORT(
int)
884 extern HAMLIB_EXPORT(
int)
887 const
char *locator));
890 extern HAMLIB_EXPORT(
double)
891 dms2dec HAMLIB_PARAMS((
int degrees,
896 extern HAMLIB_EXPORT(
int)
897 dec2dms HAMLIB_PARAMS((
double dec,
903 extern HAMLIB_EXPORT(
int)
909 extern HAMLIB_EXPORT(
double)
910 dmmm2dec HAMLIB_PARAMS((
int degrees,
919 extern HAMLIB_EXPORT(const
char *)
rot_strlevel(setting_t);
920 extern HAMLIB_EXPORT(const
char *)
rot_strparm(setting_t);
934 #define rot_debug rig_debug
setting_t has_get_func
Definition: rotator.h:606
setting_t has_set_func
Definition: rotator.h:496
azimuth_t max_az
Definition: rotator.h:517
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
hamlib_token_t token
Definition: rig.h:903
Definition: rotator.h:357
setting_t has_set_level
Definition: rotator.h:498
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
int(* get_parm)(ROT *rot, setting_t parm, value_t *val)
Definition: rotator.h:563
rot_parm_e
Rotator Parameters.
Definition: rotator.h:414
int(* get_status)(ROT *rot, rot_status_t *status)
Definition: rotator.h:574
int timeout
Definition: rotator.h:492
int rot_get_func(ROT *rot, setting_t func, int *status)
Query the status of functions of the rotator.
Definition: rot_settings.c:514
Definition: rotator.h:347
Definition: rotator.h:348
setting_t has_get_level
Definition: rotator.h:497
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
setting_t rot_parse_parm(const char *s)
Convert alpha string to ROT_PARM_...
Definition: misc.c:1328
Definition: rotator.h:356
int rot_reset_t
Type definition for rotator reset.
Definition: rotator.h:112
int(* rot_cleanup)(ROT *rot)
Definition: rotator.h:533
setting_t rot_parse_level(const char *s)
Convert alpha string to enum ROT_LEVEL_...
Definition: misc.c:1123
int retry
Definition: rotator.h:493
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
const struct confparams * cfgparams
Definition: rotator.h:524
const char * version
Definition: rotator.h:476
int rot_set_position(ROT *rot, azimuth_t azimuth, elevation_t elevation)
Set the azimuth and elevation of the rotator.
Definition: rotator.c:755
Master rotator structure.
Definition: rotator.h:647
int(* get_position)(ROT *rot, azimuth_t *azimuth, elevation_t *elevation)
Definition: rotator.h:546
int(* get_ext_func)(ROT *rot, hamlib_token_t token, int *status)
Definition: rotator.h:569
int(* set_ext_func)(ROT *rot, hamlib_token_t token, int status)
Definition: rotator.h:568
gran_t parm_gran[64]
Definition: rotator.h:616
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
Definition: rotator.h:350
setting_t rot_has_get_func(ROT *rot, setting_t func)
Check which rotator functions can be queried.
Definition: rot_settings.c:397
azimuth_t max_az
Definition: rotator.h:599
int(* get_conf2)(ROT *rot, hamlib_token_t token, char *val, int val_len)
Definition: rotator.h:577
Definition: rotator.h:351
setting_t rot_has_set_level(ROT *rot, setting_t level)
Query the rotator levels that may be set.
Definition: rot_settings.c:286
Definition: rotator.h:120
elevation_t max_el
Definition: rotator.h:521
Definition: rotator.h:353
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
setting_t rot_has_set_parm(ROT *rot, setting_t parm)
Query the rotator parameters that may be set.
Definition: rot_settings.c:361
Definition: rotator.h:345
serial_handshake_e
Serial handshake.
Definition: rig.h:345
int(* get_ext_level)(ROT *rot, hamlib_token_t token, value_t *val)
Definition: rotator.h:566
Rotator capability data structure.
Definition: rotator.h:472
const char * mfg_name
Definition: rotator.h:475
hamlib_port_t_deprecated rotport_deprecated
Definition: rotator.h:621
azimuth_t min_az
Definition: rotator.h:598
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
int(* move)(ROT *rot, int direction, int speed)
Definition: rotator.h:551
setting_t has_get_parm
Definition: rotator.h:499
Universal approach for passing values.
Definition: rig.h:1027
Definition: rotator.h:359
setting_t has_set_level
Definition: rotator.h:609
const char * rot_strfunc(setting_t func)
Convert enum ROT_FUNC_... to alpha string.
Definition: misc.c:917
Definition: rotator.h:343
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
int rot_move(ROT *rot, int direction, int speed)
Move the rotator in the specified direction and speed.
Definition: rotator.c:1003
rot_model_t rot_model
Definition: rotator.h:473
setting_t rot_has_set_func(ROT *rot, setting_t func)
Query support of rotator functions.
Definition: rot_settings.c:434
rot_status_t
Rotator status flags.
Definition: rotator.h:342
int south_zero
Definition: rotator.h:602
int serial_rate_min
Definition: rotator.h:483
Hamlib rotator model definitions.
rig_status_e
Development status of the backend.
Definition: rig.h:417
int rot_model_t
Convenience type definition for a rotator model.
Definition: rotlist.h:723
int(* set_conf)(ROT *rot, hamlib_token_t token, const char *val)
Definition: rotator.h:537
hamlib_port_t rotport2
Definition: rotator.h:630
rot_status_t has_status
Definition: rotator.h:502
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
int(* get_ext_parm)(ROT *rot, hamlib_token_t token, value_t *val)
Definition: rotator.h:572
Definition: rotator.h:346
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
int(* get_level)(ROT *rot, setting_t level, value_t *val)
Definition: rotator.h:557
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
elevation_t el_offset
Definition: rotator.h:604
const char * model_name
Definition: rotator.h:474
const char * macro_name
Definition: rotator.h:576
Definition: rotator.h:383
rot_status_t has_status
Definition: rotator.h:613
setting_t has_get_parm
Definition: rotator.h:610
int(* park)(ROT *rot)
Definition: rotator.h:549
int(* set_ext_level)(ROT *rot, hamlib_token_t token, value_t val)
Definition: rotator.h:565
float elevation_t
Type definition for elevation.
Definition: rotator.h:75
int(* set_parm)(ROT *rot, setting_t parm, value_t val)
Definition: rotator.h:562
int post_write_delay
Definition: rotator.h:491
int rot_close(ROT *rot)
Close the communication channel to the rotator.
Definition: rotator.c:610
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
rig_ptr_t obj
Definition: rotator.h:626
int(* get_func)(ROT *rot, setting_t func, int *status)
Definition: rotator.h:560
#define RIG_SETTING_MAX
Maximum # of rig settings.
Definition: rig.h:1209
int(* set_func)(ROT *rot, setting_t func, int status)
Definition: rotator.h:559
gran_t parm_gran[64]
Definition: rotator.h:505
elevation_t max_el
Definition: rotator.h:601
Definition: rotator.h:344
rot_level_e
Rotator Level Settings.
Definition: rotator.h:382
int comm_state
Definition: rotator.h:624
Definition: rotator.h:358
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
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
double distance_long_path(double distance)
Calculate the long path distance between two points.
Definition: locator.c:739
elevation_t min_el
Definition: rotator.h:600
int write_delay
Definition: rotator.h:490
rot_type_t
Rotator type flags for bitmasks.
Definition: rotator.h:118
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
int rot_park(ROT *rot)
Park the rotator.
Definition: rotator.c:887
const char * rot_strparm(setting_t parm)
Convert enum ROT_PARM_... to alpha string.
Definition: misc.c:1383
int(* set_level)(ROT *rot, setting_t level, value_t val)
Definition: rotator.h:556
serial_parity_e
Serial parity.
Definition: rig.h:333
setting_t rot_has_get_parm(ROT *rot, setting_t parm)
Check which rotator parameter settings can be queried.
Definition: rot_settings.c:324
Definition: rotator.h:385
int longlat2locator(double longitude, double latitude, char *locator, int pair_count)
Convert longitude/latitude to QRA locator (Maidenhead grid square).
Definition: locator.c:545
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
const struct confparams * extparms
Definition: rotator.h:507
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
int serial_stop_bits
Definition: rotator.h:486
Definition: rotator.h:355
elevation_t min_el
Definition: rotator.h:519
setting_t rot_parse_func(const char *s)
Convert alpha string to enum ROT_FUNC_...
Definition: misc.c:861
Hamlib rig data structures.
setting_t has_set_parm
Definition: rotator.h:611
const char * rot_get_info(ROT *rot)
Get general information from the rotator.
Definition: rotator.c:1038
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
Definition: rotator.h:354
int(* rot_open)(ROT *rot)
Definition: rotator.h:534
void * rot_data_pointer(ROT *rot, rig_ptrx_t idx)
Get the address of rotator data structure(s)
Definition: rotator.c:1094
int serial_rate_max
Definition: rotator.h:484
struct rot_caps * caps
Definition: rotator.h:648
int serial_data_bits
Definition: rotator.h:485
double azimuth_long_path(double azimuth)
Calculate the long path bearing between two points.
Definition: locator.c:759
const struct confparams * extlevels
Definition: rotator.h:508
float azimuth_t
Type definition for azimuth.
Definition: rotator.h:87
gran_t level_gran[64]
Definition: rotator.h:504
long hamlib_token_t
configuration token
Definition: rig.h:861
enum rig_port_e port_type
Definition: rotator.h:481
const rig_ptr_t priv
Definition: rotator.h:525
int rot_get_status(ROT *rot, rot_status_t *status)
Query status flags of the rotator.
Definition: rotator.c:1071
Definition: rotator.h:349
level/parm granularity definition
Definition: rig.h:1731
Definition: rotator.h:352
int rot_get_position(ROT *rot, azimuth_t *azimuth, elevation_t *elevation)
Query the azimuth and elevation of the rotator.
Definition: rotator.c:827
int rot_set_conf(ROT *rot, hamlib_token_t token, const char *val)
Set a rotator configuration parameter.
Definition: rot_conf.c:746
gran_t level_gran[64]
Definition: rotator.h:615
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
Rotator state structure.
Definition: rotator.h:594
int rot_stop(ROT *rot)
Stop the rotator.
Definition: rotator.c:925
azimuth_t az_offset
Definition: rotator.h:603
setting_t has_get_level
Definition: rotator.h:608
int rot_type
Definition: rotator.h:480
setting_t has_get_func
Definition: rotator.h:495
int(* get_conf)(ROT *rot, hamlib_token_t token, char *val)
Definition: rotator.h:538
int locator2longlat(double *longitude, double *latitude, const char *locator)
Convert QRA locator (Maidenhead grid square) to Longitude/Latitude.
Definition: locator.c:451
int rot_reset(ROT *rot, rot_reset_t reset)
Reset the rotator.
Definition: rotator.c:962
Definition: rotator.h:415
int rot_set_func(ROT *rot, setting_t func, int status)
Activate or deactivate functions of a rotator.
Definition: rot_settings.c:470
setting_t has_set_func
Definition: rotator.h:607
int(* set_ext_parm)(ROT *rot, hamlib_token_t token, value_t val)
Definition: rotator.h:571
const char * rot_strlevel(setting_t level)
Convert enum ROT_LEVEL_... to alpha string.
Definition: misc.c:1209
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
Definition: rotator.h:119
uint64_t setting_t
Setting.
Definition: rig.h:1203
struct rot_state state
Definition: rotator.h:649
rig_ptr_t priv
Definition: rotator.h:625
int current_speed
Definition: rotator.h:628
int(* reset)(ROT *rot, rot_reset_t reset)
Definition: rotator.h:550
hamlib_port_t_deprecated rotport2_deprecated
Definition: rotator.h:622
setting_t rot_has_get_level(ROT *rot, setting_t level)
Check which rotator level settings can be queried.
Definition: rot_settings.c:248
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
int(* set_position)(ROT *rot, azimuth_t azimuth, elevation_t elevation)
Definition: rotator.h:545
setting_t has_set_parm
Definition: rotator.h:500
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
azimuth_t min_az
Definition: rotator.h:516
int rot_cleanup(ROT *rot)
Release a ROT handle and free associated memory.
Definition: rotator.c:699
const char * copyright
Definition: rotator.h:477
ROT * rot_init(rot_model_t rot_model)
Allocate a new ROT handle.
Definition: rotator.c:218
Configuration parameter structure.
Definition: rig.h:902
enum serial_parity_e serial_parity
Definition: rotator.h:487
int(* stop)(ROT *rot)
Definition: rotator.h:548
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
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
int * ext_tokens
Definition: rotator.h:510
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
int(* rot_close)(ROT *rot)
Definition: rotator.h:535
rig_port_e
Port type.
Definition: rig.h:312
hamlib_port_t rotport
Definition: rotator.h:629
enum serial_handshake_e serial_handshake
Definition: rotator.h:488
const struct confparams * extfuncs
Definition: rotator.h:509
enum rig_status_e status
Definition: rotator.h:478
int(* rot_init)(ROT *rot)
Definition: rotator.h:532
int rot_open(ROT *rot)
Open the communication channel to the rotator.
Definition: rotator.c:372
const char * rot_strstatus(rot_status_t status)
Convert enum ROT_STATUS_... to a string.
Definition: misc.c:2344
Definition: rotator.h:384