int ft991_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode, pbwidth_t tx_width) { struct newcat_priv_data *priv; struct rig_state *state; int err; char restore_commands[NEWCAT_DATA_LEN]; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); if (!rig) return -RIG_EINVAL; state = &rig->state; rig_debug(RIG_DEBUG_TRACE, "%s: passed vfo = 0x%02x\n", __func__, vfo); rig_debug(RIG_DEBUG_TRACE, "%s: passed mode = %i\n", __func__, tx_mode); rig_debug(RIG_DEBUG_TRACE, "%s: passed width = %li Hz\n", __func__, tx_width); priv = (struct newcat_priv_data *)state->priv; /* append VFO A mode restore command first as we want to minimize any Rx glitches */ snprintf(priv->cmd_str, sizeof(priv->cmd_str), "MD0;"); rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s\n", priv->cmd_str); if (RIG_OK != (err = newcat_get_cmd (rig))) { return err; } snprintf(restore_commands, sizeof(restore_commands), "AB;%.*s",(int)sizeof(restore_commands)-4,priv->ret_data); /* append VFO B frequency restore command */ snprintf(priv->cmd_str, sizeof(priv->cmd_str), "FB;"); rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s\n", priv->cmd_str); if (RIG_OK != (err = newcat_get_cmd (rig))) { return err; } strncpy(restore_commands, priv->ret_data, NEWCAT_DATA_LEN); /* Change mode on VFOA */ if (RIG_OK != (err = newcat_set_mode (rig, RIG_VFO_A, tx_mode, RIG_PASSBAND_NOCHANGE))) { return err; } /* Send the copy VFO A to VFO B and restore commands */ snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s", restore_commands); return newcat_set_cmd (rig); }
int ft991_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { struct newcat_priv_data *priv; int err; // FT991 can't set VFOB mode directly so we always set VFOA // We will always make VFOB match VFOA mode newcat_set_mode(rig, RIG_VFO_A, mode, width); priv = (struct newcat_priv_data *)rig->state.priv; // Copy A to B snprintf(priv->cmd_str, sizeof(priv->cmd_str), "AB;"); if (RIG_OK != (err = newcat_get_cmd (rig))) return err; return RIG_OK; }
int ft991_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode, pbwidth_t tx_width) { struct newcat_priv_data *priv; struct rig_state *state; int err; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); if (!rig) return -RIG_EINVAL; state = &rig->state; rig_debug(RIG_DEBUG_TRACE, "%s: passed vfo = 0x%02x\n", __func__, vfo); rig_debug(RIG_DEBUG_TRACE, "%s: passed mode = %i\n", __func__, tx_mode); rig_debug(RIG_DEBUG_TRACE, "%s: passed width = %li Hz\n", __func__, tx_width); priv = (struct newcat_priv_data *)rig->state.priv; // Change mode on VFOA and make VFOB match VFOA if (RIG_OK != (err = newcat_set_mode(rig,RIG_VFO_A,tx_mode,tx_width))) { return err; } // Copy A to B snprintf(priv->cmd_str, sizeof(priv->cmd_str), "AB;"); if (RIG_OK != (err = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str)))) { rig_debug(RIG_DEBUG_VERBOSE, "%s:%d write_block err = %d\n", __func__, __LINE__, err); return err; } #if 0 if (RIG_OK != (err = newcat_get_cmd (rig))) return err; #endif return RIG_OK; }