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
44
45
46
47__BEGIN_DECLS
48
49/* Forward struct references */
50
51struct rot;
52struct rot_state;
53
54
63typedef struct s_rot ROT;
64
65
74typedef float elevation_t;
75
76
85typedef float azimuth_t;
86
87
91#define NETROTCTL_RET "RPRT "
92
93
99#define ROT_RESET_ALL 1
100
101
108typedef int rot_reset_t;
109
110
114typedef enum {
115 ROT_FLAG_AZIMUTH = (1 << 1),
117} rot_type_t;
118
120/* So far only used in tests/dumpcaps_rot.c. */
121#define ROT_TYPE_MASK (ROT_FLAG_AZIMUTH|ROT_FLAG_ELEVATION)
123
134#define ROT_TYPE_OTHER 0
135#define ROT_TYPE_AZIMUTH ROT_FLAG_AZIMUTH
136#define ROT_TYPE_ELEVATION ROT_FLAG_ELEVATION
137#define ROT_TYPE_AZEL (ROT_FLAG_AZIMUTH|ROT_FLAG_ELEVATION)
138
139
149#define ROT_MOVE_UP (1<<1)
150
160#define ROT_MOVE_DOWN (1<<2)
161
171#define ROT_MOVE_LEFT (1<<3)
172
183#define ROT_MOVE_CCW ROT_MOVE_LEFT
184
194#define ROT_MOVE_RIGHT (1<<4)
195
206#define ROT_MOVE_CW ROT_MOVE_RIGHT
207
220#define ROT_MOVE_UP_LEFT (1<<5)
221
234#define ROT_MOVE_UP_CCW ROT_MOVE_UP_LEFT
235
248#define ROT_MOVE_UP_RIGHT (1<<6)
249
262#define ROT_MOVE_UP_CW ROT_MOVE_UP_RIGHT
263
276#define ROT_MOVE_DOWN_LEFT (1 << 7)
277
278
291#define ROT_MOVE_DOWN_CCW ROT_MOVE_DOWN_LEFT
292
305#define ROT_MOVE_DOWN_RIGHT (1 << 8)
306
319#define ROT_MOVE_DOWN_CW ROT_MOVE_DOWN_RIGHT
320
343
345/* So far only used in tests/sprintflst.c. */
346#define ROT_STATUS_N(n) (1u<<(n))
348
352#define ROT_SPEED_NOCHANGE (-1)
353
354
366 ROT_LEVEL_SPEED = (1 << 0),
367 ROT_LEVEL_63 = CONSTANT_64BIT_FLAG(63),
368};
369
370
372#define ROT_LEVEL_FLOAT_LIST (0)
373
374#define ROT_LEVEL_READONLY_LIST (0)
375
376#define ROT_LEVEL_IS_FLOAT(l) ((l)&ROT_LEVEL_FLOAT_LIST)
377#define ROT_LEVEL_SET(l) ((l)&~ROT_LEVEL_READONLY_LIST)
379
380
399
400
402#define ROT_PARM_FLOAT_LIST (0)
403#define ROT_PARM_READONLY_LIST (0)
404
405#define ROT_PARM_IS_FLOAT(l) ((l)&ROT_PARM_FLOAT_LIST)
406#define ROT_PARM_SET(l) ((l)&~ROT_PARM_READONLY_LIST)
408
409
424#define ROT_FUNC_NONE 0
425#ifndef SWIGLUAHIDE
426/* Hide the top 32 bits from the old Lua binding as they can't be represented */
427#define ROT_FUNC_BIT63 CONSTANT_64BIT_FLAG (63)
428/* 63 is this highest bit number that can be used */
429#endif
430
431
432/* Basic rot type, can store some useful info about different rotators. Each
433 * lib must be able to populate this structure, so we can make useful
434 * enquiries about capabilities.
435 */
436
453struct rot_caps {
455 const char *model_name;
456 const char *mfg_name;
457 const char *version;
458 const char *copyright;
460
463
470
474 int retry;
475
482
484
487
488 const struct confparams *extparms;
489 const struct confparams *extlevels;
490 const struct confparams *extfuncs;
492
493 /*
494 * Movement range, az is relative to North
495 * negative values allowed for overlap
496 */
503
504
505 const struct confparams *cfgparams;
506 const rig_ptr_t priv;
507
508 /*
509 * Rot Admin API
510 *
511 */
512
513 int (*rot_init)(ROT *rot);
514 int (*rot_cleanup)(ROT *rot);
515 int (*rot_open)(ROT *rot);
516 int (*rot_close)(ROT *rot);
517
518 int (*set_conf)(ROT *rot, hamlib_token_t token, const char *val);
519 int (*get_conf)(ROT *rot, hamlib_token_t token, char *val);
520
521 /*
522 * General API commands, from most primitive to least.. :()
523 * List Set/Get functions pairs
524 */
525
526 int (*set_position)(ROT *rot, azimuth_t azimuth, elevation_t elevation);
527 int (*get_position)(ROT *rot, azimuth_t *azimuth, elevation_t *elevation);
528
529 int (*stop)(ROT *rot);
530 int (*park)(ROT *rot);
531 int (*reset)(ROT *rot, rot_reset_t reset);
532 int (*move)(ROT *rot, int direction, int speed);
533
534 /* get firmware info, etc. */
535 const char * (*get_info)(ROT *rot);
536
537 int (*set_level)(ROT *rot, setting_t level, value_t val);
538 int (*get_level)(ROT *rot, setting_t level, value_t *val);
539
540 int (*set_func)(ROT *rot, setting_t func, int status);
541 int (*get_func)(ROT *rot, setting_t func, int *status);
542
543 int (*set_parm)(ROT *rot, setting_t parm, value_t val);
544 int (*get_parm)(ROT *rot, setting_t parm, value_t *val);
545
546 int (*set_ext_level)(ROT *rot, hamlib_token_t token, value_t val);
547 int (*get_ext_level)(ROT *rot, hamlib_token_t token, value_t *val);
548
549 int (*set_ext_func)(ROT *rot, hamlib_token_t token, int status);
550 int (*get_ext_func)(ROT *rot, hamlib_token_t token, int *status);
551
552 int (*set_ext_parm)(ROT *rot, hamlib_token_t token, value_t val);
553 int (*get_ext_parm)(ROT *rot, hamlib_token_t token, value_t *val);
554
556
557 const char *macro_name;
558 int (*get_conf2)(ROT *rot, hamlib_token_t token, char *val, int val_len);
559};
560
566#define ROT_MODEL(arg) .rot_model=arg,.macro_name=#arg
567
568//---Start cut here---
569// Rotator state definition moved to include/hamlib/rot_state.h
570// Temporary include until 5.0
571#ifndef NO_OLD_INCLUDES
572
573__END_DECLS
574
575#include <hamlib/rot_state.h>
576
577__BEGIN_DECLS
578
579#endif
580//---End cut here---
591struct s_rot {
592 struct rot_caps *caps;
594};
595
596
598/* --------------- API function prototypes -----------------*/
599
600extern HAMLIB_EXPORT(ROT *)
601rot_init HAMLIB_PARAMS((rot_model_t rot_model));
602
603extern HAMLIB_EXPORT(int)
604rot_open HAMLIB_PARAMS((ROT *rot));
605
606extern HAMLIB_EXPORT(int)
607rot_close HAMLIB_PARAMS((ROT *rot));
608
609extern HAMLIB_EXPORT(int)
610rot_cleanup HAMLIB_PARAMS((ROT *rot));
611
612extern HAMLIB_EXPORT(int)
613rot_set_conf HAMLIB_PARAMS((ROT *rot,
614 hamlib_token_t token,
615 const char *val));
616HL_DEPRECATED extern HAMLIB_EXPORT(int)
617rot_get_conf HAMLIB_PARAMS((ROT *rot,
618 hamlib_token_t token,
619 char *val));
620
621extern HAMLIB_EXPORT(int)
622rot_get_conf2 HAMLIB_PARAMS((ROT *rot,
623 hamlib_token_t token,
624 char *val,
625 int val_len));
626
627/*
628 * General API commands, from most primitive to least.. )
629 * List Set/Get functions pairs
630 */
631extern HAMLIB_EXPORT(int)
632rot_set_position HAMLIB_PARAMS((ROT *rot,
633 azimuth_t azimuth,
634 elevation_t elevation));
635extern HAMLIB_EXPORT(int)
636rot_get_position HAMLIB_PARAMS((ROT *rot,
637 azimuth_t *azimuth,
638 elevation_t *elevation));
639
640extern HAMLIB_EXPORT(int)
641rot_stop HAMLIB_PARAMS((ROT *rot));
642
643extern HAMLIB_EXPORT(int)
644rot_park HAMLIB_PARAMS((ROT *rot));
645
646extern HAMLIB_EXPORT(int)
647rot_reset HAMLIB_PARAMS((ROT *rot,
648 rot_reset_t reset));
649
650extern HAMLIB_EXPORT(int)
651rot_move HAMLIB_PARAMS((ROT *rot,
652 int direction,
653 int speed));
654
655extern HAMLIB_EXPORT(setting_t)
656rot_has_get_level HAMLIB_PARAMS((ROT *rot,
657 setting_t level));
658extern HAMLIB_EXPORT(setting_t)
659rot_has_set_level HAMLIB_PARAMS((ROT *rot,
660 setting_t level));
661
662extern HAMLIB_EXPORT(setting_t)
663rot_has_get_parm HAMLIB_PARAMS((ROT *rot,
664 setting_t parm));
665extern HAMLIB_EXPORT(setting_t)
666rot_has_set_parm HAMLIB_PARAMS((ROT *rot,
667 setting_t parm));
668
669extern HAMLIB_EXPORT(setting_t)
670rot_has_get_func HAMLIB_PARAMS((ROT *rot,
671 setting_t func));
672extern HAMLIB_EXPORT(setting_t)
673rot_has_set_func HAMLIB_PARAMS((ROT *rot,
674 setting_t func));
675
676extern HAMLIB_EXPORT(int)
677rot_set_func HAMLIB_PARAMS((ROT *rot,
678 setting_t func,
679 int status));
680extern HAMLIB_EXPORT(int)
681rot_get_func HAMLIB_PARAMS((ROT *rot,
682 setting_t func,
683 int *status));
684
685extern HAMLIB_EXPORT(int)
686rot_set_level HAMLIB_PARAMS((ROT *rig,
687 setting_t level,
688 value_t val));
689extern HAMLIB_EXPORT(int)
690rot_get_level HAMLIB_PARAMS((ROT *rig,
691 setting_t level,
692 value_t *val));
693
694extern HAMLIB_EXPORT(int)
695rot_set_parm HAMLIB_PARAMS((ROT *rig,
696 setting_t parm,
697 value_t val));
698extern HAMLIB_EXPORT(int)
699rot_get_parm HAMLIB_PARAMS((ROT *rig,
700 setting_t parm,
701 value_t *val));
702
703extern HAMLIB_EXPORT(int)
704rot_set_ext_level HAMLIB_PARAMS((ROT *rig,
705 hamlib_token_t token,
706 value_t val));
707extern HAMLIB_EXPORT(int)
708rot_get_ext_level HAMLIB_PARAMS((ROT *rig,
709 hamlib_token_t token,
710 value_t *val));
711
712extern HAMLIB_EXPORT(int)
713rot_set_ext_func HAMLIB_PARAMS((ROT *rig,
714 hamlib_token_t token,
715 int status));
716extern HAMLIB_EXPORT(int)
717rot_get_ext_func HAMLIB_PARAMS((ROT *rig,
718 hamlib_token_t token,
719 int *status));
720
721extern HAMLIB_EXPORT(int)
722rot_set_ext_parm HAMLIB_PARAMS((ROT *rig,
723 hamlib_token_t token,
724 value_t val));
725extern HAMLIB_EXPORT(int)
726rot_get_ext_parm HAMLIB_PARAMS((ROT *rig,
727 hamlib_token_t token,
728 value_t *val));
729
730extern HAMLIB_EXPORT(const char *)
731rot_get_info HAMLIB_PARAMS((ROT *rot));
732
733extern HAMLIB_EXPORT(int)
734rot_get_status HAMLIB_PARAMS((ROT *rot,
735 rot_status_t *status));
736
737extern HAMLIB_EXPORT(int)
738rot_register HAMLIB_PARAMS((const struct rot_caps *caps));
739
740extern HAMLIB_EXPORT(int)
741rot_unregister HAMLIB_PARAMS((rot_model_t rot_model));
742
743extern HAMLIB_EXPORT(int)
744rot_list_foreach HAMLIB_PARAMS((int (*cfunc)(const struct rot_caps *,
745 rig_ptr_t),
746 rig_ptr_t data));
747
748extern HAMLIB_EXPORT(int)
749rot_load_backend HAMLIB_PARAMS((const char *be_name));
750
751extern HAMLIB_EXPORT(int)
752rot_check_backend HAMLIB_PARAMS((rot_model_t rot_model));
753
754extern HAMLIB_EXPORT(int)
755rot_load_all_backends HAMLIB_PARAMS((void));
756
757extern HAMLIB_EXPORT(rot_model_t)
758rot_probe_all HAMLIB_PARAMS((hamlib_port_t *p));
759
760extern HAMLIB_EXPORT(int)
761rot_token_foreach HAMLIB_PARAMS((ROT *rot,
762 int (*cfunc)(const struct confparams *,
763 rig_ptr_t),
764 rig_ptr_t data));
765
766extern HAMLIB_EXPORT(const struct confparams *)
767rot_confparam_lookup HAMLIB_PARAMS((ROT *rot,
768 const char *name));
769
770extern HAMLIB_EXPORT(hamlib_token_t)
771rot_token_lookup HAMLIB_PARAMS((ROT *rot,
772 const char *name));
773
774extern HAMLIB_EXPORT(int)
775rot_ext_func_foreach HAMLIB_PARAMS((ROT *rot,
776 int (*cfunc)(ROT *,
777 const struct confparams *,
778 rig_ptr_t),
779 rig_ptr_t data));
780extern HAMLIB_EXPORT(int)
781rot_ext_level_foreach HAMLIB_PARAMS((ROT *rot,
782 int (*cfunc)(ROT *,
783 const struct confparams *,
784 rig_ptr_t),
785 rig_ptr_t data));
786extern HAMLIB_EXPORT(int)
787rot_ext_parm_foreach HAMLIB_PARAMS((ROT *rot,
788 int (*cfunc)(ROT *,
789 const struct confparams *,
790 rig_ptr_t),
791 rig_ptr_t data));
792
793extern HAMLIB_EXPORT(const struct confparams *)
794rot_ext_lookup HAMLIB_PARAMS((ROT *rot,
795 const char *name));
796
797extern HAMLIB_EXPORT(const struct confparams *)
798rot_ext_lookup_tok HAMLIB_PARAMS((ROT *rot,
799 hamlib_token_t token));
800extern HAMLIB_EXPORT(hamlib_token_t)
801rot_ext_token_lookup HAMLIB_PARAMS((ROT *rot,
802 const char *name));
803
804extern HAMLIB_EXPORT(const struct rot_caps *)
805rot_get_caps HAMLIB_PARAMS((rot_model_t rot_model));
806
807extern HAMLIB_EXPORT(int)
808qrb HAMLIB_PARAMS((double lon1,
809 double lat1,
810 double lon2,
811 double lat2,
812 double *distance,
813 double *azimuth));
814
815extern HAMLIB_EXPORT(double)
816distance_long_path HAMLIB_PARAMS((double distance));
817
818extern HAMLIB_EXPORT(double)
819azimuth_long_path HAMLIB_PARAMS((double azimuth));
820
821#if 0
822extern HAMLIB_EXPORT(int)
823longlat2locator HAMLIB_PARAMS((double longitude,
824 double latitude,
825 char *locator_res,
826 int pair_count));
827
828extern HAMLIB_EXPORT(int)
829locator2longlat HAMLIB_PARAMS((double *longitude,
830 double *latitude,
831 const char *locator));
832#endif
833
834extern HAMLIB_EXPORT(double)
835dms2dec HAMLIB_PARAMS((int degrees,
836 int minutes,
837 double seconds,
838 int sw));
839
840extern HAMLIB_EXPORT(int)
841dec2dms HAMLIB_PARAMS((double dec,
842 int *degrees,
843 int *minutes,
844 double *seconds,
845 int *sw));
846
847extern HAMLIB_EXPORT(int)
848dec2dmmm HAMLIB_PARAMS((double dec,
849 int *degrees,
850 double *minutes,
851 int *sw));
852
853extern HAMLIB_EXPORT(double)
854dmmm2dec HAMLIB_PARAMS((int degrees,
855 double minutes,
856 int sw));
857
858extern HAMLIB_EXPORT(setting_t) rot_parse_func(const char *s);
859extern HAMLIB_EXPORT(setting_t) rot_parse_level(const char *s);
860extern HAMLIB_EXPORT(setting_t) rot_parse_parm(const char *s);
861extern HAMLIB_EXPORT(const char *) rot_strfunc(setting_t);
862extern HAMLIB_EXPORT(const char *) rot_strlevel(setting_t);
863extern HAMLIB_EXPORT(const char *) rot_strparm(setting_t);
864extern HAMLIB_EXPORT(const char *) rot_strstatus(rot_status_t);
865
866extern HAMLIB_EXPORT(void *) rot_data_pointer(ROT *rot, rig_ptrx_t idx);
867
869
876#define rot_debug rig_debug
877
878__END_DECLS
879
880#endif /* _ROTATOR_H */
881
struct hamlib_port hamlib_port_t
Port definition.
const char * rot_strstatus(rot_status_t status)
Convert enum ROT_STATUS_... to a string.
Definition misc.c:2331
setting_t rot_parse_level(const char *s)
Convert alpha string to enum ROT_LEVEL_...
Definition misc.c:1126
const char * rot_strparm(setting_t parm)
Convert enum ROT_PARM_... to alpha string.
Definition misc.c:1386
const char * rot_strlevel(setting_t level)
Convert enum ROT_LEVEL_... to alpha string.
Definition misc.c:1212
const char * rot_strfunc(setting_t func)
Convert enum ROT_FUNC_... to alpha string.
Definition misc.c:920
setting_t rot_parse_func(const char *s)
Convert alpha string to enum ROT_FUNC_...
Definition misc.c:864
setting_t rot_parse_parm(const char *s)
Convert alpha string to ROT_PARM_...
Definition misc.c:1331
serial_parity_e
Serial parity.
Definition rig.h:359
long hamlib_token_t
configuration token
Definition rig.h:893
uint64_t setting_t
Setting bit mask.
Definition rig.h:1234
rig_port_e
Port type.
Definition rig.h:338
serial_handshake_e
Serial handshake.
Definition rig.h:371
#define RIG_SETTING_MAX
Maximum # of rig settings.
Definition rig.h:1240
struct gran gran_t
gran_t type
Definition rig.h:1771
rig_status_e
Development status of the backend.
Definition rig.h:443
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:1034
rot_status_t
Rotator status flags.
Definition rotator.h:324
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:396
int rot_get_parm(ROT *rot, setting_t parm, value_t *val)
Query the value of a requested rotator parameter.
Definition rot_settings.c:205
int rot_get_func(ROT *rot, setting_t func, int *status)
Query the status of functions of the rotator.
Definition rot_settings.c:513
int rot_set_parm(ROT *rot, setting_t parm, value_t val)
Set a rotator parameter to a given value.
Definition rot_settings.c:165
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:108
int rot_set_position(ROT *rot, azimuth_t azimuth, elevation_t elevation)
Set the azimuth and elevation of the rotator.
Definition rotator.c:751
int rot_set_func(ROT *rot, setting_t func, int status)
Activate or deactivate functions of a rotator.
Definition rot_settings.c:469
int rot_reset(ROT *rot, rot_reset_t reset)
Reset the rotator.
Definition rotator.c:958
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:1067
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:120
setting_t rot_has_get_level(ROT *rot, setting_t level)
Check which rotator level settings can be queried.
Definition rot_settings.c:247
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:76
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:556
setting_t rot_has_get_parm(ROT *rot, setting_t parm)
Check which rotator parameter settings can be queried.
Definition rot_settings.c:323
rot_level_e
Rotator Level Settings.
Definition rotator.h:364
int rot_park(ROT *rot)
Park the rotator.
Definition rotator.c:883
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:726
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:684
void * rot_data_pointer(ROT *rot, rig_ptrx_t idx)
Get the address of rotator data structure(s)
Definition rotator.c:1090
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:640
int rot_move(ROT *rot, int direction, int speed)
Move the rotator in the specified direction and speed.
Definition rotator.c:999
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:285
int rot_get_position(ROT *rot, azimuth_t *azimuth, elevation_t *elevation)
Query the azimuth and elevation of the rotator.
Definition rotator.c:823
int rot_cleanup(ROT *rot)
Release a ROT handle and free associated memory.
Definition rotator.c:695
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:764
float elevation_t
Type definition for elevation.
Definition rotator.h:74
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:596
rot_type_t
Rotator type flags for bitmasks.
Definition rotator.h:114
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:433
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:360
setting_t rot_has_get_func(ROT *rot, setting_t func)
Check which rotator functions can be queried.
Definition rot_settings.c:396
int rot_close(ROT *rot)
Close the communication channel to the rotator.
Definition rotator.c:606
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:921
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:85
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:368
ROT * rot_init(rot_model_t rot_model)
Allocate a new ROT handle.
Definition rotator.c:214
@ ROT_STATUS_OVERLAP_LEFT
Definition rotator.h:340
@ ROT_STATUS_NONE
Definition rotator.h:325
@ ROT_STATUS_LIMIT_LEFT
Definition rotator.h:336
@ ROT_STATUS_OVERLAP_UP
Definition rotator.h:338
@ ROT_STATUS_MOVING_EL
Definition rotator.h:331
@ ROT_STATUS_MOVING_RIGHT
Definition rotator.h:330
@ ROT_STATUS_MOVING_AZ
Definition rotator.h:328
@ ROT_STATUS_MOVING_LEFT
Definition rotator.h:329
@ ROT_STATUS_MOVING
Definition rotator.h:327
@ ROT_STATUS_OVERLAP_RIGHT
Definition rotator.h:341
@ ROT_STATUS_LIMIT_UP
Definition rotator.h:334
@ ROT_STATUS_MOVING_UP
Definition rotator.h:332
@ ROT_STATUS_OVERLAP_DOWN
Definition rotator.h:339
@ ROT_STATUS_LIMIT_DOWN
Definition rotator.h:335
@ ROT_STATUS_LIMIT_RIGHT
Definition rotator.h:337
@ ROT_STATUS_MOVING_DOWN
Definition rotator.h:333
@ ROT_STATUS_BUSY
Definition rotator.h:326
@ ROT_PARM_NONE
Definition rotator.h:397
@ ROT_LEVEL_NONE
Definition rotator.h:365
@ ROT_LEVEL_63
Definition rotator.h:367
@ ROT_LEVEL_SPEED
Definition rotator.h:366
@ ROT_FLAG_ELEVATION
Definition rotator.h:116
@ ROT_FLAG_AZIMUTH
Definition rotator.h:115
int rot_model_t
Convenience type definition for a rotator model.
Definition rotlist.h:834
int locator2longlat(double *longitude, double *latitude, const char *locator)
Convert QRA locator (Maidenhead grid square) to Longitude/Latitude.
Definition locator.c:450
double dmmm2dec(int degrees, double minutes, int sw)
Convert degrees decimal minutes (D M.MMM) notation to decimal degrees (D.DDD) angle.
Definition locator.c:236
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:544
double azimuth_long_path(double azimuth)
Calculate the long path bearing between two points.
Definition locator.c:758
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:618
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:296
double distance_long_path(double distance)
Calculate the long path distance between two points.
Definition locator.c:738
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:394
Hamlib rig data structures.
Hamlib rotator data structures.
Hamlib rotator model definitions.
Configuration parameter structure.
Definition rig.h:933
Rotator capability data structure.
Definition rotator.h:453
int(* get_func)(ROT *rot, setting_t func, int *status)
Definition rotator.h:541
azimuth_t min_az
Definition rotator.h:497
const char * macro_name
Definition rotator.h:557
setting_t has_set_parm
Definition rotator.h:481
rot_status_t has_status
Definition rotator.h:483
enum rig_port_e port_type
Definition rotator.h:462
enum serial_handshake_e serial_handshake
Definition rotator.h:469
int(* get_parm)(ROT *rot, setting_t parm, value_t *val)
Definition rotator.h:544
int(* get_conf2)(ROT *rot, hamlib_token_t token, char *val, int val_len)
Definition rotator.h:558
int serial_data_bits
Definition rotator.h:466
int(* rot_open)(ROT *rot)
Definition rotator.h:515
setting_t has_set_func
Definition rotator.h:477
int * ext_tokens
Definition rotator.h:491
int(* get_ext_parm)(ROT *rot, hamlib_token_t token, value_t *val)
Definition rotator.h:553
const struct confparams * extfuncs
Definition rotator.h:490
int(* get_conf)(ROT *rot, hamlib_token_t token, char *val)
Definition rotator.h:519
const char * copyright
Definition rotator.h:458
int(* park)(ROT *rot)
Definition rotator.h:530
enum serial_parity_e serial_parity
Definition rotator.h:468
const rig_ptr_t priv
Definition rotator.h:506
int(* rot_cleanup)(ROT *rot)
Definition rotator.h:514
rot_model_t rot_model
Definition rotator.h:454
int post_write_delay
Definition rotator.h:472
int serial_rate_min
Definition rotator.h:464
int write_delay
Definition rotator.h:471
int(* get_ext_level)(ROT *rot, hamlib_token_t token, value_t *val)
Definition rotator.h:547
int(* set_ext_func)(ROT *rot, hamlib_token_t token, int status)
Definition rotator.h:549
setting_t has_get_level
Definition rotator.h:478
int(* get_status)(ROT *rot, rot_status_t *status)
Definition rotator.h:555
int serial_stop_bits
Definition rotator.h:467
int(* set_conf)(ROT *rot, hamlib_token_t token, const char *val)
Definition rotator.h:518
int(* set_ext_level)(ROT *rot, hamlib_token_t token, value_t val)
Definition rotator.h:546
int(* set_position)(ROT *rot, azimuth_t azimuth, elevation_t elevation)
Definition rotator.h:526
const char * version
Definition rotator.h:457
setting_t has_set_level
Definition rotator.h:479
elevation_t min_el
Definition rotator.h:500
int(* move)(ROT *rot, int direction, int speed)
Definition rotator.h:532
gran_t parm_gran[64]
Definition rotator.h:486
int retry
Definition rotator.h:474
int timeout
Definition rotator.h:473
enum rig_status_e status
Definition rotator.h:459
int(* get_level)(ROT *rot, setting_t level, value_t *val)
Definition rotator.h:538
int serial_rate_max
Definition rotator.h:465
int rot_type
Definition rotator.h:461
const char * mfg_name
Definition rotator.h:456
setting_t has_get_parm
Definition rotator.h:480
int(* get_position)(ROT *rot, azimuth_t *azimuth, elevation_t *elevation)
Definition rotator.h:527
setting_t has_get_func
Definition rotator.h:476
int(* reset)(ROT *rot, rot_reset_t reset)
Definition rotator.h:531
int(* rot_init)(ROT *rot)
Definition rotator.h:513
int(* rot_close)(ROT *rot)
Definition rotator.h:516
const struct confparams * extparms
Definition rotator.h:488
elevation_t max_el
Definition rotator.h:502
int(* set_parm)(ROT *rot, setting_t parm, value_t val)
Definition rotator.h:543
int(* set_ext_parm)(ROT *rot, hamlib_token_t token, value_t val)
Definition rotator.h:552
const struct confparams * extlevels
Definition rotator.h:489
azimuth_t max_az
Definition rotator.h:498
const struct confparams * cfgparams
Definition rotator.h:505
int(* get_ext_func)(ROT *rot, hamlib_token_t token, int *status)
Definition rotator.h:550
const char * model_name
Definition rotator.h:455
gran_t level_gran[64]
Definition rotator.h:485
int(* set_level)(ROT *rot, setting_t level, value_t val)
Definition rotator.h:537
int(* stop)(ROT *rot)
Definition rotator.h:529
int(* set_func)(ROT *rot, setting_t func, int status)
Definition rotator.h:540
Rotator state structure.
Definition rot_state.h:54
Master rotator structure.
Definition rotator.h:591
struct rot_state state
Definition rotator.h:593
struct rot_caps * caps
Definition rotator.h:592
Universal approach for passing values.
Definition rig.h:1058