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

static int tt565_get_ant ( RIG rig,
vfo_t  vfo,
ant_t ant 
)

Find what antenna is "attached" to our vfo.

Parameters:
rig!= NULL
vfo
antreceives antenna identifier
Returns:
RIG_OK or < 0
See also:
tt565_set_ant

Definition at line 1792 of file orion.c.

References EOM, rig_debug(), RIG_DEBUG_ERR, RIG_EPROTO, RIG_OK, tt565_transaction(), and which_receiver().

{
                char respbuf[TT565_BUFSIZE];
                int resp_len, retval;

            resp_len = sizeof(respbuf);
                retval = tt565_transaction(rig, "?KA" EOM, 4, respbuf, &resp_len); 
                if (retval != RIG_OK)
                                return retval;
            if (respbuf[1] != 'K' || respbuf[2] != 'A' || resp_len != 7) {
                  rig_debug(RIG_DEBUG_ERR,"%s; tt565_get_ant: NG %s\n", 
                        __FUNCTION__, respbuf);
                  return -RIG_EPROTO;
            }
            /* Look for first occurrence of M or S in ant 1, 2, 3 characters */
            if (respbuf[3] == which_receiver(rig,vfo) || respbuf[3] == 'B' ) {
                  *ant = RIG_ANT_1;
                  return RIG_OK;
            }
            if (respbuf[4] == which_receiver(rig,vfo) || respbuf[4] == 'B' ) {
                  *ant = RIG_ANT_2;
                  return RIG_OK;
            } 

                *ant = RIG_ANT_NONE;      /* ignore possible RIG_ANT_3 = rx only ant */
                return RIG_OK;
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index