Hamlib  4.1
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 
43 __BEGIN_DECLS
44 
45 /* Forward struct references */
46 
47 struct rot;
48 struct rot_state;
49 
50 
55 typedef struct s_rot ROT;
56 
57 
67 typedef float elevation_t;
68 
69 
79 typedef float azimuth_t;
80 
81 
85 #define NETROTCTL_RET "RPRT "
86 
87 
93 #define ROT_RESET_ALL 1
94 
95 
103 typedef int rot_reset_t;
104 
105 
107 
110 typedef enum {
111  ROT_FLAG_AZIMUTH = (1 << 1),
112  ROT_FLAG_ELEVATION = (1 << 2)
113 } rot_type_t;
114 
115 #define ROT_TYPE_MASK (ROT_FLAG_AZIMUTH|ROT_FLAG_ELEVATION)
116 
117 #define ROT_TYPE_OTHER 0
118 #define ROT_TYPE_AZIMUTH ROT_FLAG_AZIMUTH
119 #define ROT_TYPE_ELEVATION ROT_FLAG_ELEVATION
120 #define ROT_TYPE_AZEL (ROT_FLAG_AZIMUTH|ROT_FLAG_ELEVATION)
122 
123 
134 #define ROT_MOVE_UP (1<<1)
135 
146 #define ROT_MOVE_DOWN (1<<2)
147 
158 #define ROT_MOVE_LEFT (1<<3)
159 
171 #define ROT_MOVE_CCW ROT_MOVE_LEFT
172 
183 #define ROT_MOVE_RIGHT (1<<4)
184 
196 #define ROT_MOVE_CW ROT_MOVE_RIGHT
197 
198 
202 typedef enum {
203  ROT_STATUS_NONE = 0,
204  ROT_STATUS_BUSY = (1 << 0),
205  ROT_STATUS_MOVING = (1 << 1),
206  ROT_STATUS_MOVING_AZ = (1 << 2),
209  ROT_STATUS_MOVING_EL = (1 << 5),
210  ROT_STATUS_MOVING_UP = (1 << 6),
212  ROT_STATUS_LIMIT_UP = (1 << 8),
214  ROT_STATUS_LIMIT_LEFT = (1 << 10),
216  ROT_STATUS_OVERLAP_UP = (1 << 12),
220 } rot_status_t;
221 
222 #define ROT_STATUS_N(n) (1u<<(n))
223 
224 
228 #define ROT_SPEED_NOCHANGE (-1)
229 
230 
241  ROT_LEVEL_SPEED = (1 << 0),
242  ROT_LEVEL_63 = CONSTANT_64BIT_FLAG(63),
243 };
244 
245 
247 #define ROT_LEVEL_FLOAT_LIST (0)
248 
249 #define ROT_LEVEL_READONLY_LIST (0)
250 
251 #define ROT_LEVEL_IS_FLOAT(l) ((l)&ROT_LEVEL_FLOAT_LIST)
252 #define ROT_LEVEL_SET(l) ((l)&~ROT_LEVEL_READONLY_LIST)
254 
255 
266 };
267 
268 
270 #define ROT_PARM_FLOAT_LIST (0)
271 #define ROT_PARM_READONLY_LIST (0)
272 
273 #define ROT_PARM_IS_FLOAT(l) ((l)&ROT_PARM_FLOAT_LIST)
274 #define ROT_PARM_SET(l) ((l)&~ROT_PARM_READONLY_LIST)
276 
277 
286 #define ROT_FUNC_NONE 0
287 #ifndef SWIGLUAHIDE
288 /* Hide the top 32 bits from the old Lua binding as they can't be represented */
289 #define ROT_FUNC_BIT63 CONSTANT_64BIT_FLAG (63)
290 /* 63 is this highest bit number that can be used */
291 #endif
292 
293 
294 /* Basic rot type, can store some useful info about different rotators. Each
295  * lib must be able to populate this structure, so we can make useful
296  * enquiries about capabilities.
297  */
298 
318 #define ROT_MODEL(arg) .rot_model=arg,.macro_name=#arg
319 struct rot_caps {
320  rot_model_t rot_model;
321  const char *model_name;
322  const char *mfg_name;
323  const char *version;
324  const char *copyright;
325  enum rig_status_e status;
327  int rot_type;
328  enum rig_port_e port_type;
330  int serial_rate_min;
331  int serial_rate_max;
332  int serial_data_bits;
333  int serial_stop_bits;
334  enum serial_parity_e serial_parity;
335  enum serial_handshake_e serial_handshake;
337  int write_delay;
338  int post_write_delay;
339  int timeout;
340  int retry;
342  setting_t has_get_func;
343  setting_t has_set_func;
344  setting_t has_get_level;
345  setting_t has_set_level;
346  setting_t has_get_parm;
347  setting_t has_set_parm;
349  rot_status_t has_status;
351  gran_t level_gran[RIG_SETTING_MAX];
352  gran_t parm_gran[RIG_SETTING_MAX];
354  const struct confparams *extparms;
355  const struct confparams *extlevels;
356  const struct confparams *extfuncs;
357  int *ext_tokens;
359  /*
360  * Movement range, az is relative to North
361  * negative values allowed for overlap
362  */
363  azimuth_t min_az;
364  azimuth_t max_az;
366  min_el;
368  max_el;
371  const struct confparams *cfgparams;
372  const rig_ptr_t priv;
374  /*
375  * Rot Admin API
376  *
377  */
378 
379  int (*rot_init)(ROT *rot);
380  int (*rot_cleanup)(ROT *rot);
381  int (*rot_open)(ROT *rot);
382  int (*rot_close)(ROT *rot);
383 
384  int (*set_conf)(ROT *rot, token_t token, const char *val);
385  int (*get_conf)(ROT *rot, token_t token, char *val);
386 
387  /*
388  * General API commands, from most primitive to least.. :()
389  * List Set/Get functions pairs
390  */
391 
392  int (*set_position)(ROT *rot, azimuth_t azimuth, elevation_t elevation);
393  int (*get_position)(ROT *rot, azimuth_t *azimuth, elevation_t *elevation);
394 
395  int (*stop)(ROT *rot);
396  int (*park)(ROT *rot);
397  int (*reset)(ROT *rot, rot_reset_t reset);
398  int (*move)(ROT *rot, int direction, int speed);
399 
400  /* get firmware info, etc. */
401  const char * (*get_info)(ROT *rot);
402 
403  int (*set_level)(ROT *rot, setting_t level, value_t val);
404  int (*get_level)(ROT *rot, setting_t level, value_t *val);
405 
406  int (*set_func)(ROT *rot, setting_t func, int status);
407  int (*get_func)(ROT *rot, setting_t func, int *status);
408 
409  int (*set_parm)(ROT *rot, setting_t parm, value_t val);
410  int (*get_parm)(ROT *rot, setting_t parm, value_t *val);
411 
412  int (*set_ext_level)(ROT *rot, token_t token, value_t val);
413  int (*get_ext_level)(ROT *rot, token_t token, value_t *val);
414 
415  int (*set_ext_func)(ROT *rot, token_t token, int status);
416  int (*get_ext_func)(ROT *rot, token_t token, int *status);
417 
418  int (*set_ext_parm)(ROT *rot, token_t token, value_t val);
419  int (*get_ext_parm)(ROT *rot, token_t token, value_t *val);
420 
421  int (*get_status)(ROT *rot, rot_status_t *status);
422 
423  const char *macro_name;
424 };
426 
427 
439 struct rot_state {
440  /*
441  * overridable fields
442  */
463  /*
464  * non overridable fields, internal use
465  */
466  hamlib_port_t rotport;
469  rig_ptr_t priv;
470  rig_ptr_t obj;
473  /* etc... */
474 };
475 
476 
489 struct s_rot {
490  struct rot_caps *caps;
491  struct rot_state state;
492 };
493 
494 
496 /* --------------- API function prototypes -----------------*/
497 
498 extern HAMLIB_EXPORT(ROT *)
499 rot_init HAMLIB_PARAMS((rot_model_t rot_model));
500 
501 extern HAMLIB_EXPORT(int)
502 rot_open HAMLIB_PARAMS((ROT *rot));
503 
504 extern HAMLIB_EXPORT(int)
505 rot_close HAMLIB_PARAMS((ROT *rot));
506 
507 extern HAMLIB_EXPORT(int)
508 rot_cleanup HAMLIB_PARAMS((ROT *rot));
509 
510 extern HAMLIB_EXPORT(int)
511 rot_set_conf HAMLIB_PARAMS((ROT *rot,
512  token_t token,
513  const char *val));
514 extern HAMLIB_EXPORT(int)
515 rot_get_conf HAMLIB_PARAMS((ROT *rot,
516  token_t token,
517  char *val));
518 
519 /*
520  * General API commands, from most primitive to least.. )
521  * List Set/Get functions pairs
522  */
523 extern HAMLIB_EXPORT(int)
524 rot_set_position HAMLIB_PARAMS((ROT *rot,
525  azimuth_t azimuth,
526  elevation_t elevation));
527 extern HAMLIB_EXPORT(int)
528 rot_get_position HAMLIB_PARAMS((ROT *rot,
529  azimuth_t *azimuth,
530  elevation_t *elevation));
531 
532 extern HAMLIB_EXPORT(int)
533 rot_stop HAMLIB_PARAMS((ROT *rot));
534 
535 extern HAMLIB_EXPORT(int)
536 rot_park HAMLIB_PARAMS((ROT *rot));
537 
538 extern HAMLIB_EXPORT(int)
539 rot_reset HAMLIB_PARAMS((ROT *rot,
540  rot_reset_t reset));
541 
542 extern HAMLIB_EXPORT(int)
543 rot_move HAMLIB_PARAMS((ROT *rot,
544  int direction,
545  int speed));
546 
547 extern HAMLIB_EXPORT(setting_t)
548 rot_has_get_level HAMLIB_PARAMS((ROT *rot,
549  setting_t level));
550 extern HAMLIB_EXPORT(setting_t)
551 rot_has_set_level HAMLIB_PARAMS((ROT *rot,
552  setting_t level));
553 
554 extern HAMLIB_EXPORT(setting_t)
555 rot_has_get_parm HAMLIB_PARAMS((ROT *rot,
556  setting_t parm));
557 extern HAMLIB_EXPORT(setting_t)
558 rot_has_set_parm HAMLIB_PARAMS((ROT *rot,
559  setting_t parm));
560 
561 extern HAMLIB_EXPORT(setting_t)
562 rot_has_get_func HAMLIB_PARAMS((ROT *rot,
563  setting_t func));
564 extern HAMLIB_EXPORT(setting_t)
565 rot_has_set_func HAMLIB_PARAMS((ROT *rot,
566  setting_t func));
567 
568 extern HAMLIB_EXPORT(int)
569 rot_set_func HAMLIB_PARAMS((ROT *rot,
570  setting_t func,
571  int status));
572 extern HAMLIB_EXPORT(int)
573 rot_get_func HAMLIB_PARAMS((ROT *rot,
574  setting_t func,
575  int *status));
576 
577 extern HAMLIB_EXPORT(int)
578 rot_set_level HAMLIB_PARAMS((ROT *rig,
579  setting_t level,
580  value_t val));
581 extern HAMLIB_EXPORT(int)
582 rot_get_level HAMLIB_PARAMS((ROT *rig,
583  setting_t level,
584  value_t *val));
585 
586 extern HAMLIB_EXPORT(int)
587 rot_set_parm HAMLIB_PARAMS((ROT *rig,
588  setting_t parm,
589  value_t val));
590 extern HAMLIB_EXPORT(int)
591 rot_get_parm HAMLIB_PARAMS((ROT *rig,
592  setting_t parm,
593  value_t *val));
594 
595 extern HAMLIB_EXPORT(int)
596 rot_set_ext_level HAMLIB_PARAMS((ROT *rig,
597  token_t token,
598  value_t val));
599 extern HAMLIB_EXPORT(int)
600 rot_get_ext_level HAMLIB_PARAMS((ROT *rig,
601  token_t token,
602  value_t *val));
603 
604 extern HAMLIB_EXPORT(int)
605 rot_set_ext_func HAMLIB_PARAMS((ROT *rig,
606  token_t token,
607  int status));
608 extern HAMLIB_EXPORT(int)
609 rot_get_ext_func HAMLIB_PARAMS((ROT *rig,
610  token_t token,
611  int *status));
612 
613 extern HAMLIB_EXPORT(int)
614 rot_set_ext_parm HAMLIB_PARAMS((ROT *rig,
615  token_t token,
616  value_t val));
617 extern HAMLIB_EXPORT(int)
618 rot_get_ext_parm HAMLIB_PARAMS((ROT *rig,
619  token_t token,
620  value_t *val));
621 
622 extern HAMLIB_EXPORT(const char *)
623 rot_get_info HAMLIB_PARAMS((ROT *rot));
624 
625 extern HAMLIB_EXPORT(int)
626 rot_get_status HAMLIB_PARAMS((ROT *rot,
627  rot_status_t *status));
628 
629 extern HAMLIB_EXPORT(int)
630 rot_register HAMLIB_PARAMS((const struct rot_caps *caps));
631 
632 extern HAMLIB_EXPORT(int)
633 rot_unregister HAMLIB_PARAMS((rot_model_t rot_model));
634 
635 extern HAMLIB_EXPORT(int)
636 rot_list_foreach HAMLIB_PARAMS((int (*cfunc)(const struct rot_caps *,
637  rig_ptr_t),
638  rig_ptr_t data));
639 
640 extern HAMLIB_EXPORT(int)
641 rot_load_backend HAMLIB_PARAMS((const char *be_name));
642 
643 extern HAMLIB_EXPORT(int)
644 rot_check_backend HAMLIB_PARAMS((rot_model_t rot_model));
645 
646 extern HAMLIB_EXPORT(int)
647 rot_load_all_backends HAMLIB_PARAMS((void));
648 
649 extern HAMLIB_EXPORT(rot_model_t)
650 rot_probe_all HAMLIB_PARAMS((hamlib_port_t *p));
651 
652 extern HAMLIB_EXPORT(int)
653 rot_token_foreach HAMLIB_PARAMS((ROT *rot,
654  int (*cfunc)(const struct confparams *,
655  rig_ptr_t),
656  rig_ptr_t data));
657 
658 extern HAMLIB_EXPORT(const struct confparams *)
659 rot_confparam_lookup HAMLIB_PARAMS((ROT *rot,
660  const char *name));
661 
662 extern HAMLIB_EXPORT(token_t)
663 rot_token_lookup HAMLIB_PARAMS((ROT *rot,
664  const char *name));
665 
666 extern HAMLIB_EXPORT(int)
667 rot_ext_func_foreach HAMLIB_PARAMS((ROT *rot,
668  int (*cfunc)(ROT *,
669  const struct confparams *,
670  rig_ptr_t),
671  rig_ptr_t data));
672 extern HAMLIB_EXPORT(int)
673 rot_ext_level_foreach HAMLIB_PARAMS((ROT *rot,
674  int (*cfunc)(ROT *,
675  const struct confparams *,
676  rig_ptr_t),
677  rig_ptr_t data));
678 extern HAMLIB_EXPORT(int)
679 rot_ext_parm_foreach HAMLIB_PARAMS((ROT *rot,
680  int (*cfunc)(ROT *,
681  const struct confparams *,
682  rig_ptr_t),
683  rig_ptr_t data));
684 
685 extern HAMLIB_EXPORT(const struct confparams *)
686 rot_ext_lookup HAMLIB_PARAMS((ROT *rot,
687  const char *name));
688 
689 extern HAMLIB_EXPORT(const struct confparams *)
690 rot_ext_lookup_tok HAMLIB_PARAMS((ROT *rot,
691  token_t token));
692 extern HAMLIB_EXPORT(token_t)
693 rot_ext_token_lookup HAMLIB_PARAMS((ROT *rot,
694  const char *name));
695 
696 extern HAMLIB_EXPORT(const struct rot_caps *)
697 rot_get_caps HAMLIB_PARAMS((rot_model_t rot_model));
698 
699 extern HAMLIB_EXPORT(int)
700 qrb HAMLIB_PARAMS((double lon1,
701  double lat1,
702  double lon2,
703  double lat2,
704  double *distance,
705  double *azimuth));
706 
707 extern HAMLIB_EXPORT(double)
708 distance_long_path HAMLIB_PARAMS((double distance));
709 
710 extern HAMLIB_EXPORT(double)
711 azimuth_long_path HAMLIB_PARAMS((double azimuth));
712 
713 extern HAMLIB_EXPORT(int)
714 longlat2locator HAMLIB_PARAMS((double longitude,
715  double latitude,
716  char *locator_res,
717  int pair_count));
718 
719 extern HAMLIB_EXPORT(int)
720 locator2longlat HAMLIB_PARAMS((double *longitude,
721  double *latitude,
722  const char *locator));
723 
724 extern HAMLIB_EXPORT(double)
725 dms2dec HAMLIB_PARAMS((int degrees,
726  int minutes,
727  double seconds,
728  int sw));
729 
730 extern HAMLIB_EXPORT(int)
731 dec2dms HAMLIB_PARAMS((double dec,
732  int *degrees,
733  int *minutes,
734  double *seconds,
735  int *sw));
736 
737 extern HAMLIB_EXPORT(int)
738 dec2dmmm HAMLIB_PARAMS((double dec,
739  int *degrees,
740  double *minutes,
741  int *sw));
742 
743 extern HAMLIB_EXPORT(double)
744 dmmm2dec HAMLIB_PARAMS((int degrees,
745  double minutes,
746  double seconds,
747  int sw));
748 
749 extern HAMLIB_EXPORT(setting_t) rot_parse_func(const char *s);
750 extern HAMLIB_EXPORT(setting_t) rot_parse_level(const char *s);
751 extern HAMLIB_EXPORT(setting_t) rot_parse_parm(const char *s);
752 extern HAMLIB_EXPORT(const char *) rot_strfunc(setting_t);
753 extern HAMLIB_EXPORT(const char *) rot_strlevel(setting_t);
754 extern HAMLIB_EXPORT(const char *) rot_strparm(setting_t);
755 extern HAMLIB_EXPORT(const char *) rot_strstatus(rot_status_t);
756 
758 
768 #define rot_debug rig_debug
769 
770 __END_DECLS
771 
772 #endif /* _ROTATOR_H */
773 
const char * rot_strlevel(setting_t level)
Convert enum ROT_LEVEL_... to alpha string.
Definition: misc.c:1007
const char * rot_strfunc(setting_t func)
Convert enum ROT_FUNC_... to alpha string.
Definition: misc.c:787
setting_t rot_parse_level(const char *s)
Convert alpha string to enum ROT_LEVEL_...
Definition: misc.c:921
const char * rot_strparm(setting_t parm)
Convert enum ROT_PARM_... to alpha string.
Definition: misc.c:1175
setting_t rot_parse_func(const char *s)
Convert alpha string to enum ROT_FUNC_...
Definition: misc.c:731
setting_t rot_parse_parm(const char *s)
Convert alpha string to ROT_PARM_...
Definition: misc.c:1120
serial_parity_e
Serial parity.
Definition: rig.h:228
uint64_t setting_t
Setting.
Definition: rig.h:964
rig_port_e
Port type.
Definition: rig.h:207
serial_handshake_e
Serial handshake.
Definition: rig.h:240
#define RIG_SETTING_MAX
Maximum # of rig settings.
Definition: rig.h:970
long token_t
configuration token
Definition: rig.h:652
rig_status_e
Development status of the backend.
Definition: rig.h:294
int rot_ext_parm_foreach(ROT *rot, int(*cfunc)(ROT *, const struct confparams *, rig_ptr_t), rig_ptr_t data)
Executes cfunc on all the elements stored in the extparms table.
Definition: rot_ext.c:184
int rot_model_t
Convenience type definition for rotator model.
Definition: rotlist.h:514
const struct confparams * rot_confparam_lookup(ROT *rot, const char *name)
lookup conf token by its name, return pointer to confparams struct.
Definition: rot_conf.c:554
rot_status_t
Rotator status flags.
Definition: rotator.h:202
rot_parm_e
Rotator Parameters.
Definition: rotator.h:264
ROT * rot_init(rot_model_t rot_model)
allocate a new ROT handle
Definition: rotator.c:197
int rot_get_parm(ROT *rot, setting_t parm, value_t *val)
get the value of a parameter
Definition: rot_settings.c:187
int rot_get_func(ROT *rot, setting_t func, int *status)
get the status of functions of the rotator
Definition: rot_settings.c:440
int rot_set_parm(ROT *rot, setting_t parm, value_t val)
set a rotator parameter
Definition: rot_settings.c:153
int rot_get_conf(ROT *rot, token_t token, char *val)
get the value of a configuration parameter
Definition: rot_conf.c:694
int rot_set_ext_func(ROT *rot, token_t token, int status)
set a rotator function extra parameter
Definition: rot_settings.c:549
int rot_reset_t
Type definition for rotator reset.
Definition: rotator.h:103
const char * rot_get_info(ROT *rot)
get general information from the rotator
Definition: rotator.c:836
int rot_set_position(ROT *rot, azimuth_t azimuth, elevation_t elevation)
set the azimuth and elevation of the rotator
Definition: rotator.c:587
int rot_set_func(ROT *rot, setting_t func, int status)
activate/de-activate functions of rotator
Definition: rot_settings.c:400
int rot_reset(ROT *rot, rot_reset_t reset)
reset the rotator
Definition: rotator.c:772
int rot_get_status(ROT *rot, rot_status_t *status)
get status flags from the rotator
Definition: rotator.c:865
int rot_token_foreach(ROT *rot, int(*cfunc)(const struct confparams *, rig_ptr_t), rig_ptr_t data)
Executes cfunc on all the elements stored in the conf table.
Definition: rot_conf.c:500
int rot_set_ext_level(ROT *rot, token_t token, value_t val)
set a rotator level extra parameter
Definition: rot_settings.c:477
int rot_get_level(ROT *rot, setting_t level, value_t *val)
get the value of a level
Definition: rot_settings.c:114
setting_t rot_has_get_level(ROT *rot, setting_t level)
check retrieval ability of level settings
Definition: rot_settings.c:221
int rot_set_level(ROT *rot, setting_t level, value_t val)
set a rotator level setting
Definition: rot_settings.c:76
token_t rot_ext_token_lookup(ROT *rot, const char *name)
Simple lookup returning token id associated with name.
Definition: rot_ext.c:325
setting_t rot_has_get_parm(ROT *rot, setting_t parm)
check retrieval ability of parameter settings
Definition: rot_settings.c:282
rot_level_e
Rotator Level Settings.
Definition: rotator.h:239
int rot_park(ROT *rot)
park the antenna
Definition: rotator.c:705
token_t rot_token_lookup(ROT *rot, const char *name)
Simple lookup returning token id associated with name.
Definition: rot_conf.c:611
int rot_move(ROT *rot, int direction, int speed)
move the rotator in the specified direction
Definition: rotator.c:803
int rot_ext_level_foreach(ROT *rot, int(*cfunc)(ROT *, const struct confparams *, rig_ptr_t), rig_ptr_t data)
Executes cfunc on all the elements stored in the extlevels table.
Definition: rot_ext.c:134
setting_t rot_has_set_level(ROT *rot, setting_t level)
check settable ability of level settings
Definition: rot_settings.c:252
int rot_get_position(ROT *rot, azimuth_t *azimuth, elevation_t *elevation)
get the azimuth and elevation of the rotator
Definition: rotator.c:650
int rot_cleanup(ROT *rot)
release a rot handle and free associated memory
Definition: rotator.c:542
const struct confparams * rot_ext_lookup(ROT *rot, const char *name)
lookup ext token by its name, return pointer to confparams struct.
Definition: rot_ext.c:234
float elevation_t
Type definition for elevation.
Definition: rotator.h:67
setting_t rot_has_set_func(ROT *rot, setting_t func)
check ability of rotator functions
Definition: rot_settings.c:370
int rot_get_ext_parm(ROT *rot, token_t token, value_t *val)
get the value of a parm extra parameter
Definition: rot_settings.c:653
setting_t rot_has_set_parm(ROT *rot, setting_t parm)
check settable ability of parameter settings
Definition: rot_settings.c:311
setting_t rot_has_get_func(ROT *rot, setting_t func)
check ability of rotator functions
Definition: rot_settings.c:340
int rot_close(ROT *rot)
close the communication to the rot
Definition: rotator.c:463
int rot_get_ext_level(ROT *rot, token_t token, value_t *val)
get the value of a level extra parameter
Definition: rot_settings.c:513
int rot_stop(ROT *rot)
stop the rotator
Definition: rotator.c:738
int rot_set_ext_parm(ROT *rot, token_t token, value_t val)
set a rotator parm extra parameter
Definition: rot_settings.c:621
int rot_get_ext_func(ROT *rot, token_t token, int *status)
get the value of a function extra parameter
Definition: rot_settings.c:585
float azimuth_t
Type definition for azimuth.
Definition: rotator.h:79
const struct confparams * rot_ext_lookup_tok(ROT *rot, token_t token)
lookup ext token, return pointer to confparams struct.
Definition: rot_ext.c:281
int rot_set_conf(ROT *rot, token_t token, const char *val)
set a rotator configuration parameter
Definition: rot_conf.c:642
int rot_ext_func_foreach(ROT *rot, int(*cfunc)(ROT *, const struct confparams *, rig_ptr_t), rig_ptr_t data)
Executes cfunc on all the elements stored in the extfuncs table.
Definition: rot_ext.c:84
int rot_open(ROT *rot)
open the communication to the rot
Definition: rotator.c:331
@ ROT_STATUS_OVERLAP_LEFT
Definition: rotator.h:218
@ ROT_STATUS_LIMIT_LEFT
Definition: rotator.h:214
@ ROT_STATUS_OVERLAP_UP
Definition: rotator.h:216
@ ROT_STATUS_MOVING_EL
Definition: rotator.h:209
@ ROT_STATUS_MOVING_RIGHT
Definition: rotator.h:208
@ ROT_STATUS_MOVING_AZ
Definition: rotator.h:206
@ ROT_STATUS_MOVING_LEFT
Definition: rotator.h:207
@ ROT_STATUS_MOVING
Definition: rotator.h:205
@ ROT_STATUS_OVERLAP_RIGHT
Definition: rotator.h:219
@ ROT_STATUS_LIMIT_UP
Definition: rotator.h:212
@ ROT_STATUS_MOVING_UP
Definition: rotator.h:210
@ ROT_STATUS_OVERLAP_DOWN
Definition: rotator.h:217
@ ROT_STATUS_LIMIT_DOWN
Definition: rotator.h:213
@ ROT_STATUS_LIMIT_RIGHT
Definition: rotator.h:215
@ ROT_STATUS_MOVING_DOWN
Definition: rotator.h:211
@ ROT_STATUS_BUSY
Definition: rotator.h:204
@ ROT_PARM_NONE
Definition: rotator.h:265
@ ROT_LEVEL_NONE
Definition: rotator.h:240
@ ROT_LEVEL_63
Definition: rotator.h:242
@ ROT_LEVEL_SPEED
Definition: rotator.h:241
int locator2longlat(double *longitude, double *latitude, const char *locator)
Convert Maidenhead grid locator to Longitude/Latitude.
Definition: locator.c:397
double dms2dec(int degrees, int minutes, double seconds, int sw)
Convert DMS to decimal degrees.
Definition: locator.c:141
int longlat2locator(double longitude, double latitude, char *locator, int pair_count)
Convert longitude/latitude to Maidenhead grid locator.
Definition: locator.c:485
double azimuth_long_path(double azimuth)
Calculate the long path bearing between two points.
Definition: locator.c:696
int qrb(double lon1, double lat1, double lon2, double lat2, double *distance, double *azimuth)
Calculate the distance and bearing between two points.
Definition: locator.c:557
int dec2dms(double dec, int *degrees, int *minutes, double *seconds, int *sw)
Convert decimal degrees angle into DMS notation.
Definition: locator.c:252
double distance_long_path(double distance)
Calculate the long path distance between two points.
Definition: locator.c:676
double dmmm2dec(int degrees, double minutes, double seconds, int sw)
Convert D M.MMM notation to decimal degrees.
Definition: locator.c:196
int dec2dmmm(double dec, int *degrees, double *minutes, int *sw)
Convert a decimal angle into D M.MMM notation.
Definition: locator.c:345
Hamlib rig data structures.
Hamlib rotator model definitions.
Configuration parameter structure.
Definition: rig.h:691
token_t token
Definition: rig.h:692
level/parm granularity definition
Definition: rig.h:1478
Rotator data structure.
Live data and customized fields.
Definition: rotator.h:439
rig_ptr_t obj
Definition: rotator.h:470
rig_ptr_t priv
Definition: rotator.h:469
setting_t has_set_parm
Definition: rotator.h:456
gran_t level_gran[64]
Definition: rotator.h:460
azimuth_t az_offset
Definition: rotator.h:448
setting_t has_set_func
Definition: rotator.h:452
gran_t parm_gran[64]
Definition: rotator.h:461
azimuth_t max_az
Definition: rotator.h:444
rot_status_t has_status
Definition: rotator.h:458
int current_speed
Definition: rotator.h:472
setting_t has_get_parm
Definition: rotator.h:455
azimuth_t min_az
Definition: rotator.h:443
hamlib_port_t rotport
Definition: rotator.h:466
setting_t has_get_func
Definition: rotator.h:451
setting_t has_get_level
Definition: rotator.h:453
int comm_state
Definition: rotator.h:468
elevation_t min_el
Definition: rotator.h:445
elevation_t max_el
Definition: rotator.h:446
setting_t has_set_level
Definition: rotator.h:454
elevation_t el_offset
Definition: rotator.h:449
int south_zero
Definition: rotator.h:447
This is the master data structure, acting as a handle for the controlled rotator.
Definition: rotator.h:489
struct rot_state state
Definition: rotator.h:491
struct rot_caps * caps
Definition: rotator.h:490
Universal approach for passing values.
Definition: rig.h:828

Generated by doxygen 1.9.1

Hamlib documentation for version 4.1 -- Mon Feb 1 2021 08:00:28
Project page: http://www.hamlib.org