示例#1
0
文件: ft817.c 项目: GomSpace/hamlib
int ft817_set_dcs_code(RIG *rig, vfo_t vfo, tone_t code)
{
    unsigned char data[YAESU_CMD_LENGTH - 1];
    /* 	int n; */

    if (vfo != RIG_VFO_CURR)
        return -RIG_ENTARGET;

    rig_debug(RIG_DEBUG_VERBOSE, "ft817: set DCS code (%d)\n", code);

    if (code == 0)
        return ft817_send_cmd(rig, FT817_NATIVE_CAT_SET_CTCSS_DCS_OFF);

    /* fill in the DCS code - the rig doesn't support separate codes... */
    to_bcd_be(data,     code, 4);
    to_bcd_be(data + 2, code, 4);


    /* FT-817 does not have the DCS_ENC_ON command, so we just set the tone here */

    /* 	if ((n = ft817_send_icmd(rig, FT817_NATIVE_CAT_SET_DCS_CODE, data)) < 0) */
    /* 		return n; */

    /* 	return ft817_send_cmd(rig, FT817_NATIVE_CAT_SET_DCS_ENC_ON); */

    return ft817_send_icmd(rig, FT817_NATIVE_CAT_SET_DCS_CODE, data);
}
示例#2
0
文件: ft817.c 项目: GomSpace/hamlib
int ft817_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
{
    unsigned char data[YAESU_CMD_LENGTH - 1];
    int n;

    if (vfo != RIG_VFO_CURR)
        return -RIG_ENTARGET;

    rig_debug(RIG_DEBUG_VERBOSE, "ft817: set rit = %li)\n", rit);

    /* fill in the RIT freq */
    data[0] = (rit < 0) ? 255 : 0;
    data[1] = 0;
    to_bcd_be(data + 2, labs(rit) / 10, 4);

    if ((n = ft817_send_icmd(rig, FT817_NATIVE_CAT_SET_CLAR_FREQ, data)) < 0)
        return n;

    /* the rig rejects if these are repeated - don't confuse user with retcode */
    if (rit == 0)
        ft817_send_cmd(rig, FT817_NATIVE_CAT_CLAR_OFF);
    else
        ft817_send_cmd(rig, FT817_NATIVE_CAT_CLAR_ON);

    return RIG_OK;
}
示例#3
0
文件: ft817.c 项目: GomSpace/hamlib
int ft817_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs)
{
    unsigned char data[YAESU_CMD_LENGTH - 1];

    if (vfo != RIG_VFO_CURR)
        return -RIG_ENTARGET;

    rig_debug(RIG_DEBUG_VERBOSE, "ft817: set repeter offs = %li\n", offs);

    /* fill in the offset freq */
    to_bcd_be(data, offs / 10, 8);

    return ft817_send_icmd(rig, FT817_NATIVE_CAT_SET_RPT_OFFSET, data);
}
示例#4
0
int ft817_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
{
	unsigned char data[YAESU_CMD_LENGTH - 1];

	if (vfo != RIG_VFO_CURR)
		return -RIG_ENTARGET;

	rig_debug(RIG_DEBUG_VERBOSE,"ft817: requested freq = %"PRIfreq" Hz\n", freq);

	/* fill in the frequency */
	to_bcd_be(data, (freq + 5) / 10, 8);

	return ft817_send_icmd(rig, FT817_NATIVE_CAT_SET_FREQ, data);
}
示例#5
0
文件: ft817.c 项目: GomSpace/hamlib
int ft817_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
{
    unsigned char data[YAESU_CMD_LENGTH - 1];

    if (vfo != RIG_VFO_CURR)
        return -RIG_ENTARGET;

    rig_debug(RIG_DEBUG_VERBOSE,"ft817: requested freq = %"PRIfreq" Hz\n", freq);

    /* fill in the frequency */
    to_bcd_be(data, (freq + 5) / 10, 8);

    rig_force_cache_timeout(
        &((struct ft817_priv_data *)rig->state.priv)->fm_status_tv);

    return ft817_send_icmd(rig, FT817_NATIVE_CAT_SET_FREQ, data);
}
示例#6
0
文件: ft817.c 项目: GomSpace/hamlib
int ft817_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone)
{
    unsigned char data[YAESU_CMD_LENGTH - 1];
    int n;

    if (vfo != RIG_VFO_CURR)
        return -RIG_ENTARGET;

    rig_debug(RIG_DEBUG_VERBOSE, "ft817: set CTCSS sql (%.1f)\n", tone / 10.0);

    if (tone == 0)
        return ft817_send_cmd(rig, FT817_NATIVE_CAT_SET_CTCSS_DCS_OFF);

    /* fill in the CTCSS freq - the rig doesn't support separate tones... */
    to_bcd_be(data,     tone, 4);
    to_bcd_be(data + 2, tone, 4);

    if ((n = ft817_send_icmd(rig, FT817_NATIVE_CAT_SET_CTCSS_FREQ, data)) < 0)
        return n;

    return ft817_send_cmd(rig, FT817_NATIVE_CAT_SET_CTCSS_ON);
}
示例#7
0
文件: ft817.c 项目: GomSpace/hamlib
int ft817_set_dcs_sql (RIG *rig, vfo_t vfo, tone_t code)
{
    unsigned char data[YAESU_CMD_LENGTH - 1];
    int n;

    if (vfo != RIG_VFO_CURR)
        return -RIG_ENTARGET;

    rig_debug(RIG_DEBUG_VERBOSE, "ft817: set DCS sql (%d)\n", code);

    if (code == 0)
        return ft817_send_cmd(rig, FT817_NATIVE_CAT_SET_CTCSS_DCS_OFF);

    /* fill in the DCS code - the rig doesn't support separate codes... */
    to_bcd_be(data,     code, 4);
    to_bcd_be(data + 2, code, 4);

    if ((n = ft817_send_icmd(rig, FT817_NATIVE_CAT_SET_DCS_CODE, data)) < 0)
        return n;

    return ft817_send_cmd(rig, FT817_NATIVE_CAT_SET_DCS_ON);
}