Example #1
0
int ft847_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) {

  struct ft847_priv_data *p = (struct ft847_priv_data *) rig->state.priv;
  int n;

  if (rig->caps->rig_model == RIG_MODEL_FT847UNI) {
    struct ft847_priv_data *priv = (struct ft847_priv_data*)rig->state.priv;
    *ptt = priv->ptt;
    return RIG_OK;
  }

  n = ft847_get_status(rig, FT_847_NATIVE_CAT_GET_TX_STATUS);
  if (n < 0)
    return n;

  *ptt = (p->tx_status & 0x80) ? RIG_PTT_OFF : RIG_PTT_ON;

  /* The CAT query above lies when PTT is asserted via the PTT pin on
     the rear PACKET socket, it always returns Rx status. Given that
     CAT PTT does not take audio from DATA IN on the rear PACKET
     socket DTR or RTS PTT on the rear PACKET PTT pin is likely. So we
     override if we know PTT was asserted via rig_set_ptt for any type
     of PTT */
  if (RIG_PTT_OFF == *ptt && rig->state.transmit) *ptt = RIG_PTT_ON;

  return RIG_OK;
}
Example #2
0
File: ft847.c Project: dh1tw/hamlib
int ft847_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd) {

  struct ft847_priv_data *p = (struct ft847_priv_data *) rig->state.priv;
  int n;


  n = ft847_get_status(rig, FT_847_NATIVE_CAT_GET_RX_STATUS);
  if (n < 0)
    return n;

  *dcd = (p->rx_status & 0x80) ? RIG_DCD_OFF : RIG_DCD_ON;

  return RIG_OK;
}
Example #3
0
File: ft847.c Project: dh1tw/hamlib
int ft847_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) {

  struct ft847_priv_data *p = (struct ft847_priv_data *) rig->state.priv;
  int n;


  n = ft847_get_status(rig, FT_847_NATIVE_CAT_GET_TX_STATUS);
  if (n < 0)
    return n;

  *ptt = (p->tx_status & 0x80) ? RIG_PTT_OFF : RIG_PTT_ON;

  return RIG_OK;
}
Example #4
0
File: ft847.c Project: dh1tw/hamlib
/*
 * Get the PO/ALC Meter Data
 */
static int ft847_get_alc_level(RIG *rig, value_t *val)
{
  struct ft847_priv_data *p = (struct ft847_priv_data *) rig->state.priv;
  int n;

  n = ft847_get_status(rig, FT_847_NATIVE_CAT_GET_TX_STATUS);
  if (n < 0)
    return n;

  n = (p->tx_status & 0x1F);

  val->f = (float)n / 0x1F;

  return RIG_OK;
}
Example #5
0
File: ft847.c Project: dh1tw/hamlib
/*
 * Get the 'raw' signal strength
 * This number corresponds to the number of 'dots' in
 * the FT-847 display
 */
static int ft847_get_rawstr_level(RIG *rig, value_t *val)
{
  struct ft847_priv_data *p = (struct ft847_priv_data *) rig->state.priv;
  int n;


  n = ft847_get_status(rig, FT_847_NATIVE_CAT_GET_RX_STATUS);
  if (n < 0)
    return n;

  n = (p->rx_status & 0x1F);

  val->i = n;

  return RIG_OK;
}
Example #6
0
int ft847_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd) {

  struct ft847_priv_data *p = (struct ft847_priv_data *) rig->state.priv;
  int n;

  if (rig->caps->rig_model == RIG_MODEL_FT847UNI)
    return -RIG_ENIMPL;

  n = ft847_get_status(rig, FT_847_NATIVE_CAT_GET_RX_STATUS);
  if (n < 0)
    return n;

  *dcd = (p->rx_status & 0x80) ? RIG_DCD_OFF : RIG_DCD_ON;

  return RIG_OK;
}
Example #7
0
/*
 * Get the 'raw' signal strength
 * This number corresponds to the number of 'dots' in
 * the FT-847 display
 */
static int ft847_get_rawstr_level(RIG *rig, value_t *val)
{
  struct ft847_priv_data *p = (struct ft847_priv_data *) rig->state.priv;
  int n;

  if (rig->caps->rig_model == RIG_MODEL_FT847UNI)
    return -RIG_ENIMPL;

  n = ft847_get_status(rig, FT_847_NATIVE_CAT_GET_RX_STATUS);
  if (n < 0)
    return n;

  n = (p->rx_status & 0x1F);

  val->i = n;

  return RIG_OK;
}