check ptt status before set_ptt. enabled on ts850.

git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2627 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.2.9
Alessandro Zummo, IZ1PRB 2009-02-09 20:59:31 +00:00
rodzic 78197e7d4d
commit 4c46fb604b
3 zmienionych plików z 22 dodań i 5 usunięć

Wyświetl plik

@ -3,7 +3,7 @@
* Copyright (c) 2000-2009 by Stephane Fillod
* Copyright (C) 2009 Alessandro Zummo <a.zummo@towertech.it>
*
* $Id: kenwood.c,v 1.114 2009-02-09 20:37:48 azummo Exp $
* $Id: kenwood.c,v 1.115 2009-02-09 20:59:31 azummo Exp $
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
@ -1425,7 +1425,23 @@ int kenwood_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
int kenwood_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
{
return kenwood_simple_cmd(rig,
ptt == RIG_PTT_ON ? "TX" : "RX");
(ptt == RIG_PTT_ON) ? "TX" : "RX");
}
int kenwood_set_ptt_safe(RIG *rig, vfo_t vfo, ptt_t ptt)
{
int err;
ptt_t current_ptt;
err = kenwood_get_ptt(rig, vfo, &current_ptt);
if (err != RIG_OK)
return err;
if (current_ptt == ptt)
return RIG_OK;
return kenwood_simple_cmd(rig,
(ptt == RIG_PTT_ON) ? "TX" : "RX");
}

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib Kenwood backend - main header
* Copyright (c) 2000-2009 by Stephane Fillod
*
* $Id: kenwood.h,v 1.52 2009-02-06 14:15:12 azummo Exp $
* $Id: kenwood.h,v 1.53 2009-02-09 20:59:31 azummo Exp $
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
@ -113,6 +113,7 @@ int kenwood_set_ant_no_ack(RIG * rig, vfo_t vfo, ant_t ant);
int kenwood_get_ant (RIG * rig, vfo_t vfo, ant_t * ant);
int kenwood_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
int kenwood_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
int kenwood_set_ptt_safe(RIG *rig, vfo_t vfo, ptt_t ptt);
int kenwood_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd);
int kenwood_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
int kenwood_set_mem(RIG *rig, vfo_t vfo, int ch);

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib Kenwood backend - TS850 description
* Copyright (c) 2000-2004 by Stephane Fillod
*
* $Id: ts850.c,v 1.33 2009-02-06 14:15:12 azummo Exp $
* $Id: ts850.c,v 1.34 2009-02-09 20:59:31 azummo Exp $
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
@ -223,7 +223,7 @@ const struct rig_caps ts850_caps = {
.set_ctcss_tone = kenwood_set_ctcss_tone_tn,
.get_ctcss_tone = kenwood_get_ctcss_tone,
.get_ptt = kenwood_get_ptt,
.set_ptt = kenwood_set_ptt,
.set_ptt = kenwood_set_ptt_safe,
.set_func = kenwood_set_func,
.get_func = kenwood_get_func,
.set_level = kenwood_set_level,