Hamlib 4.7~git
 
Loading...
Searching...
No Matches
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
33
43
44
45
46__BEGIN_DECLS
47
48/* Forward struct references */
49
50struct rot;
51struct rot_state;
52
53
63typedef struct s_rot ROT;
64
65
75typedef float elevation_t;
76
77
87typedef float azimuth_t;
88
89
93#define NETROTCTL_RET "RPRT "
94
95
102#define ROT_RESET_ALL 1
103
104
112typedef int rot_reset_t;
113
114
118typedef enum {
119 ROT_FLAG_AZIMUTH = (1 << 1),
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)
127
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
361
363/* So far only used in tests/sprintflst.c. */
364#define ROT_STATUS_N(n) (1u<<(n))
366
370#define ROT_SPEED_NOCHANGE (-1)
371
372
384 ROT_LEVEL_SPEED = (1 << 0),
385 ROT_LEVEL_63 = CONSTANT_64BIT_FLAG(63),
386};
387
388
390#define ROT_LEVEL_FLOAT_LIST (0)
391
392#define ROT_LEVEL_READONLY_LIST (0)
393
394#define ROT_LEVEL_IS_FLOAT(l) ((l)&ROT_LEVEL_FLOAT_LIST)
395#define ROT_LEVEL_SET(l) ((l)&~ROT_LEVEL_READONLY_LIST)
397
398
417
418
420#define ROT_PARM_FLOAT_LIST (0)
421#define ROT_PARM_READONLY_LIST (0)
422
423#define ROT_PARM_IS_FLOAT(l) ((l)&ROT_PARM_FLOAT_LIST)
424#define ROT_PARM_SET(l) ((l)&~ROT_PARM_READONLY_LIST)
426
427
442#define ROT_FUNC_NONE 0
443#ifndef SWIGLUAHIDE
444/* Hide the top 32 bits from the old Lua binding as they can't be represented */
445#define ROT_FUNC_BIT63 CONSTANT_64BIT_FLAG (63)
446/* 63 is this highest bit number that can be used */
447#endif
448
449
450/* Basic rot type, can store some useful info about different rotators. Each
451 * lib must be able to populate this structure, so we can make useful
452 * enquiries about capabilities.
453 */
454
472struct rot_caps {
474 const char *model_name;
475 const char *mfg_name;
476 const char *version;
477 const char *copyright;
479
482
489
493 int retry;
494
501
503
506
507 const struct confparams *extparms;
508 const struct confparams *extlevels;
509 const struct confparams *extfuncs;
511
512 /*
513 * Movement range, az is relative to North
514 * negative values allowed for overlap
515 */
522
523
524 const struct confparams *cfgparams;
525 const rig_ptr_t priv;
526
527 /*
528 * Rot Admin API
529 *
530 */
531
532 int (*rot_init)(ROT *rot);
533 int (*rot_cleanup)(ROT *rot);
534 int (*rot_open)(ROT *rot);
535 int (*rot_close)(ROT *rot);
536
537 int (*set_conf)(ROT *rot, hamlib_token_t token, const char *val);
538 int (*get_conf)(ROT *rot, hamlib_token_t token, char *val);
539
540 /*
541 * General API commands, from most primitive to least.. :()
542 * List Set/Get functions pairs
543 */
544
545 int (*set_position)(ROT *rot, azimuth_t azimuth, elevation_t elevation);
546 int (*get_position)(ROT *rot, azimuth_t *azimuth, elevation_t *elevation);
547
548 int (*stop)(ROT *rot);
549 int (*park)(ROT *rot);
550 int (*reset)(ROT *rot, rot_reset_t reset);
551 int (*move)(ROT *rot, int direction, int speed);
552
553 /* get firmware info, etc. */
554 const char * (*get_info)(ROT *rot);
555
556 int (*set_level)(ROT *rot, setting_t level, value_t val);
557 int (*get_level)(ROT *rot, setting_t level, value_t *val);
558
559 int (*set_func)(ROT *rot, setting_t func, int status);
560 int (*get_func)(ROT *rot, setting_t func, int *status);
561
562 int (*set_parm)(ROT *rot, setting_t parm, value_t val);
563 int (*get_parm)(ROT *rot, setting_t parm, value_t *val);
564
565 int (*set_ext_level)(ROT *rot, hamlib_token_t token, value_t val);
566 int (*get_ext_level)(ROT *rot, hamlib_token_t token, value_t *val);
567
568 int (*set_ext_func)(ROT *rot, hamlib_token_t token, int status);
569 int (*get_ext_func)(ROT *rot, hamlib_token_t token, int *status);
570
571 int (*set_ext_parm)(ROT *rot, hamlib_token_t token, value_t val);
572 int (*get_ext_parm)(ROT *rot, hamlib_token_t token, value_t *val);
573
575
576 const char *macro_name;
577 int (*get_conf2)(ROT *rot, hamlib_token_t token, char *val, int val_len);
578};
579
580#define ROT_MODEL(arg) .rot_model=arg,.macro_name=#arg
582
583
594struct rot_state {
595 /*
596 * overridable fields
597 */
605
612
614
617
618 /*
619 * non overridable fields, internal use
620 */
621 hamlib_port_t_deprecated rotport_deprecated;
622 hamlib_port_t_deprecated rotport2_deprecated;
623
625 rig_ptr_t priv;
626 rig_ptr_t obj;
627
629 hamlib_port_t rotport;
630 hamlib_port_t rotport2;
631 rig_ptr_t *pstrotator_handler_priv_data;
632 deferred_config_header_t config_queue;
633};
634
635
647struct s_rot {
648 struct rot_caps *caps;
650};
651
652
654/* --------------- API function prototypes -----------------*/
655
656extern HAMLIB_EXPORT(ROT *)
657rot_init HAMLIB_PARAMS((rot_model_t rot_model));
658
659extern HAMLIB_EXPORT(int)
660rot_open HAMLIB_PARAMS((ROT *rot));
661
662extern HAMLIB_EXPORT(int)
663rot_close HAMLIB_PARAMS((ROT *rot));
664
665extern HAMLIB_EXPORT(int)
666rot_cleanup HAMLIB_PARAMS((ROT *rot));
667
668extern HAMLIB_EXPORT(int)
669rot_set_conf HAMLIB_PARAMS((ROT *rot,
670 hamlib_token_t token,
671 const char *val));
672extern HAMLIB_EXPORT(int)
673rot_get_conf HAMLIB_PARAMS((ROT *rot,
674 hamlib_token_t token,
675 char *val));
676
677extern HAMLIB_EXPORT(int)
678rot_get_conf2 HAMLIB_PARAMS((ROT *rot,
679 hamlib_token_t token,
680 char *val,
681 int val_len));
682
683/*
684 * General API commands, from most primitive to least.. )
685 * List Set/Get functions pairs
686 */
687extern HAMLIB_EXPORT(int)
688rot_set_position HAMLIB_PARAMS((ROT *rot,
689 azimuth_t azimuth,
690 elevation_t elevation));
691extern HAMLIB_EXPORT(int)
692rot_get_position HAMLIB_PARAMS((ROT *rot,
693 azimuth_t *azimuth,
694 elevation_t *elevation));
695
696extern HAMLIB_EXPORT(int)
697rot_stop HAMLIB_PARAMS((ROT *rot));
698
699extern HAMLIB_EXPORT(int)
700rot_park HAMLIB_PARAMS((ROT *rot));
701
702extern HAMLIB_EXPORT(int)
703rot_reset HAMLIB_PARAMS((ROT *rot,
704 rot_reset_t reset));
705
706extern HAMLIB_EXPORT(int)
707rot_move HAMLIB_PARAMS((ROT *rot,
708 int direction,
709 int speed));
710
711extern HAMLIB_EXPORT(setting_t)
712rot_has_get_level HAMLIB_PARAMS((ROT *rot,
713 setting_t level));
714extern HAMLIB_EXPORT(setting_t)
715rot_has_set_level HAMLIB_PARAMS((ROT *rot,
716 setting_t level));
717
718extern HAMLIB_EXPORT(setting_t)
719rot_has_get_parm HAMLIB_PARAMS((ROT *rot,
720 setting_t parm));
721extern HAMLIB_EXPORT(setting_t)
722rot_has_set_parm HAMLIB_PARAMS((ROT *rot,
723 setting_t parm));
724
725extern HAMLIB_EXPORT(setting_t)
726rot_has_get_func HAMLIB_PARAMS((ROT *rot,
727 setting_t func));
728extern HAMLIB_EXPORT(setting_t)
729rot_has_set_func HAMLIB_PARAMS((ROT *rot,
730 setting_t func));
731
732extern HAMLIB_EXPORT(int)
733rot_set_func HAMLIB_PARAMS((ROT *rot,
734 setting_t func,
735 int status));
736extern HAMLIB_EXPORT(int)
737rot_get_func HAMLIB_PARAMS((ROT *rot,
738 setting_t func,
739 int *status));
740
741extern HAMLIB_EXPORT(int)
742rot_set_level HAMLIB_PARAMS((ROT *rig,
743 setting_t level,
744 value_t val));
745extern HAMLIB_EXPORT(int)
746rot_get_level HAMLIB_PARAMS((ROT *rig,
747 setting_t level,
748 value_t *val));
749
750extern HAMLIB_EXPORT(int)
751rot_set_parm HAMLIB_PARAMS((ROT *rig,
752 setting_t parm,
753 value_t val));
754extern HAMLIB_EXPORT(int)
755rot_get_parm HAMLIB_PARAMS((ROT *rig,
756 setting_t parm,
757 value_t *val));
758
759extern HAMLIB_EXPORT(int)
760rot_set_ext_level HAMLIB_PARAMS((ROT *rig,
761 hamlib_token_t token,
762 value_t val));
763extern HAMLIB_EXPORT(int)
764rot_get_ext_level HAMLIB_PARAMS((ROT *rig,
765 hamlib_token_t token,
766 value_t *val));
767
768extern HAMLIB_EXPORT(int)
769rot_set_ext_func HAMLIB_PARAMS((ROT *rig,
770 hamlib_token_t token,
771 int status));
772extern HAMLIB_EXPORT(int)
773rot_get_ext_func HAMLIB_PARAMS((ROT *rig,
774 hamlib_token_t token,
775 int *status));
776
777extern HAMLIB_EXPORT(int)
778rot_set_ext_parm HAMLIB_PARAMS((ROT *rig,
779 hamlib_token_t token,
780 value_t val));
781extern HAMLIB_EXPORT(int)
782rot_get_ext_parm HAMLIB_PARAMS((ROT *rig,
783 hamlib_token_t token,
784 value_t *val));
785
786extern HAMLIB_EXPORT(const char *)
787rot_get_info HAMLIB_PARAMS((ROT *rot));
788
789extern HAMLIB_EXPORT(int)
790rot_get_status HAMLIB_PARAMS((ROT *rot,
791 rot_status_t *status));
792
793extern HAMLIB_EXPORT(int)
794rot_register HAMLIB_PARAMS((const struct rot_caps *caps));
795
796extern HAMLIB_EXPORT(int)
797rot_unregister HAMLIB_PARAMS((rot_model_t rot_model));
798
799extern HAMLIB_EXPORT(int)
800rot_list_foreach HAMLIB_PARAMS((int (*cfunc)(const struct rot_caps *,
801 rig_ptr_t),
802 rig_ptr_t data));
803
804extern HAMLIB_EXPORT(int)
805rot_load_backend HAMLIB_PARAMS((const char *be_name));
806
807extern HAMLIB_EXPORT(int)
808rot_check_backend HAMLIB_PARAMS((rot_model_t rot_model));
809
810extern HAMLIB_EXPORT(int)
811rot_load_all_backends HAMLIB_PARAMS((void));
812
813extern HAMLIB_EXPORT(rot_model_t)
814rot_probe_all HAMLIB_PARAMS((hamlib_port_t *p));
815
816extern HAMLIB_EXPORT(int)
817rot_token_foreach HAMLIB_PARAMS((ROT *rot,
818 int (*cfunc)(const struct confparams *,
819 rig_ptr_t),
820 rig_ptr_t data));
821
822extern HAMLIB_EXPORT(const struct confparams *)
823rot_confparam_lookup HAMLIB_PARAMS((ROT *rot,
824 const char *name));
825
826extern HAMLIB_EXPORT(hamlib_token_t)
827rot_token_lookup HAMLIB_PARAMS((ROT *rot,
828 const char *name));
829
830extern HAMLIB_EXPORT(int)
831rot_ext_func_foreach HAMLIB_PARAMS((ROT *rot,
832 int (*cfunc)(ROT *,
833 const struct confparams *,
834 rig_ptr_t),
835 rig_ptr_t data));
836extern HAMLIB_EXPORT(int)
837rot_ext_level_foreach HAMLIB_PARAMS((ROT *rot,
838 int (*cfunc)(ROT *,
839 const struct confparams *,
840 rig_ptr_t),
841 rig_ptr_t data));
842extern HAMLIB_EXPORT(int)
843rot_ext_parm_foreach HAMLIB_PARAMS((ROT *rot,
844 int (*cfunc)(ROT *,
845 const struct confparams *,
846 rig_ptr_t),
847 rig_ptr_t data));
848
849extern HAMLIB_EXPORT(const struct confparams *)
850rot_ext_lookup HAMLIB_PARAMS((ROT *rot,
851 const char *name));
852
853extern HAMLIB_EXPORT(const struct confparams *)
854rot_ext_lookup_tok HAMLIB_PARAMS((ROT *rot,
855 hamlib_token_t token));
856extern HAMLIB_EXPORT(hamlib_token_t)
857rot_ext_token_lookup HAMLIB_PARAMS((ROT *rot,
858 const char *name));
859
860extern HAMLIB_EXPORT(const struct rot_caps *)
861rot_get_caps HAMLIB_PARAMS((rot_model_t rot_model));
862
863extern HAMLIB_EXPORT(int)
864qrb HAMLIB_PARAMS((double lon1,
865 double lat1,
866 double lon2,
867 double lat2,
868 double *distance,
869 double *azimuth));
870
871extern HAMLIB_EXPORT(double)
872distance_long_path HAMLIB_PARAMS((double distance));
873
874extern HAMLIB_EXPORT(double)
875azimuth_long_path HAMLIB_PARAMS((double azimuth));
876
877#if 0
878extern HAMLIB_EXPORT(int)
879longlat2locator HAMLIB_PARAMS((double longitude,
880 double latitude,
881 char *locator_res,
882 int pair_count));
883
884extern HAMLIB_EXPORT(int)
885locator2longlat HAMLIB_PARAMS((double *longitude,
886 double *latitude,
887 const char *locator));
888#endif
889
890extern HAMLIB_EXPORT(double)
891dms2dec HAMLIB_PARAMS((int degrees,
892 int minutes,
893 double seconds,
894 int sw));
895
896extern HAMLIB_EXPORT(int)
897dec2dms HAMLIB_PARAMS((double dec,
898 int *degrees,
899 int *minutes,
900 double *seconds,
901 int *sw));
902
903extern HAMLIB_EXPORT(int)
904dec2dmmm HAMLIB_PARAMS((double dec,
905 int *degrees,
906 double *minutes,
907 int *sw));
908
909extern HAMLIB_EXPORT(double)
910dmmm2dec HAMLIB_PARAMS((int degrees,
911 double minutes,
912 double seconds,
913 int sw));
914
915extern HAMLIB_EXPORT(setting_t) rot_parse_func(const char *s);
916extern HAMLIB_EXPORT(setting_t) rot_parse_level(const char *s);
917extern HAMLIB_EXPORT(setting_t) rot_parse_parm(const char *s);
918extern HAMLIB_EXPORT(const char *) rot_strfunc(setting_t);
919extern HAMLIB_EXPORT(const char *) rot_strlevel(setting_t);
920extern HAMLIB_EXPORT(const char *) rot_strparm(setting_t);
921extern HAMLIB_EXPORT(const char *) rot_strstatus(rot_status_t);
922
923extern HAMLIB_EXPORT(void *) rot_data_pointer(ROT *rot, rig_ptrx_t idx);
924
926
934#define rot_debug rig_debug
935
936__END_DECLS
937
938#endif /* _ROTATOR_H */
939
const char * rot_strstatus(rot_status_t status)
Convert enum ROT_STATUS_... to a string.
Definition misc.c:2344
setting_t rot_parse_level(const char *s)
Convert alpha string to enum ROT_LEVEL_...
Definition misc.c:1123
const char * rot_strparm(setting_t parm)
Convert enum ROT_PARM_... to alpha string.
Definition misc.c:1383
const char * rot_strlevel(setting_t level)
Convert enum ROT_LEVEL_... to alpha string.
Definition misc.c:1209
const char * rot_strfunc(setting_t func)
Convert enum ROT_FUNC_... to alpha string.
Definition misc.c:917
setting_t rot_parse_func(const char *s)
Convert alpha string to enum ROT_FUNC_...
Definition misc.c:861
setting_t rot_parse_parm(const char *s)
Convert alpha string to ROT_PARM_...
Definition misc.c:1328
serial_parity_e
Serial parity.
Definition rig.h:331
long hamlib_token_t
configuration token
Definition rig.h:859
uint64_t setting_t
Setting.
Definition rig.h:1201
rig_port_e
Port type.
Definition rig.h:310
serial_handshake_e
Serial handshake.
Definition rig.h:343
#define RIG_SETTING_MAX
Maximum # of rig settings.
Definition rig.h:1207
struct gran gran_t
gran_t type
Definition rig.h:1738
rig_status_e
Development status of the backend.
Definition rig.h:415
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
const char * rot_get_info(ROT *rot)
Get general information from the rotator.
Definition rotator.c:1038
int rot_model_t
Convenience type definition for a rotator model.
Definition rotlist.h:723
rot_status_t
Rotator status flags.
Definition rotator.h:342
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
rot_parm_e
Rotator Parameters.
Definition rotator.h:414
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
int rot_get_func(ROT *rot, setting_t func, int *status)
Query the status of functions of the rotator.
Definition rot_settings.c:514
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 rot_set_conf(ROT *rot, hamlib_token_t token, const char *val)
Set a rotator configuration parameter.
Definition rot_conf.c:746
int rot_reset_t
Type definition for rotator reset.
Definition rotator.h:112
int rot_set_position(ROT *rot, azimuth_t azimuth, elevation_t elevation)
Set the azimuth and elevation of the rotator.
Definition rotator.c:755
int rot_set_func(ROT *rot, setting_t func, int status)
Activate or deactivate functions of a rotator.
Definition rot_settings.c:470
int rot_reset(ROT *rot, rot_reset_t reset)
Reset the rotator.
Definition rotator.c:962
struct s_rot ROT
Main rotator handle type definition.
Definition rotator.h:63
int rot_get_status(ROT *rot, rot_status_t *status)
Query status flags of the rotator.
Definition rotator.c:1071
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
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
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_get_conf(ROT *rot, hamlib_token_t token, char *val)
Query the value of a rotator configuration parameter.
Definition rot_conf.c:805
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 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
setting_t rot_has_get_parm(ROT *rot, setting_t parm)
Check which rotator parameter settings can be queried.
Definition rot_settings.c:324
rot_level_e
Rotator Level Settings.
Definition rotator.h:382
int rot_park(ROT *rot)
Park the rotator.
Definition rotator.c:887
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 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
void * rot_data_pointer(ROT *rot, rig_ptrx_t idx)
Get the address of rotator data structure(s)
Definition rotator.c:1094
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
int rot_move(ROT *rot, int direction, int speed)
Move the rotator in the specified direction and speed.
Definition rotator.c:1003
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
setting_t rot_has_set_level(ROT *rot, setting_t level)
Query the rotator levels that may be set.
Definition rot_settings.c:286
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_cleanup(ROT *rot)
Release a ROT handle and free associated memory.
Definition rotator.c:699
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
float elevation_t
Type definition for elevation.
Definition rotator.h:75
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
rot_type_t
Rotator type flags for bitmasks.
Definition rotator.h:118
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
setting_t rot_has_set_func(ROT *rot, setting_t func)
Query support of rotator functions.
Definition rot_settings.c:434
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
setting_t rot_has_set_parm(ROT *rot, setting_t parm)
Query the rotator parameters that may be set.
Definition rot_settings.c:361
setting_t rot_has_get_func(ROT *rot, setting_t func)
Check which rotator functions can be queried.
Definition rot_settings.c:397
int rot_close(ROT *rot)
Close the communication channel to the rotator.
Definition rotator.c:610
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
int rot_stop(ROT *rot)
Stop the rotator.
Definition rotator.c:925
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
float azimuth_t
Type definition for azimuth.
Definition rotator.h:87
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 rot_open(ROT *rot)
Open the communication channel to the rotator.
Definition rotator.c:372
ROT * rot_init(rot_model_t rot_model)
Allocate a new ROT handle.
Definition rotator.c:218
@ ROT_STATUS_OVERLAP_LEFT
Definition rotator.h:358
@ ROT_STATUS_NONE
Definition rotator.h:343
@ ROT_STATUS_LIMIT_LEFT
Definition rotator.h:354
@ ROT_STATUS_OVERLAP_UP
Definition rotator.h:356
@ ROT_STATUS_MOVING_EL
Definition rotator.h:349
@ ROT_STATUS_MOVING_RIGHT
Definition rotator.h:348
@ ROT_STATUS_MOVING_AZ
Definition rotator.h:346
@ ROT_STATUS_MOVING_LEFT
Definition rotator.h:347
@ ROT_STATUS_MOVING
Definition rotator.h:345
@ ROT_STATUS_OVERLAP_RIGHT
Definition rotator.h:359
@ ROT_STATUS_LIMIT_UP
Definition rotator.h:352
@ ROT_STATUS_MOVING_UP
Definition rotator.h:350
@ ROT_STATUS_OVERLAP_DOWN
Definition rotator.h:357
@ ROT_STATUS_LIMIT_DOWN
Definition rotator.h:353
@ ROT_STATUS_LIMIT_RIGHT
Definition rotator.h:355
@ ROT_STATUS_MOVING_DOWN
Definition rotator.h:351
@ ROT_STATUS_BUSY
Definition rotator.h:344
@ ROT_PARM_NONE
Definition rotator.h:415
@ ROT_LEVEL_NONE
Definition rotator.h:383
@ ROT_LEVEL_63
Definition rotator.h:385
@ ROT_LEVEL_SPEED
Definition rotator.h:384
@ ROT_FLAG_ELEVATION
Definition rotator.h:120
@ ROT_FLAG_AZIMUTH
Definition rotator.h:119
int locator2longlat(double *longitude, double *latitude, const char *locator)
Convert QRA locator (Maidenhead grid square) to Longitude/Latitude.
Definition locator.c:451
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 longlat2locator(double longitude, double latitude, char *locator, int pair_count)
Convert longitude/latitude to QRA locator (Maidenhead grid square).
Definition locator.c:545
double azimuth_long_path(double azimuth)
Calculate the long path bearing between two points.
Definition locator.c:759
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 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
double distance_long_path(double distance)
Calculate the long path distance between two points.
Definition locator.c:739
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 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
Hamlib rig data structures.
Hamlib rotator model definitions.
Configuration parameter structure.
Definition rig.h:900
Rotator capability data structure.
Definition rotator.h:472
int(* get_func)(ROT *rot, setting_t func, int *status)
Definition rotator.h:560
azimuth_t min_az
Definition rotator.h:516
const char * macro_name
Definition rotator.h:576
setting_t has_set_parm
Definition rotator.h:500
rot_status_t has_status
Definition rotator.h:502
enum rig_port_e port_type
Definition rotator.h:481
enum serial_handshake_e serial_handshake
Definition rotator.h:488
int(* get_parm)(ROT *rot, setting_t parm, value_t *val)
Definition rotator.h:563
int(* get_conf2)(ROT *rot, hamlib_token_t token, char *val, int val_len)
Definition rotator.h:577
int serial_data_bits
Definition rotator.h:485
int(* rot_open)(ROT *rot)
Definition rotator.h:534
setting_t has_set_func
Definition rotator.h:496
int * ext_tokens
Definition rotator.h:510
int(* get_ext_parm)(ROT *rot, hamlib_token_t token, value_t *val)
Definition rotator.h:572
const struct confparams * extfuncs
Definition rotator.h:509
int(* get_conf)(ROT *rot, hamlib_token_t token, char *val)
Definition rotator.h:538
const char * copyright
Definition rotator.h:477
int(* park)(ROT *rot)
Definition rotator.h:549
enum serial_parity_e serial_parity
Definition rotator.h:487
const rig_ptr_t priv
Definition rotator.h:525
int(* rot_cleanup)(ROT *rot)
Definition rotator.h:533
rot_model_t rot_model
Definition rotator.h:473
int post_write_delay
Definition rotator.h:491
int serial_rate_min
Definition rotator.h:483
int write_delay
Definition rotator.h:490
int(* get_ext_level)(ROT *rot, hamlib_token_t token, value_t *val)
Definition rotator.h:566
int(* set_ext_func)(ROT *rot, hamlib_token_t token, int status)
Definition rotator.h:568
setting_t has_get_level
Definition rotator.h:497
int(* get_status)(ROT *rot, rot_status_t *status)
Definition rotator.h:574
int serial_stop_bits
Definition rotator.h:486
int(* set_conf)(ROT *rot, hamlib_token_t token, const char *val)
Definition rotator.h:537
int(* set_ext_level)(ROT *rot, hamlib_token_t token, value_t val)
Definition rotator.h:565
int(* set_position)(ROT *rot, azimuth_t azimuth, elevation_t elevation)
Definition rotator.h:545
const char * version
Definition rotator.h:476
setting_t has_set_level
Definition rotator.h:498
elevation_t min_el
Definition rotator.h:519
int(* move)(ROT *rot, int direction, int speed)
Definition rotator.h:551
gran_t parm_gran[64]
Definition rotator.h:505
int retry
Definition rotator.h:493
int timeout
Definition rotator.h:492
enum rig_status_e status
Definition rotator.h:478
int(* get_level)(ROT *rot, setting_t level, value_t *val)
Definition rotator.h:557
int serial_rate_max
Definition rotator.h:484
int rot_type
Definition rotator.h:480
const char * mfg_name
Definition rotator.h:475
setting_t has_get_parm
Definition rotator.h:499
int(* get_position)(ROT *rot, azimuth_t *azimuth, elevation_t *elevation)
Definition rotator.h:546
setting_t has_get_func
Definition rotator.h:495
int(* reset)(ROT *rot, rot_reset_t reset)
Definition rotator.h:550
int(* rot_init)(ROT *rot)
Definition rotator.h:532
int(* rot_close)(ROT *rot)
Definition rotator.h:535
const struct confparams * extparms
Definition rotator.h:507
elevation_t max_el
Definition rotator.h:521
int(* set_parm)(ROT *rot, setting_t parm, value_t val)
Definition rotator.h:562
int(* set_ext_parm)(ROT *rot, hamlib_token_t token, value_t val)
Definition rotator.h:571
const struct confparams * extlevels
Definition rotator.h:508
azimuth_t max_az
Definition rotator.h:517
const struct confparams * cfgparams
Definition rotator.h:524
int(* get_ext_func)(ROT *rot, hamlib_token_t token, int *status)
Definition rotator.h:569
const char * model_name
Definition rotator.h:474
gran_t level_gran[64]
Definition rotator.h:504
int(* set_level)(ROT *rot, setting_t level, value_t val)
Definition rotator.h:556
int(* stop)(ROT *rot)
Definition rotator.h:548
int(* set_func)(ROT *rot, setting_t func, int status)
Definition rotator.h:559
Rotator state structure.
Definition rotator.h:594
rig_ptr_t obj
Definition rotator.h:626
rig_ptr_t priv
Definition rotator.h:625
setting_t has_set_parm
Definition rotator.h:611
gran_t level_gran[64]
Definition rotator.h:615
azimuth_t az_offset
Definition rotator.h:603
setting_t has_set_func
Definition rotator.h:607
gran_t parm_gran[64]
Definition rotator.h:616
hamlib_port_t_deprecated rotport_deprecated
Definition rotator.h:621
azimuth_t max_az
Definition rotator.h:599
rot_status_t has_status
Definition rotator.h:613
int current_speed
Definition rotator.h:628
hamlib_port_t rotport2
Definition rotator.h:630
hamlib_port_t_deprecated rotport2_deprecated
Definition rotator.h:622
setting_t has_get_parm
Definition rotator.h:610
azimuth_t min_az
Definition rotator.h:598
hamlib_port_t rotport
Definition rotator.h:629
setting_t has_get_func
Definition rotator.h:606
setting_t has_get_level
Definition rotator.h:608
int comm_state
Definition rotator.h:624
elevation_t min_el
Definition rotator.h:600
elevation_t max_el
Definition rotator.h:601
setting_t has_set_level
Definition rotator.h:609
elevation_t el_offset
Definition rotator.h:604
int south_zero
Definition rotator.h:602
Master rotator structure.
Definition rotator.h:647
struct rot_state state
Definition rotator.h:649
struct rot_caps * caps
Definition rotator.h:648
Universal approach for passing values.
Definition rig.h:1025