Logo Search packages:      
Sourcecode: hamlib version File versions  Download package

int HAMLIB_API rot_cleanup ( ROT rot )

release a rot handle and free associated memory

Parameters:
rotThe ROT handle of the radio to be closed

Releases a rot struct which port has eventualy been closed already with rot_close().

Returns:
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:
rot_init(), rot_close()

Definition at line 443 of file rotator.c.

References rot::caps, rot_state::comm_state, RIG_DEBUG_VERBOSE, RIG_EINVAL, RIG_OK, rot_close(), rot_debug, and rot::state.

{
      rot_debug(RIG_DEBUG_VERBOSE,"rot:rot_cleanup called \n");

      if (!rot || !rot->caps)
            return -RIG_EINVAL;

      /*
       * check if they forgot to close the rot
       */
      if (rot->state.comm_state)
            rot_close(rot);

      /*
       * basically free up the priv struct 
       */
      if (rot->caps->rot_cleanup)
            rot->caps->rot_cleanup(rot);

      free(rot);

      return RIG_OK;
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index