Hamlib  4.5.3
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 
22 #ifndef _ROTATOR_H
23 #define _ROTATOR_H 1
24 
25 #include <hamlib/rig.h>
26 #include <hamlib/rotlist.h>
27 
45 __BEGIN_DECLS
46 
47 /* Forward struct references */
48 
49 struct rot;
50 struct rot_state;
51 
52 
62 typedef struct s_rot ROT;
63 
64 
74 typedef float elevation_t;
75 
76 
86 typedef float azimuth_t;
87 
88 
92 #define NETROTCTL_RET "RPRT "
93 
94 
101 #define ROT_RESET_ALL 1
102 
103 
111 typedef int rot_reset_t;
112 
113 
117 typedef enum {
118  ROT_FLAG_AZIMUTH = (1 << 1),
119  ROT_FLAG_ELEVATION = (1 << 2)
120 } rot_type_t;
121 
123 /* So far only used in ests/dumpcaps_rot.c. */
124 #define ROT_TYPE_MASK (ROT_FLAG_AZIMUTH|ROT_FLAG_ELEVATION)
125 
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)
141 
142 
153 #define ROT_MOVE_UP (1<<1)
154 
165 #define ROT_MOVE_DOWN (1<<2)
166 
177 #define ROT_MOVE_LEFT (1<<3)
178 
190 #define ROT_MOVE_CCW ROT_MOVE_LEFT
191 
202 #define ROT_MOVE_RIGHT (1<<4)
203 
215 #define ROT_MOVE_CW ROT_MOVE_RIGHT
216 
217 
221 typedef enum {
223  ROT_STATUS_BUSY = (1 << 0),
224  ROT_STATUS_MOVING = (1 << 1),
225  ROT_STATUS_MOVING_AZ = (1 << 2),
228  ROT_STATUS_MOVING_EL = (1 << 5),
229  ROT_STATUS_MOVING_UP = (1 << 6),
231  ROT_STATUS_LIMIT_UP = (1 << 8),
233  ROT_STATUS_LIMIT_LEFT = (1 << 10),
235  ROT_STATUS_OVERLAP_UP = (1 << 12),
239 } rot_status_t;
240 
242 /* So far only used in tests/sprintflst.c. */
243 #define ROT_STATUS_N(n) (1u<<(n))
244 
249 #define ROT_SPEED_NOCHANGE (-1)
250 
251 
263  ROT_LEVEL_SPEED = (1 << 0),
264  ROT_LEVEL_63 = CONSTANT_64BIT_FLAG(63),
265 };
266 
267 
269 #define ROT_LEVEL_FLOAT_LIST (0)
270 
271 #define ROT_LEVEL_READONLY_LIST (0)
272 
273 #define ROT_LEVEL_IS_FLOAT(l) ((l)&ROT_LEVEL_FLOAT_LIST)
274 #define ROT_LEVEL_SET(l) ((l)&~ROT_LEVEL_READONLY_LIST)
275 
277 
295 };
296 
297 
299 #define ROT_PARM_FLOAT_LIST (0)
300 #define ROT_PARM_READONLY_LIST (0)
301 
302 #define ROT_PARM_IS_FLOAT(l) ((l)&ROT_PARM_FLOAT_LIST)
303 #define ROT_PARM_SET(l) ((l)&~ROT_PARM_READONLY_LIST)
304 
306 
321 #define ROT_FUNC_NONE 0
322 #ifndef SWIGLUAHIDE
323 /* Hide the top 32 bits from the old Lua binding as they can't be represented */
324 #define ROT_FUNC_BIT63 CONSTANT_64BIT_FLAG (63)
325 /* 63 is this highest bit number that can be used */
326 #endif
327 
328 
329 /* Basic rot type, can store some useful info about different rotators. Each
330  * lib must be able to populate this structure, so we can make useful
331  * enquiries about capabilities.
332  */
333 
351 struct rot_caps {
353  const char *model_name;
354  const char *mfg_name;
355  const char *version;
356  const char *copyright;
359  int rot_type;
371  int timeout;
372  int retry;
386  const struct confparams *extparms;
387  const struct confparams *extlevels;
388  const struct confparams *extfuncs;
389  int *ext_tokens;
391  /*
392  * Movement range, az is relative to North
393  * negative values allowed for overlap
394  */
403  const struct confparams *cfgparams;
404  const rig_ptr_t priv;
406  /*
407  * Rot Admin API
408  *
409  */
410 
411  int (*rot_init)(ROT *rot);
412  int (*rot_cleanup)(ROT *rot);
413  int (*rot_open)(ROT *rot);
414  int (*rot_close)(ROT *rot);
416  int (*set_conf)(ROT *rot, token_t token, const char *val);
417  int (*get_conf)(ROT *rot, token_t token, char *val);
419  /*
420  * General API commands, from most primitive to least.. :()
421  * List Set/Get functions pairs
422  */
423 
424  int (*set_position)(ROT *rot, azimuth_t azimuth, elevation_t elevation);
425  int (*get_position)(ROT *rot, azimuth_t *azimuth, elevation_t *elevation);
427  int (*stop)(ROT *rot);
428  int (*park)(ROT *rot);
429  int (*reset)(ROT *rot, rot_reset_t reset);
430  int (*move)(ROT *rot, int direction, int speed);
432  /* get firmware info, etc. */
433  const char * (*get_info)(ROT *rot);
435  int (*set_level)(ROT *rot, setting_t level, value_t val);
436  int (*get_level)(ROT *rot, setting_t level, value_t *val);
438  int (*set_func)(ROT *rot, setting_t func, int status);
439  int (*get_func)(ROT *rot, setting_t func, int *status);
441  int (*set_parm)(ROT *rot, setting_t parm, value_t val);
442  int (*get_parm)(ROT *rot, setting_t parm, value_t *val);
444  int (*set_ext_level)(ROT *rot, token_t token, value_t val);
445  int (*get_ext_level)(ROT *rot, token_t token, value_t *val);
447  int (*set_ext_func)(ROT *rot, token_t token, int status);
448  int (*get_ext_func)(ROT *rot, token_t token, int *status);
450  int (*set_ext_parm)(ROT *rot, token_t token, value_t val);
451  int (*get_ext_parm)(ROT *rot, token_t token, value_t *val);
455  const char *macro_name;
456  int (*get_conf2)(ROT *rot, token_t token, char *val, int val_len);
457 };
459 #define ROT_MODEL(arg) .rot_model=arg,.macro_name=#arg
460 
462 
473 struct rot_state {
474  /*
475  * overridable fields
476  */
497  /*
498  * non overridable fields, internal use
499  */
500  hamlib_port_t_deprecated rotport_deprecated;
501  hamlib_port_t_deprecated rotport2_deprecated;
504  rig_ptr_t priv;
505  rig_ptr_t obj;
508  hamlib_port_t rotport;
509  hamlib_port_t rotport2;
510 };
511 
512 
524 struct s_rot {
525  struct rot_caps *caps;
526  struct rot_state state;
527 };
528 
529 
531 /* --------------- API function prototypes -----------------*/
532 
533 extern HAMLIB_EXPORT(ROT *)
534 rot_init HAMLIB_PARAMS((rot_model_t rot_model));
535 
536 extern HAMLIB_EXPORT(int)
537 rot_open HAMLIB_PARAMS((ROT *rot));
538 
539 extern HAMLIB_EXPORT(int)
540 rot_close HAMLIB_PARAMS((ROT *rot));
541 
542 extern HAMLIB_EXPORT(int)
543 rot_cleanup HAMLIB_PARAMS((ROT *rot));
544 
545 extern HAMLIB_EXPORT(int)
546 rot_set_conf HAMLIB_PARAMS((ROT *rot,
547  token_t token,
548  const char *val));
549 extern HAMLIB_EXPORT(int)
550 rot_get_conf HAMLIB_PARAMS((ROT *rot,
551  token_t token,
552  char *val));
553 
554 extern HAMLIB_EXPORT(int)
555 rot_get_conf2 HAMLIB_PARAMS((ROT *rot,
556  token_t token,
557  char *val,
558  int val_len));
559 
560 /*
561  * General API commands, from most primitive to least.. )
562  * List Set/Get functions pairs
563  */
564 extern HAMLIB_EXPORT(int)
565 rot_set_position HAMLIB_PARAMS((ROT *rot,
566  azimuth_t azimuth,
567  elevation_t elevation));
568 extern HAMLIB_EXPORT(int)
569 rot_get_position HAMLIB_PARAMS((ROT *rot,
570  azimuth_t *azimuth,
571  elevation_t *elevation));
572 
573 extern HAMLIB_EXPORT(int)
574 rot_stop HAMLIB_PARAMS((ROT *rot));
575 
576 extern HAMLIB_EXPORT(int)
577 rot_park HAMLIB_PARAMS((ROT *rot));
578 
579 extern HAMLIB_EXPORT(int)
580 rot_reset HAMLIB_PARAMS((ROT *rot,
581  rot_reset_t reset));
582 
583 extern HAMLIB_EXPORT(int)
584 rot_move HAMLIB_PARAMS((ROT *rot,
585  int direction,
586  int speed));
587 
588 extern HAMLIB_EXPORT(setting_t)
589 rot_has_get_level HAMLIB_PARAMS((ROT *rot,
590  setting_t level));
591 extern HAMLIB_EXPORT(setting_t)
592 rot_has_set_level HAMLIB_PARAMS((ROT *rot,
593  setting_t level));
594 
595 extern HAMLIB_EXPORT(setting_t)
596 rot_has_get_parm HAMLIB_PARAMS((ROT *rot,
597  setting_t parm));
598 extern HAMLIB_EXPORT(setting_t)
599 rot_has_set_parm HAMLIB_PARAMS((ROT *rot,
600  setting_t parm));
601 
602 extern HAMLIB_EXPORT(setting_t)
603 rot_has_get_func HAMLIB_PARAMS((ROT *rot,
604  setting_t func));
605 extern HAMLIB_EXPORT(setting_t)
606 rot_has_set_func HAMLIB_PARAMS((ROT *rot,
607  setting_t func));
608 
609 extern HAMLIB_EXPORT(int)
610 rot_set_func HAMLIB_PARAMS((ROT *rot,
611  setting_t func,
612  int status));
613 extern HAMLIB_EXPORT(int)
614 rot_get_func HAMLIB_PARAMS((ROT *rot,
615  setting_t func,
616  int *status));
617 
618 extern HAMLIB_EXPORT(int)
619 rot_set_level HAMLIB_PARAMS((ROT *rig,
620  setting_t level,
621  value_t val));
622 extern HAMLIB_EXPORT(int)
623 rot_get_level HAMLIB_PARAMS((ROT *rig,
624  setting_t level,
625  value_t *val));
626 
627 extern HAMLIB_EXPORT(int)
628 rot_set_parm HAMLIB_PARAMS((ROT *rig,
629  setting_t parm,
630  value_t val));
631 extern HAMLIB_EXPORT(int)
632 rot_get_parm HAMLIB_PARAMS((ROT *rig,
633  setting_t parm,
634  value_t *val));
635 
636 extern HAMLIB_EXPORT(int)
637 rot_set_ext_level HAMLIB_PARAMS((ROT *rig,
638  token_t token,
639  value_t val));
640 extern HAMLIB_EXPORT(int)
641 rot_get_ext_level HAMLIB_PARAMS((ROT *rig,
642  token_t token,
643  value_t *val));
644 
645 extern HAMLIB_EXPORT(int)
646 rot_set_ext_func HAMLIB_PARAMS((ROT *rig,
647  token_t token,
648  int status));
649 extern HAMLIB_EXPORT(int)
650 rot_get_ext_func HAMLIB_PARAMS((ROT *rig,
651  token_t token,
652  int *status));
653 
654 extern HAMLIB_EXPORT(int)
655 rot_set_ext_parm HAMLIB_PARAMS((ROT *rig,
656  token_t token,
657  value_t val));
658 extern HAMLIB_EXPORT(int)
659 rot_get_ext_parm HAMLIB_PARAMS((ROT *rig,
660  token_t token,
661  value_t *val));
662 
663 extern HAMLIB_EXPORT(const char *)
664 rot_get_info HAMLIB_PARAMS((ROT *rot));
665 
666 extern HAMLIB_EXPORT(int)
667 rot_get_status HAMLIB_PARAMS((ROT *rot,
668  rot_status_t *status));
669 
670 extern HAMLIB_EXPORT(int)
671 rot_register HAMLIB_PARAMS((const struct rot_caps *caps));
672 
673 extern HAMLIB_EXPORT(int)
674 rot_unregister HAMLIB_PARAMS((rot_model_t rot_model));
675 
676 extern HAMLIB_EXPORT(int)
677 rot_list_foreach HAMLIB_PARAMS((int (*cfunc)(const struct rot_caps *,
678  rig_ptr_t),
679  rig_ptr_t data));
680 
681 extern HAMLIB_EXPORT(int)
682 rot_load_backend HAMLIB_PARAMS((const char *be_name));
683 
684 extern HAMLIB_EXPORT(int)
685 rot_check_backend HAMLIB_PARAMS((rot_model_t rot_model));
686 
687 extern HAMLIB_EXPORT(int)
688 rot_load_all_backends HAMLIB_PARAMS((void));
689 
690 extern HAMLIB_EXPORT(rot_model_t)
691 rot_probe_all HAMLIB_PARAMS((hamlib_port_t *p));
692 
693 extern HAMLIB_EXPORT(int)
694 rot_token_foreach HAMLIB_PARAMS((ROT *rot,
695  int (*cfunc)(const struct confparams *,
696  rig_ptr_t),
697  rig_ptr_t data));
698 
699 extern HAMLIB_EXPORT(const struct confparams *)
700 rot_confparam_lookup HAMLIB_PARAMS((ROT *rot,
701  const char *name));
702 
703 extern HAMLIB_EXPORT(token_t)
704 rot_token_lookup HAMLIB_PARAMS((ROT *rot,
705  const char *name));
706 
707 extern HAMLIB_EXPORT(int)
708 rot_ext_func_foreach HAMLIB_PARAMS((ROT *rot,
709  int (*cfunc)(ROT *,
710  const struct confparams *,
711  rig_ptr_t),
712  rig_ptr_t data));
713 extern HAMLIB_EXPORT(int)
714 rot_ext_level_foreach HAMLIB_PARAMS((ROT *rot,
715  int (*cfunc)(ROT *,
716  const struct confparams *,
717  rig_ptr_t),
718  rig_ptr_t data));
719 extern HAMLIB_EXPORT(int)
720 rot_ext_parm_foreach HAMLIB_PARAMS((ROT *rot,
721  int (*cfunc)(ROT *,
722  const struct confparams *,
723  rig_ptr_t),
724  rig_ptr_t data));
725 
726 extern HAMLIB_EXPORT(const struct confparams *)
727 rot_ext_lookup HAMLIB_PARAMS((ROT *rot,
728  const char *name));
729 
730 extern HAMLIB_EXPORT(const struct confparams *)
731 rot_ext_lookup_tok HAMLIB_PARAMS((ROT *rot,
732  token_t token));
733 extern HAMLIB_EXPORT(token_t)
734 rot_ext_token_lookup HAMLIB_PARAMS((ROT *rot,
735  const char *name));
736 
737 extern HAMLIB_EXPORT(const struct rot_caps *)
738 rot_get_caps HAMLIB_PARAMS((rot_model_t rot_model));
739 
740 extern HAMLIB_EXPORT(int)
741 qrb HAMLIB_PARAMS((double lon1,
742  double lat1,
743  double lon2,
744  double lat2,
745  double *distance,
746  double *azimuth));
747 
748 extern HAMLIB_EXPORT(double)
749 distance_long_path HAMLIB_PARAMS((double distance));
750 
751 extern HAMLIB_EXPORT(double)
752 azimuth_long_path HAMLIB_PARAMS((double azimuth));
753 
754 #if 0
755 extern HAMLIB_EXPORT(int)
756 longlat2locator HAMLIB_PARAMS((double longitude,
757  double latitude,
758  char *locator_res,
759  int pair_count));
760 
761 extern HAMLIB_EXPORT(int)
762 locator2longlat HAMLIB_PARAMS((double *longitude,
763  double *latitude,
764  const char *locator));
765 #endif
766 
767 extern HAMLIB_EXPORT(double)
768 dms2dec HAMLIB_PARAMS((int degrees,
769  int minutes,
770  double seconds,
771  int sw));
772 
773 extern HAMLIB_EXPORT(int)
774 dec2dms HAMLIB_PARAMS((double dec,
775  int *degrees,
776  int *minutes,
777  double *seconds,
778  int *sw));
779 
780 extern HAMLIB_EXPORT(int)
781 dec2dmmm HAMLIB_PARAMS((double dec,
782  int *degrees,
783  double *minutes,
784  int *sw));
785 
786 extern HAMLIB_EXPORT(double)
787 dmmm2dec HAMLIB_PARAMS((int degrees,
788  double minutes,
789  double seconds,
790  int sw));
791 
792 extern HAMLIB_EXPORT(setting_t) rot_parse_func(const char *s);
793 extern HAMLIB_EXPORT(setting_t) rot_parse_level(const char *s);
794 extern HAMLIB_EXPORT(setting_t) rot_parse_parm(const char *s);
795 extern HAMLIB_EXPORT(const char *) rot_strfunc(setting_t);
796 extern HAMLIB_EXPORT(const char *) rot_strlevel(setting_t);
797 extern HAMLIB_EXPORT(const char *) rot_strparm(setting_t);
798 extern HAMLIB_EXPORT(const char *) rot_strstatus(rot_status_t);
799 
801 
809 #define rot_debug rig_debug
810 
811 __END_DECLS
812 
813 #endif /* _ROTATOR_H */
814 
setting_t has_get_func
Definition: rotator.h:485
setting_t has_set_func
Definition: rotator.h:375
azimuth_t max_az
Definition: rotator.h:396
const struct confparams * rot_confparam_lookup(ROT *rot, const char *name)
Query a rotator configuration parameter token by its name.
Definition: rot_conf.c:617
Definition: rotator.h:236
setting_t has_set_level
Definition: rotator.h:377
int(* get_parm)(ROT *rot, setting_t parm, value_t *val)
Definition: rotator.h:442
rot_parm_e
Rotator Parameters.
Definition: rotator.h:293
int(* get_status)(ROT *rot, rot_status_t *status)
Definition: rotator.h:453
int timeout
Definition: rotator.h:371
int rot_get_func(ROT *rot, setting_t func, int *status)
Query the status of functions of the rotator.
Definition: rot_settings.c:516
Definition: rotator.h:226
Definition: rotator.h:227
setting_t has_get_level
Definition: rotator.h:376
setting_t rot_parse_parm(const char *s)
Convert alpha string to ROT_PARM_...
Definition: misc.c:1195
long token_t
configuration token
Definition: rig.h:766
Definition: rotator.h:235
int rot_reset_t
Type definition for rotator reset.
Definition: rotator.h:111
int(* rot_cleanup)(ROT *rot)
Definition: rotator.h:412
setting_t rot_parse_level(const char *s)
Convert alpha string to enum ROT_LEVEL_...
Definition: misc.c:996
int retry
Definition: rotator.h:372
const struct confparams * cfgparams
Definition: rotator.h:403
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:729
const char * version
Definition: rotator.h:355
int rot_set_position(ROT *rot, azimuth_t azimuth, elevation_t elevation)
Set the azimuth and elevation of the rotator.
Definition: rotator.c:657
Master rotator structure.
Definition: rotator.h:524
int(* get_position)(ROT *rot, azimuth_t *azimuth, elevation_t *elevation)
Definition: rotator.h:425
int rot_set_ext_func(ROT *rot, token_t token, int status)
Activate or deactivate extension functions of a rotator.
Definition: rot_settings.c:643
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
int(* get_conf2)(ROT *rot, token_t token, char *val, int val_len)
Definition: rotator.h:456
gran_t parm_gran[64]
Definition: rotator.h:495
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:229
setting_t rot_has_get_func(ROT *rot, setting_t func)
Check which rotator functions can be queried.
Definition: rot_settings.c:399
azimuth_t max_az
Definition: rotator.h:478
int(* get_conf)(ROT *rot, token_t token, char *val)
Definition: rotator.h:417
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:599
Definition: rotator.h:230
setting_t rot_has_set_level(ROT *rot, setting_t level)
Query the rotator levels that may be set.
Definition: rot_settings.c:288
Definition: rotator.h:119
elevation_t max_el
Definition: rotator.h:400
Definition: rotator.h:232
int rot_set_conf(ROT *rot, token_t token, const char *val)
Set a rotator configuration parameter.
Definition: rot_conf.c:717
setting_t rot_has_set_parm(ROT *rot, setting_t parm)
Query the rotator parameters that may be set.
Definition: rot_settings.c:363
Definition: rotator.h:224
serial_handshake_e
Serial handshake.
Definition: rig.h:297
Rotator capability data structure.
Definition: rotator.h:351
const char * mfg_name
Definition: rotator.h:354
hamlib_port_t_deprecated rotport_deprecated
Definition: rotator.h:500
azimuth_t min_az
Definition: rotator.h:477
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:430
setting_t has_get_parm
Definition: rotator.h:378
Universal approach for passing values.
Definition: rig.h:930
Definition: rotator.h:238
setting_t has_set_level
Definition: rotator.h:488
const char * rot_strfunc(setting_t func)
Convert enum ROT_FUNC_... to alpha string.
Definition: misc.c:851
Definition: rotator.h:222
int rot_move(ROT *rot, int direction, int speed)
Move the rotator in the specified direction and speed.
Definition: rotator.c:904
rot_model_t rot_model
Definition: rotator.h:352
setting_t rot_has_set_func(ROT *rot, setting_t func)
Query support of rotator functions.
Definition: rot_settings.c:436
rot_status_t
Rotator status flags.
Definition: rotator.h:221
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 south_zero
Definition: rotator.h:481
int serial_rate_min
Definition: rotator.h:362
Hamlib rotator model definitions.
rig_status_e
Development status of the backend.
Definition: rig.h:368
int rot_model_t
Convenience type definition for a rotator model.
Definition: rotlist.h:659
int(* get_ext_parm)(ROT *rot, token_t token, value_t *val)
Definition: rotator.h:451
hamlib_port_t rotport2
Definition: rotator.h:509
rot_status_t has_status
Definition: rotator.h:381
Definition: rotator.h:225
int(* get_level)(ROT *rot, setting_t level, value_t *val)
Definition: rotator.h:436
int rot_get_level(ROT *rot, setting_t level, value_t *val)
Query the value of a requested rotator level.
Definition: rot_settings.c:123
elevation_t el_offset
Definition: rotator.h:483
const char * model_name
Definition: rotator.h:353
const char * macro_name
Definition: rotator.h:455
Definition: rotator.h:262
rot_status_t has_status
Definition: rotator.h:492
setting_t has_get_parm
Definition: rotator.h:489
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:682
int(* park)(ROT *rot)
Definition: rotator.h:428
float elevation_t
Type definition for elevation.
Definition: rotator.h:74
int(* set_parm)(ROT *rot, setting_t parm, value_t val)
Definition: rotator.h:441
int post_write_delay
Definition: rotator.h:370
int rot_close(ROT *rot)
Close the communication channel to the rotator.
Definition: rotator.c:515
int rot_get_conf(ROT *rot, token_t token, char *val)
Query the value of a rotator configuration parameter.
Definition: rot_conf.c:776
rig_ptr_t obj
Definition: rotator.h:505
int(* get_func)(ROT *rot, setting_t func, int *status)
Definition: rotator.h:439
#define RIG_SETTING_MAX
Maximum # of rig settings.
Definition: rig.h:1097
int(* set_func)(ROT *rot, setting_t func, int status)
Definition: rotator.h:438
gran_t parm_gran[64]
Definition: rotator.h:384
elevation_t max_el
Definition: rotator.h:480
Definition: rotator.h:223
rot_level_e
Rotator Level Settings.
Definition: rotator.h:261
int comm_state
Definition: rotator.h:503
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:687
Definition: rotator.h:237
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
token_t token
Definition: rig.h:806
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:479
int write_delay
Definition: rotator.h:369
rot_type_t
Rotator type flags for bitmasks.
Definition: rotator.h:117
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:789
const char * rot_strparm(setting_t parm)
Convert enum ROT_PARM_... to alpha string.
Definition: misc.c:1250
int(* set_level)(ROT *rot, setting_t level, value_t val)
Definition: rotator.h:435
serial_parity_e
Serial parity.
Definition: rig.h:285
setting_t rot_has_get_parm(ROT *rot, setting_t parm)
Check which rotator parameter settings can be queried.
Definition: rot_settings.c:326
Definition: rotator.h:264
int longlat2locator(double longitude, double latitude, char *locator, int pair_count)
Convert longitude/latitude to QRA locator (Maidenhead grid square).
Definition: locator.c:545
const struct confparams * extparms
Definition: rotator.h:386
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:365
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:368
Definition: rotator.h:234
elevation_t min_el
Definition: rotator.h:398
int(* get_ext_level)(ROT *rot, token_t token, value_t *val)
Definition: rotator.h:445
setting_t rot_parse_func(const char *s)
Convert alpha string to enum ROT_FUNC_...
Definition: misc.c:795
Hamlib rig data structures.
setting_t has_set_parm
Definition: rotator.h:490
const char * rot_get_info(ROT *rot)
Get general information from the rotator.
Definition: rotator.c:939
Definition: rotator.h:233
int(* rot_open)(ROT *rot)
Definition: rotator.h:413
int(* set_ext_level)(ROT *rot, token_t token, value_t val)
Definition: rotator.h:444
int serial_rate_max
Definition: rotator.h:363
struct rot_caps * caps
Definition: rotator.h:525
int serial_data_bits
Definition: rotator.h:364
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:387
float azimuth_t
Type definition for azimuth.
Definition: rotator.h:86
gran_t level_gran[64]
Definition: rotator.h:383
enum rig_port_e port_type
Definition: rotator.h:360
const rig_ptr_t priv
Definition: rotator.h:404
int rot_get_status(ROT *rot, rot_status_t *status)
Query status flags of the rotator.
Definition: rotator.c:972
Definition: rotator.h:228
level/parm granularity definition
Definition: rig.h:1610
int(* set_conf)(ROT *rot, token_t token, const char *val)
Definition: rotator.h:416
Definition: rotator.h:231
int rot_get_position(ROT *rot, azimuth_t *azimuth, elevation_t *elevation)
Query the azimuth and elevation of the rotator.
Definition: rotator.c:729
gran_t level_gran[64]
Definition: rotator.h:494
int rot_get_parm(ROT *rot, setting_t parm, value_t *val)
Query the value of a requested rotator parameter.
Definition: rot_settings.c:208
Rotator state structure.
Definition: rotator.h:473
int(* get_ext_func)(ROT *rot, token_t token, int *status)
Definition: rotator.h:448
int rot_stop(ROT *rot)
Stop the rotator.
Definition: rotator.c:827
azimuth_t az_offset
Definition: rotator.h:482
setting_t has_get_level
Definition: rotator.h:487
int rot_type
Definition: rotator.h:359
setting_t has_get_func
Definition: rotator.h:374
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:864
Definition: rotator.h:294
int rot_set_func(ROT *rot, setting_t func, int status)
Activate or deactivate functions of a rotator.
Definition: rot_settings.c:472
setting_t has_set_func
Definition: rotator.h:486
const char * rot_strlevel(setting_t level)
Convert enum ROT_LEVEL_... to alpha string.
Definition: misc.c:1082
Definition: rotator.h:118
uint64_t setting_t
Setting.
Definition: rig.h:1091
struct rot_state state
Definition: rotator.h:526
int(* set_ext_func)(ROT *rot, token_t token, int status)
Definition: rotator.h:447
rig_ptr_t priv
Definition: rotator.h:504
int current_speed
Definition: rotator.h:507
int(* reset)(ROT *rot, rot_reset_t reset)
Definition: rotator.h:429
hamlib_port_t_deprecated rotport2_deprecated
Definition: rotator.h:501
setting_t rot_has_get_level(ROT *rot, setting_t level)
Check which rotator level settings can be queried.
Definition: rot_settings.c:250
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:767
int rot_set_parm(ROT *rot, setting_t parm, value_t val)
Set a rotator parameter to a given value.
Definition: rot_settings.c:168
int(* set_position)(ROT *rot, azimuth_t azimuth, elevation_t elevation)
Definition: rotator.h:424
setting_t has_set_parm
Definition: rotator.h:379
azimuth_t min_az
Definition: rotator.h:395
int rot_cleanup(ROT *rot)
Release a ROT handle and free associated memory.
Definition: rotator.c:603
const char * copyright
Definition: rotator.h:356
ROT * rot_init(rot_model_t rot_model)
Allocate a new ROT handle.
Definition: rotator.c:216
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:315
Configuration parameter structure.
Definition: rig.h:805
enum serial_parity_e serial_parity
Definition: rotator.h:366
int(* stop)(ROT *rot)
Definition: rotator.h:427
int rot_set_level(ROT *rot, setting_t level, value_t val)
Set a rotator level to a given value.
Definition: rot_settings.c:79
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:389
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:414
rig_port_e
Port type.
Definition: rig.h:264
hamlib_port_t rotport
Definition: rotator.h:508
enum serial_handshake_e serial_handshake
Definition: rotator.h:367
const struct confparams * extfuncs
Definition: rotator.h:388
enum rig_status_e status
Definition: rotator.h:357
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:553
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:559
int(* rot_init)(ROT *rot)
Definition: rotator.h:411
int rot_open(ROT *rot)
Open the communication channel to the rotator.
Definition: rotator.c:359
int(* set_ext_parm)(ROT *rot, token_t token, value_t val)
Definition: rotator.h:450
Definition: rotator.h:263