first implementation of kenwood_get_ptt

git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@962 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.1.3
Joop Stakenborg, PG4I 2002-02-18 18:26:08 +00:00
rodzic 74ba433844
commit f46fc05f68
2 zmienionych plików z 27 dodań i 3 usunięć

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib Kenwood backend - main file
* Copyright (c) 2000,2001,2002 by Stephane Fillod
*
* $Id: kenwood.c,v 1.30 2002-01-24 23:36:54 fillods Exp $
* $Id: kenwood.c,v 1.31 2002-02-18 18:25:42 pa4tu 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
@ -788,10 +788,33 @@ int kenwood_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone)
return RIG_OK;
}
/*
* kenwood_get_ptt
* Assumes rig!=NULL, ptt!=NULL
*/
int kenwood_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
{
unsigned char infobuf[50];
int info_len, retval;
retval = kenwood_transaction (rig, "IF;", 3, infobuf, &info_len);
if (retval != RIG_OK)
return retval;
if (info_len != 38) {
rig_debug(RIG_DEBUG_ERR,"kenwood_get_ptt: wrong answer len=%d\n",
info_len);
return -RIG_ERJCTED;
}
*ptt = infobuf[28] == '0' ? RIG_PTT_OFF : RIG_PTT_ON;
return RIG_OK;
}
/*
* kenwood_set_ptt
* Assumes rig!=NULL
* TODO: kenwood_get_ptt reading P8 field returned by IF;
*/
int kenwood_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
{

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib Kenwood backend - main header
* Copyright (c) 2000,2001,2002 by Stephane Fillod
*
* $Id: kenwood.h,v 1.18 2002-01-24 23:36:54 fillods Exp $
* $Id: kenwood.h,v 1.19 2002-02-18 18:26:08 pa4tu 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
@ -60,6 +60,7 @@ int kenwood_set_powerstat(RIG *rig, powerstat_t status);
int kenwood_get_powerstat(RIG *rig, powerstat_t *status);
int kenwood_reset(RIG *rig, reset_t reset);
int kenwood_send_morse(RIG *rig, vfo_t vfo, const char *msg);
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_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd);
int kenwood_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);