Hamlib  4.6.5
rotator.h
Go to the documentation of this file.
1 /*
2  * Hamlib Interface - Rotator API header
3  * Copyright (c) 2000-2005 by Stephane Fillod
4  *
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  *
20  */
21 /* SPDX-License-Identifier: LGPL-2.1-or-later */
22 
23 #ifndef _ROTATOR_H
24 #define _ROTATOR_H 1
25 
26 #include <hamlib/rig.h>
27 #include <hamlib/rotlist.h>
28 
46 __BEGIN_DECLS
47 
48 /* Forward struct references */
49 
50 struct rot;
51 struct rot_state;
52 
53 
63 typedef struct s_rot ROT;
64 
65 
75 typedef float elevation_t;
76 
77 
87 typedef float azimuth_t;
88 
89 
93 #define NETROTCTL_RET "RPRT "
94 
95 
102 #define ROT_RESET_ALL 1
103 
104 
112 typedef int rot_reset_t;
113 
114 
118 typedef enum {
119  ROT_FLAG_AZIMUTH = (1 << 1),
120  ROT_FLAG_ELEVATION = (1 << 2)
121 } rot_type_t;
122 
124 /* So far only used in ests/dumpcaps_rot.c. */
125 #define ROT_TYPE_MASK (ROT_FLAG_AZIMUTH|ROT_FLAG_ELEVATION)
126 
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)
142 
143 
154 #define ROT_MOVE_UP (1<<1)
155 
166 #define ROT_MOVE_DOWN (1<<2)
167 
178 #define ROT_MOVE_LEFT (1<<3)
179 
191 #define ROT_MOVE_CCW ROT_MOVE_LEFT
192 
203 #define ROT_MOVE_RIGHT (1<<4)
204 
216 #define ROT_MOVE_CW ROT_MOVE_RIGHT
217 
231 #define ROT_MOVE_UP_LEFT (1<<5)
232 
246 #define ROT_MOVE_UP_CCW ROT_MOVE_UP_LEFT
247 
261 #define ROT_MOVE_UP_RIGHT (1<<6)
262 
276 #define ROT_MOVE_UP_CW ROT_MOVE_UP_RIGHT
277 
291 #define ROT_MOVE_DOWN_LEFT (1 << 7)
292 
293 
307 #define ROT_MOVE_DOWN_CCW ROT_MOVE_DOWN_LEFT
308 
322 #define ROT_MOVE_DOWN_RIGHT (1 << 8)
323 
337 #define ROT_MOVE_DOWN_CW ROT_MOVE_DOWN_RIGHT
338 
342 typedef enum {
344  ROT_STATUS_BUSY = (1 << 0),
345  ROT_STATUS_MOVING = (1 << 1),
346  ROT_STATUS_MOVING_AZ = (1 << 2),
349  ROT_STATUS_MOVING_EL = (1 << 5),
350  ROT_STATUS_MOVING_UP = (1 << 6),
352  ROT_STATUS_LIMIT_UP = (1 << 8),
354  ROT_STATUS_LIMIT_LEFT = (1 << 10),
356  ROT_STATUS_OVERLAP_UP = (1 << 12),
360 } rot_status_t;
361 // Update this if any additions to status definitions
362 #define HAMLIB_MAX_ROTOR_STATUS 16
363 
365 /* So far only used in tests/sprintflst.c. */
366 #define ROT_STATUS_N(n) (1u<<(n))
367 
372 #define ROT_SPEED_NOCHANGE (-1)
373 
374 
386  ROT_LEVEL_SPEED = (1 << 0),
387  ROT_LEVEL_63 = CONSTANT_64BIT_FLAG(63),
388 };
389 
390 
392 #define ROT_LEVEL_FLOAT_LIST (0)
393 
394 #define ROT_LEVEL_READONLY_LIST (0)
395 
396 #define ROT_LEVEL_IS_FLOAT(l) ((l)&ROT_LEVEL_FLOAT_LIST)
397 #define ROT_LEVEL_SET(l) ((l)&~ROT_LEVEL_READONLY_LIST)
398 
400 
418 };
419 
420 
422 #define ROT_PARM_FLOAT_LIST (0)
423 #define ROT_PARM_READONLY_LIST (0)
424 
425 #define ROT_PARM_IS_FLOAT(l) ((l)&ROT_PARM_FLOAT_LIST)
426 #define ROT_PARM_SET(l) ((l)&~ROT_PARM_READONLY_LIST)
427 
429 
444 #define ROT_FUNC_NONE 0
445 #ifndef SWIGLUAHIDE
446 /* Hide the top 32 bits from the old Lua binding as they can't be represented */
447 #define ROT_FUNC_BIT63 CONSTANT_64BIT_FLAG (63)
448 /* 63 is this highest bit number that can be used */
449 #endif
450 
451 
452 /* Basic rot type, can store some useful info about different rotators. Each
453  * lib must be able to populate this structure, so we can make useful
454  * enquiries about capabilities.
455  */
456 
474 struct rot_caps {
476  const char *model_name;
477  const char *mfg_name;
478  const char *version;
479  const char *copyright;
482  int rot_type;
494  int timeout;
495  int retry;
509  const struct confparams *extparms;
510  const struct confparams *extlevels;
511  const struct confparams *extfuncs;
512  int *ext_tokens;
514  /*
515  * Movement range, az is relative to North
516  * negative values allowed for overlap
517  */
526  const struct confparams *cfgparams;
527  const rig_ptr_t priv;
529  /*
530  * Rot Admin API
531  *
532  */
533 
534  int (*rot_init)(ROT *rot);
535  int (*rot_cleanup)(ROT *rot);
536  int (*rot_open)(ROT *rot);
537  int (*rot_close)(ROT *rot);
539  int (*set_conf)(ROT *rot, hamlib_token_t token, const char *val);
540  int (*get_conf)(ROT *rot, hamlib_token_t token, char *val);
542  /*
543  * General API commands, from most primitive to least.. :()
544  * List Set/Get functions pairs
545  */
546 
547  int (*set_position)(ROT *rot, azimuth_t azimuth, elevation_t elevation);
548  int (*get_position)(ROT *rot, azimuth_t *azimuth, elevation_t *elevation);
550  int (*stop)(ROT *rot);
551  int (*park)(ROT *rot);
552  int (*reset)(ROT *rot, rot_reset_t reset);
553  int (*move)(ROT *rot, int direction, int speed);
555  /* get firmware info, etc. */
556  const char * (*get_info)(ROT *rot);
558  int (*set_level)(ROT *rot, setting_t level, value_t val);
559  int (*get_level)(ROT *rot, setting_t level, value_t *val);
561  int (*set_func)(ROT *rot, setting_t func, int status);
562  int (*get_func)(ROT *rot, setting_t func, int *status);
564  int (*set_parm)(ROT *rot, setting_t parm, value_t val);
565  int (*get_parm)(ROT *rot, setting_t parm, value_t *val);
578  const char *macro_name;
579  int (*get_conf2)(ROT *rot, hamlib_token_t token, char *val, int val_len);
580 };
582 #define ROT_MODEL(arg) .rot_model=arg,.macro_name=#arg
583 
585 
596 struct rot_state {
597  /*
598  * overridable fields
599  */
620  /*
621  * non overridable fields, internal use
622  */
623  hamlib_port_t_deprecated rotport_deprecated;
624  hamlib_port_t_deprecated rotport2_deprecated;
627  rig_ptr_t priv;
628  rig_ptr_t obj;
631  hamlib_port_t rotport;
632  hamlib_port_t rotport2;
633  rig_ptr_t *pstrotator_handler_priv_data;
634  deferred_config_header_t config_queue;
635 };
636 
637 
649 struct s_rot {
650  struct rot_caps *caps;
651  struct rot_state state;
652 };
653 
654 
656 /* --------------- API function prototypes -----------------*/
657 
658 extern HAMLIB_EXPORT(ROT *)
659 rot_init HAMLIB_PARAMS((rot_model_t rot_model));
660 
661 extern HAMLIB_EXPORT(int)
662 rot_open HAMLIB_PARAMS((ROT *rot));
663 
664 extern HAMLIB_EXPORT(int)
665 rot_close HAMLIB_PARAMS((ROT *rot));
666 
667 extern HAMLIB_EXPORT(int)
668 rot_cleanup HAMLIB_PARAMS((ROT *rot));
669 
670 extern HAMLIB_EXPORT(int)
671 rot_set_conf HAMLIB_PARAMS((ROT *rot,
672  hamlib_token_t token,
673  const char *val));
674 extern HAMLIB_EXPORT(int)
675 rot_get_conf HAMLIB_PARAMS((ROT *rot,
676  hamlib_token_t token,
677  char *val));
678 
679 extern HAMLIB_EXPORT(int)
680 rot_get_conf2 HAMLIB_PARAMS((ROT *rot,
681  hamlib_token_t token,
682  char *val,
683  int val_len));
684 
685 /*
686  * General API commands, from most primitive to least.. )
687  * List Set/Get functions pairs
688  */
689 extern HAMLIB_EXPORT(int)
690 rot_set_position HAMLIB_PARAMS((ROT *rot,
691  azimuth_t azimuth,
692  elevation_t elevation));
693 extern HAMLIB_EXPORT(int)
694 rot_get_position HAMLIB_PARAMS((ROT *rot,
695  azimuth_t *azimuth,
696  elevation_t *elevation));
697 
698 extern HAMLIB_EXPORT(int)
699 rot_stop HAMLIB_PARAMS((ROT *rot));
700 
701 extern HAMLIB_EXPORT(int)
702 rot_park HAMLIB_PARAMS((ROT *rot));
703 
704 extern HAMLIB_EXPORT(int)
705 rot_reset HAMLIB_PARAMS((ROT *rot,
706  rot_reset_t reset));
707 
708 extern HAMLIB_EXPORT(int)
709 rot_move HAMLIB_PARAMS((ROT *rot,
710  int direction,
711  int speed));
712 
713 extern HAMLIB_EXPORT(setting_t)
714 rot_has_get_level HAMLIB_PARAMS((ROT *rot,
715  setting_t level));
716 extern HAMLIB_EXPORT(setting_t)
717 rot_has_set_level HAMLIB_PARAMS((ROT *rot,
718  setting_t level));
719 
720 extern HAMLIB_EXPORT(setting_t)
721 rot_has_get_parm HAMLIB_PARAMS((ROT *rot,
722  setting_t parm));
723 extern HAMLIB_EXPORT(setting_t)
724 rot_has_set_parm HAMLIB_PARAMS((ROT *rot,
725  setting_t parm));
726 
727 extern HAMLIB_EXPORT(setting_t)
728 rot_has_get_func HAMLIB_PARAMS((ROT *rot,
729  setting_t func));
730 extern HAMLIB_EXPORT(setting_t)
731 rot_has_set_func HAMLIB_PARAMS((ROT *rot,
732  setting_t func));
733 
734 extern HAMLIB_EXPORT(int)
735 rot_set_func HAMLIB_PARAMS((ROT *rot,
736  setting_t func,
737  int status));
738 extern HAMLIB_EXPORT(int)
739 rot_get_func HAMLIB_PARAMS((ROT *rot,
740  setting_t func,
741  int *status));
742 
743 extern HAMLIB_EXPORT(int)
744 rot_set_level HAMLIB_PARAMS((ROT *rig,
745  setting_t level,
746  value_t val));
747 extern HAMLIB_EXPORT(int)
748 rot_get_level HAMLIB_PARAMS((ROT *rig,
749  setting_t level,
750  value_t *val));
751 
752 extern HAMLIB_EXPORT(int)
753 rot_set_parm HAMLIB_PARAMS((ROT *rig,
754  setting_t parm,
755  value_t val));
756 extern HAMLIB_EXPORT(int)
757 rot_get_parm HAMLIB_PARAMS((ROT *rig,
758  setting_t parm,
759  value_t *val));
760 
761 extern HAMLIB_EXPORT(int)
762 rot_set_ext_level HAMLIB_PARAMS((ROT *rig,
763  hamlib_token_t token,
764  value_t val));
765 extern HAMLIB_EXPORT(int)
766 rot_get_ext_level HAMLIB_PARAMS((ROT *rig,
767  hamlib_token_t token,
768  value_t *val));
769 
770 extern HAMLIB_EXPORT(int)
771 rot_set_ext_func HAMLIB_PARAMS((ROT *rig,
772  hamlib_token_t token,
773  int status));
774 extern HAMLIB_EXPORT(int)
775 rot_get_ext_func HAMLIB_PARAMS((ROT *rig,
776  hamlib_token_t token,
777  int *status));
778 
779 extern HAMLIB_EXPORT(int)
780 rot_set_ext_parm HAMLIB_PARAMS((ROT *rig,
781  hamlib_token_t token,
782  value_t val));
783 extern HAMLIB_EXPORT(int)
784 rot_get_ext_parm HAMLIB_PARAMS((ROT *rig,
785  hamlib_token_t token,
786  value_t *val));
787 
788 extern HAMLIB_EXPORT(const char *)
789 rot_get_info HAMLIB_PARAMS((ROT *rot));
790 
791 extern HAMLIB_EXPORT(int)
792 rot_get_status HAMLIB_PARAMS((ROT *rot,
793  rot_status_t *status));
794 
795 extern HAMLIB_EXPORT(int)
796 rot_register HAMLIB_PARAMS((const struct rot_caps *caps));
797 
798 extern HAMLIB_EXPORT(int)
799 rot_unregister HAMLIB_PARAMS((rot_model_t rot_model));
800 
801 extern HAMLIB_EXPORT(int)
802 rot_list_foreach HAMLIB_PARAMS((int (*cfunc)(const struct rot_caps *,
803  rig_ptr_t),
804  rig_ptr_t data));
805 
806 extern HAMLIB_EXPORT(int)
807 rot_load_backend HAMLIB_PARAMS((const char *be_name));
808 
809 extern HAMLIB_EXPORT(int)
810 rot_check_backend HAMLIB_PARAMS((rot_model_t rot_model));
811 
812 extern HAMLIB_EXPORT(int)
813 rot_load_all_backends HAMLIB_PARAMS((void));
814 
815 extern HAMLIB_EXPORT(rot_model_t)
816 rot_probe_all HAMLIB_PARAMS((hamlib_port_t *p));
817 
818 extern HAMLIB_EXPORT(int)
819 rot_token_foreach HAMLIB_PARAMS((ROT *rot,
820  int (*cfunc)(const struct confparams *,
821  rig_ptr_t),
822  rig_ptr_t data));
823 
824 extern HAMLIB_EXPORT(const struct confparams *)
825 rot_confparam_lookup HAMLIB_PARAMS((ROT *rot,
826  const char *name));
827 
828 extern HAMLIB_EXPORT(hamlib_token_t)
829 rot_token_lookup HAMLIB_PARAMS((ROT *rot,
830  const char *name));
831 
832 extern HAMLIB_EXPORT(int)
833 rot_ext_func_foreach HAMLIB_PARAMS((ROT *rot,
834  int (*cfunc)(ROT *,
835  const struct confparams *,
836  rig_ptr_t),
837  rig_ptr_t data));
838 extern HAMLIB_EXPORT(int)
839 rot_ext_level_foreach HAMLIB_PARAMS((ROT *rot,
840  int (*cfunc)(ROT *,
841  const struct confparams *,
842  rig_ptr_t),
843  rig_ptr_t data));
844 extern HAMLIB_EXPORT(int)
845 rot_ext_parm_foreach HAMLIB_PARAMS((ROT *rot,
846  int (*cfunc)(ROT *,
847  const struct confparams *,
848  rig_ptr_t),
849  rig_ptr_t data));
850 
851 extern HAMLIB_EXPORT(const struct confparams *)
852 rot_ext_lookup HAMLIB_PARAMS((ROT *rot,
853  const char *name));
854 
855 extern HAMLIB_EXPORT(const struct confparams *)
856 rot_ext_lookup_tok HAMLIB_PARAMS((ROT *rot,
857  hamlib_token_t token));
858 extern HAMLIB_EXPORT(hamlib_token_t)
859 rot_ext_token_lookup HAMLIB_PARAMS((ROT *rot,
860  const char *name));
861 
862 extern HAMLIB_EXPORT(const struct rot_caps *)
863 rot_get_caps HAMLIB_PARAMS((rot_model_t rot_model));
864 
865 extern HAMLIB_EXPORT(int)
866 qrb HAMLIB_PARAMS((double lon1,
867  double lat1,
868  double lon2,
869  double lat2,
870  double *distance,
871  double *azimuth));
872 
873 extern HAMLIB_EXPORT(double)
874 distance_long_path HAMLIB_PARAMS((double distance));
875 
876 extern HAMLIB_EXPORT(double)
877 azimuth_long_path HAMLIB_PARAMS((double azimuth));
878 
879 #if 0
880 extern HAMLIB_EXPORT(int)
881 longlat2locator HAMLIB_PARAMS((double longitude,
882  double latitude,
883  char *locator_res,
884  int pair_count));
885 
886 extern HAMLIB_EXPORT(int)
887 locator2longlat HAMLIB_PARAMS((double *longitude,
888  double *latitude,
889  const char *locator));
890 #endif
891 
892 extern HAMLIB_EXPORT(double)
893 dms2dec HAMLIB_PARAMS((int degrees,
894  int minutes,
895  double seconds,
896  int sw));
897 
898 extern HAMLIB_EXPORT(int)
899 dec2dms HAMLIB_PARAMS((double dec,
900  int *degrees,
901  int *minutes,
902  double *seconds,
903  int *sw));
904 
905 extern HAMLIB_EXPORT(int)
906 dec2dmmm HAMLIB_PARAMS((double dec,
907  int *degrees,
908  double *minutes,
909  int *sw));
910 
911 extern HAMLIB_EXPORT(double)
912 dmmm2dec HAMLIB_PARAMS((int degrees,
913  double minutes,
914  double seconds,
915  int sw));
916 
917 extern HAMLIB_EXPORT(setting_t) rot_parse_func(const char *s);
918 extern HAMLIB_EXPORT(setting_t) rot_parse_level(const char *s);
919 extern HAMLIB_EXPORT(setting_t) rot_parse_parm(const char *s);
920 extern HAMLIB_EXPORT(const char *) rot_strfunc(setting_t);
921 extern HAMLIB_EXPORT(const char *) rot_strlevel(setting_t);
922 extern HAMLIB_EXPORT(const char *) rot_strparm(setting_t);
923 extern HAMLIB_EXPORT(const char *) rot_strstatus(rot_status_t);
924 
925 extern HAMLIB_EXPORT(void *) rot_data_pointer(ROT *rot, rig_ptrx_t idx);
926 
928 
936 #define rot_debug rig_debug
937 
938 __END_DECLS
939 
940 #endif /* _ROTATOR_H */
941 
setting_t has_get_func
Definition: rotator.h:608
setting_t has_set_func
Definition: rotator.h:498
azimuth_t max_az
Definition: rotator.h:519
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:902
Definition: rotator.h:357
setting_t has_set_level
Definition: rotator.h:500
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:565
rot_parm_e
Rotator Parameters.
Definition: rotator.h:416
int(* get_status)(ROT *rot, rot_status_t *status)
Definition: rotator.h:576
int timeout
Definition: rotator.h:494
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:499
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:535
setting_t rot_parse_level(const char *s)
Convert alpha string to enum ROT_LEVEL_...
Definition: misc.c:1123
int retry
Definition: rotator.h:495
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:526
const char * version
Definition: rotator.h:478
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:649
int(* get_position)(ROT *rot, azimuth_t *azimuth, elevation_t *elevation)
Definition: rotator.h:548
int(* get_ext_func)(ROT *rot, hamlib_token_t token, int *status)
Definition: rotator.h:571
int(* set_ext_func)(ROT *rot, hamlib_token_t token, int status)
Definition: rotator.h:570
gran_t parm_gran[64]
Definition: rotator.h:618
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:601
int(* get_conf2)(ROT *rot, hamlib_token_t token, char *val, int val_len)
Definition: rotator.h:579
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:523
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:568
Rotator capability data structure.
Definition: rotator.h:474
const char * mfg_name
Definition: rotator.h:477
hamlib_port_t_deprecated rotport_deprecated
Definition: rotator.h:623
azimuth_t min_az
Definition: rotator.h:600
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:553
setting_t has_get_parm
Definition: rotator.h:501
Universal approach for passing values.
Definition: rig.h:1026
Definition: rotator.h:359
setting_t has_set_level
Definition: rotator.h:611
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:475
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:604
int serial_rate_min
Definition: rotator.h:485
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:539
hamlib_port_t rotport2
Definition: rotator.h:632
rot_status_t has_status
Definition: rotator.h:504
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:574
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:559
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:606
const char * model_name
Definition: rotator.h:476
const char * macro_name
Definition: rotator.h:578
Definition: rotator.h:385
rot_status_t has_status
Definition: rotator.h:615
setting_t has_get_parm
Definition: rotator.h:612
int(* park)(ROT *rot)
Definition: rotator.h:551
int(* set_ext_level)(ROT *rot, hamlib_token_t token, value_t val)
Definition: rotator.h:567
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:564
int post_write_delay
Definition: rotator.h:493
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:628
int(* get_func)(ROT *rot, setting_t func, int *status)
Definition: rotator.h:562
#define RIG_SETTING_MAX
Maximum # of rig settings.
Definition: rig.h:1208
int(* set_func)(ROT *rot, setting_t func, int status)
Definition: rotator.h:561
gran_t parm_gran[64]
Definition: rotator.h:507
elevation_t max_el
Definition: rotator.h:603
Definition: rotator.h:344
rot_level_e
Rotator Level Settings.
Definition: rotator.h:384
int comm_state
Definition: rotator.h:626
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:602
int write_delay
Definition: rotator.h:492
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:558
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:387
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:509
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:488
Definition: rotator.h:355
elevation_t min_el
Definition: rotator.h:521
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:613
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:536
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:486
struct rot_caps * caps
Definition: rotator.h:650
int serial_data_bits
Definition: rotator.h:487
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:510
float azimuth_t
Type definition for azimuth.
Definition: rotator.h:87
gran_t level_gran[64]
Definition: rotator.h:506
long hamlib_token_t
configuration token
Definition: rig.h:861
enum rig_port_e port_type
Definition: rotator.h:483
const rig_ptr_t priv
Definition: rotator.h:527
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:1730
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:617
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:596
int rot_stop(ROT *rot)
Stop the rotator.
Definition: rotator.c:925
azimuth_t az_offset
Definition: rotator.h:605
setting_t has_get_level
Definition: rotator.h:610
int rot_type
Definition: rotator.h:482
setting_t has_get_func
Definition: rotator.h:497
int(* get_conf)(ROT *rot, hamlib_token_t token, char *val)
Definition: rotator.h:540
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:417
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:609
int(* set_ext_parm)(ROT *rot, hamlib_token_t token, value_t val)
Definition: rotator.h:573
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
Definition: rig.h:1878
uint64_t setting_t
Setting.
Definition: rig.h:1202
struct rot_state state
Definition: rotator.h:651
rig_ptr_t priv
Definition: rotator.h:627
int current_speed
Definition: rotator.h:630
int(* reset)(ROT *rot, rot_reset_t reset)
Definition: rotator.h:552
hamlib_port_t_deprecated rotport2_deprecated
Definition: rotator.h:624
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:547
setting_t has_set_parm
Definition: rotator.h:502
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:518
int rot_cleanup(ROT *rot)
Release a ROT handle and free associated memory.
Definition: rotator.c:699
const char * copyright
Definition: rotator.h:479
ROT * rot_init(rot_model_t rot_model)
Allocate a new ROT handle.
Definition: rotator.c:218
Configuration parameter structure.
Definition: rig.h:901
enum serial_parity_e serial_parity
Definition: rotator.h:489
int(* stop)(ROT *rot)
Definition: rotator.h:550
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:512
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:537
rig_port_e
Port type.
Definition: rig.h:312
hamlib_port_t rotport
Definition: rotator.h:631
enum serial_handshake_e serial_handshake
Definition: rotator.h:490
const struct confparams * extfuncs
Definition: rotator.h:511
enum rig_status_e status
Definition: rotator.h:480
int(* rot_init)(ROT *rot)
Definition: rotator.h:534
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:386