kopia lustrzana https://github.com/Hamlib/Hamlib
Expanded ROT_TYPE definitions in rotator.h
Set dummy rotor to ROT_TYPE_AZEL Set rotorez rotor type to ROT_TYPE_AZ and added get_info() git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2830 7ae35d74-ebe9-4afe-98af-79ac388436b8Hamlib-1.2.11
rodzic
6763e8e750
commit
786e53ce50
|
@ -214,6 +214,7 @@ static int dummy_rot_move(ROT *rot, int direction, int speed)
|
|||
struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)rot->state.priv;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: Direction = %d, Speed = %d\n", __func__, direction, speed);
|
||||
|
||||
switch(direction) {
|
||||
case ROT_MOVE_UP:
|
||||
|
@ -255,7 +256,7 @@ const struct rot_caps dummy_rot_caps = {
|
|||
.version = "0.2",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_BETA,
|
||||
.rot_type = ROT_TYPE_OTHER,
|
||||
.rot_type = ROT_TYPE_AZEL,
|
||||
.port_type = RIG_PORT_NONE,
|
||||
|
||||
.min_az = -180.,
|
||||
|
|
|
@ -90,16 +90,18 @@ typedef float azimuth_t;
|
|||
typedef int rot_reset_t;
|
||||
|
||||
|
||||
/*! \def ROT_FLAG_AZIMUTH
|
||||
* \brief A macro that returns the azimuth flag.
|
||||
*/
|
||||
/*! \def ROT_FLAG_ELEVATION
|
||||
* \brief A macro that returns the elevation flag.
|
||||
*/
|
||||
#define ROT_FLAG_AZIMUTH (1<<1)
|
||||
#define ROT_FLAG_ELEVATION (1<<2)
|
||||
/** \brief Rotator type flags */
|
||||
typedef enum {
|
||||
ROT_FLAG_AZIMUTH = (1<<1), /*!< Azimuth */
|
||||
ROT_FLAG_ELEVATION = (1<<2) /*!< Elevation */
|
||||
} rot_type_t;
|
||||
|
||||
#define ROT_TYPE_OTHER 0
|
||||
#define ROT_TYPE_MASK (ROT_FLAG_AZIMUTH|ROT_FLAG_ELEVATION)
|
||||
|
||||
#define ROT_TYPE_OTHER 0
|
||||
#define ROT_TYPE_AZIMUTH ROT_FLAG_AZIMUTH
|
||||
#define ROT_TYPE_ELEVATION ROT_FLAG_ELEVATION
|
||||
#define ROT_TYPE_AZEL (ROT_FLAG_AZIMUTH|ROT_FLAG_ELEVATION)
|
||||
|
||||
|
||||
/*! \def ROT_MOVE_UP
|
||||
|
|
|
@ -87,7 +87,7 @@ static const struct confparams rotorez_cfg_params[] = {
|
|||
|
||||
/* *************************************
|
||||
*
|
||||
* Seperate model capabilities
|
||||
* Separate model capabilities
|
||||
*
|
||||
* *************************************
|
||||
*/
|
||||
|
@ -132,6 +132,7 @@ const struct rot_caps rotorez_rot_caps = {
|
|||
.get_position = rotorez_rot_get_position,
|
||||
.stop = rotorez_rot_stop,
|
||||
.set_conf = rotorez_rot_set_conf,
|
||||
.get_info = rotorez_rot_get_info,
|
||||
|
||||
};
|
||||
|
||||
|
@ -175,6 +176,8 @@ const struct rot_caps rotorcard_rot_caps = {
|
|||
.get_position = rotorez_rot_get_position,
|
||||
.stop = rotorez_rot_stop,
|
||||
.set_conf = rotorez_rot_set_conf,
|
||||
.get_info = rotorez_rot_get_info,
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
@ -213,6 +216,7 @@ const struct rot_caps dcu_rot_caps = {
|
|||
.rot_init = rotorez_rot_init,
|
||||
.rot_cleanup = rotorez_rot_cleanup,
|
||||
.set_position = rotorez_rot_set_position,
|
||||
.get_info = rotorez_rot_get_info,
|
||||
|
||||
};
|
||||
|
||||
|
@ -236,12 +240,12 @@ static int rotorez_rot_init(ROT *rot) {
|
|||
if (!rot)
|
||||
return -RIG_EINVAL;
|
||||
|
||||
priv = (struct rotorez_rot_priv_data*)
|
||||
priv = (struct rotorez_rot_priv_data *)
|
||||
malloc(sizeof(struct rotorez_rot_priv_data));
|
||||
|
||||
if (!priv)
|
||||
return -RIG_ENOMEM;
|
||||
rot->state.priv = (void*)priv;
|
||||
rot->state.priv = (void *)priv;
|
||||
|
||||
rot->state.rotport.type.rig = RIG_PORT_SERIAL;
|
||||
|
||||
|
@ -468,6 +472,25 @@ static int rotorez_rot_set_conf(ROT *rot, token_t token, const char *val) {
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get Info
|
||||
* returns the model name string
|
||||
*/
|
||||
static const char *rotorez_rot_get_info(ROT *rot)
|
||||
{
|
||||
const struct rot_caps *rc;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
if (!rot)
|
||||
return (const char *)-RIG_EINVAL;
|
||||
|
||||
rc = rot->caps;
|
||||
|
||||
return rc->model_name;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Send command string to rotor
|
||||
*/
|
||||
|
|
|
@ -64,5 +64,7 @@ static int rotorez_rot_stop(ROT *rot);
|
|||
|
||||
static int rotorez_rot_set_conf(ROT *rot, token_t token, const char *val);
|
||||
|
||||
static const char *rotorez_rot_get_info(ROT *rot);
|
||||
|
||||
#endif /* _ROT_ROTOREZ_H */
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue