COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
gs232b_lib.h
Go to the documentation of this file.
1 /********************************************************************
2 * Copyright (C) 2015 by Interstel Technologies, Inc.
3 * and Hawaii Space Flight Laboratory.
4 *
5 * This file is part of the COSMOS/core that is the central
6 * module for COSMOS. For more information on COSMOS go to
7 * <http://cosmos-project.com>
8 *
9 * The COSMOS/core software is licenced under the
10 * GNU Lesser General Public License (LGPL) version 3 licence.
11 *
12 * You should have received a copy of the
13 * GNU Lesser General Public License
14 * If not, go to <http://www.gnu.org/licenses/>
15 *
16 * COSMOS/core is free software: you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public License
18 * as published by the Free Software Foundation, either version 3 of
19 * the License, or (at your option) any later version.
20 *
21 * COSMOS/core is distributed in the hope that it will be useful, but
22 * WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
25 *
26 * Refer to the "licences" folder for further information on the
27 * condititons and terms to use this software.
28 ********************************************************************/
29 
37 #ifndef _GS232BLIB_H
38 #define _GS232BLIB_H 1
39 
40 #include "support/configCosmos.h"
41 
42 #include "math/mathlib.h"
43 #include "support/cosmos-errno.h"
45 
46 #include <stdio.h>
47 
48 #define GS232B_ID 1
49 #define GS232B_BAUD 9600
50 #define GS232B_BITS 8
51 #define GS232B_PARITY 0
52 #define GS232B_STOPBITS 1
53 
54 #define GS_STATE_STOWED 0
55 #define GS_STATE_FIXED 1
56 #define GS_STATE_SEEKING 2
57 #define GS_STATE_TRACKING 3
58 
65  {
66  int32_t az_center;
67  int32_t az_mode;
69  float az_offset;
70  float currentaz;
71  float targetaz;
73  float el_offset;
74  float currentel;
75  float targetel;
76  float sensitivity;
77  int32_t in_command;
78  int32_t data_received;
79  } ;
80 
81 int32_t gs232b_connect(string dev);
82 int32_t gs232b_disconnect();
83 int32_t gs232b_calibrate_offset(int32_t axis);
84 //void gs232b_full_scale_calibration(int32_t axis);
85 //void gs232b_rotate(int32_t axis, int32_t direction);
86 float gs232b_get_az();
87 float gs232b_get_el();
88 int32_t gs232b_get_az_el(float &az, float &el);
89 float gs232b_get_az_offset();
90 float gs232b_get_el_offset();
91 void gs232b_get_state(gs232b_state &state);
92 int32_t gs232b_goto(float az, float el);
93 int32_t gs232b_stop();
94 int32_t gs232b_az_speed(int32_t speed);
95 int32_t gs232b_getdata(char *buf, int32_t buflen);
96 int32_t gs232b_send(char *buf, bool force);
97 int32_t gs232b_test();
98 int32_t gs232b_set_sensitivity(float sensitivity);
99 
100 #endif
float gs232b_get_el_offset()
Definition: gs232b_lib.cpp:363
int32_t gs232b_getdata(char *buf, int32_t buflen)
Definition: gs232b_lib.cpp:124
float gs232b_get_az_offset()
Definition: gs232b_lib.cpp:358
int32_t gs232b_get_az_el(float &az, float &el)
Definition: gs232b_lib.cpp:338
int32_t gs232b_disconnect()
Definition: gs232b_lib.cpp:108
float targetaz
Definition: gs232b_lib.h:71
Simple Serial library header file.
int32_t gs232b_az_speed(int32_t speed)
Definition: gs232b_lib.cpp:205
float gs232b_get_el()
Definition: gs232b_lib.cpp:328
int32_t gs232b_connect(string dev)
Definition: gs232b_lib.cpp:54
int32_t in_command
Definition: gs232b_lib.h:77
int32_t gs232b_calibrate_offset(int32_t axis)
int32_t gs232b_stop()
Definition: gs232b_lib.cpp:309
float el_offset
Definition: gs232b_lib.h:73
int32_t az_offset_waiting
Definition: gs232b_lib.h:68
Headers and definitions common to all COSMOS.
int32_t el_offset_waiting
Definition: gs232b_lib.h:72
COSMOS Error Codes.
float currentel
Definition: gs232b_lib.h:74
float gs232b_get_az()
Definition: gs232b_lib.cpp:318
mathlib include file
GS-232B state.
Definition: gs232b_lib.h:64
float targetel
Definition: gs232b_lib.h:75
int32_t gs232b_send(char *buf, bool force)
Definition: gs232b_lib.cpp:397
int32_t data_received
Definition: gs232b_lib.h:78
float speed
Definition: netperf_send.cpp:40
int32_t az_center
Definition: gs232b_lib.h:66
int32_t gs232b_test()
Definition: gs232b_lib.cpp:373
char buf[128]
Definition: rw_test.cpp:40
float sensitivity
Definition: gs232b_lib.h:76
int32_t az_mode
Definition: gs232b_lib.h:67
float currentaz
Definition: gs232b_lib.h:70
float az_offset
Definition: gs232b_lib.h:69
int32_t gs232b_goto(float az, float el)
Definition: gs232b_lib.cpp:224
void gs232b_get_state(gs232b_state &state)
Definition: gs232b_lib.cpp:368
int32_t gs232b_set_sensitivity(float sensitivity)
Definition: gs232b_lib.cpp:417