Logo Search packages:      
Sourcecode: hamlib version File versions

int HAMLIB_API rot_set_position ( ROT rot,
azimuth_t  azimuth,
elevation_t  elevation 

set the azimuth and elevation of the rotator

rot The rot handle
azimuth The azimuth to set to
elevation The elevation to set to
Sets the azimuth and elevation of the rotator.

RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:

Definition at line 508 of file rotator.c.

References rot::caps, rot_state::max_az, rot_state::max_el, rot_state::min_az, rot_state::min_el, rot_caps::set_position, and rot::state.

      const struct rot_caps *caps;
      const struct rot_state *rs;

      if (CHECK_ROT_ARG(rot))
            return -RIG_EINVAL;

      caps = rot->caps;
      rs = &rot->state;

      if (azimuth < rs->min_az || azimuth > rs->max_az ||
                  elevation < rs->min_el || elevation > rs->max_el)
            return -RIG_EINVAL;

      if (caps->set_position == NULL)
            return -RIG_ENAVAIL;

      return caps->set_position(rot, azimuth, elevation);

Generated by  Doxygen 1.6.0   Back to index