From 02a90bf2cf93c3ce16a578bd3a3683abafe5591c Mon Sep 17 00:00:00 2001 From: Nate Bargmann Date: Sun, 21 Aug 2011 20:22:00 -0500 Subject: [PATCH] Update LGPL header in TenTec source files. TNX to Lucian Laga, YO6PLB, for the notification. --- tentec/argonaut.c | 21 +++--- tentec/jupiter.c | 35 +++++---- tentec/omnivii.c | 37 +++++----- tentec/orion.c | 178 +++++++++++++++++++++++----------------------- tentec/orion.h | 28 ++++---- tentec/paragon.c | 24 +++---- tentec/pegasus.c | 23 +++--- tentec/rx320.c | 31 ++++---- tentec/rx331.c | 35 ++++----- tentec/rx331.h | 19 ++--- tentec/rx340.c | 32 ++++----- tentec/rx350.c | 23 +++--- tentec/tentec.c | 41 ++++++----- tentec/tentec.h | 21 +++--- tentec/tentec2.c | 73 ++++++++++--------- tentec/tentec2.h | 19 +++-- tentec/tt550.c | 46 ++++++------ tentec/tt550.h | 21 +++--- 18 files changed, 350 insertions(+), 357 deletions(-) diff --git a/tentec/argonaut.c b/tentec/argonaut.c index 9e13ff791..f728f90f6 100644 --- a/tentec/argonaut.c +++ b/tentec/argonaut.c @@ -2,21 +2,20 @@ * Hamlib TenTenc backend - TT-516 PC-Radio description * Copyright (c) 2003-2008 by Stephane Fillod * - * $Id: argonaut.c,v 1.5 2008-10-25 15:27:58 fillods 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 - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -49,7 +48,7 @@ /* * tt516 receiver capabilities. * - * protocol is documented at + * protocol is documented at * http://www.rfsquared.com/ * */ diff --git a/tentec/jupiter.c b/tentec/jupiter.c index ad2622b04..980a4f88c 100644 --- a/tentec/jupiter.c +++ b/tentec/jupiter.c @@ -2,21 +2,20 @@ * Hamlib TenTenc backend - TT-538 description * Copyright (c) 2003-2005 by Stephane Fillod * - * $Id: jupiter.c,v 1.4 2006-10-07 17:38:05 csete 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 - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -59,7 +58,7 @@ struct tt538_priv_data { RIG_LEVEL_COMP|/*RIG_LEVEL_PREAMP|*/ \ RIG_LEVEL_SWR|RIG_LEVEL_ATT) -#define TT538_ANTS (RIG_ANT_1) +#define TT538_ANTS (RIG_ANT_1) #define TT538_PARMS (RIG_PARM_NONE) @@ -88,7 +87,7 @@ static int tt538_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); /* * tt538 transceiver capabilities. * - * Protocol is documented at + * Protocol is documented at * http://www.rfsquared.com/ * * Only set_freq is supposed to work. @@ -339,7 +338,7 @@ int tt538_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) { resp_len = 32; retval = tt538_transaction (rig, (char *) cmdbuf, cmd_len, (char *) respbuf, &resp_len); - if (retval != RIG_OK) + if (retval != RIG_OK) return retval; curVfo = which_vfo(rig, vfo); @@ -384,7 +383,7 @@ int tt538_set_freq(RIG *rig, vfo_t vfo, freq_t freq) which_vfo(rig, vfo), bytes[3], bytes[2], bytes[1], bytes[0]); - return tt538_transaction(rig, (char *) cmdbuf, cmd_len, NULL, NULL); + return tt538_transaction(rig, (char *) cmdbuf, cmd_len, NULL, NULL); } /* @@ -413,10 +412,10 @@ int tt538_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) switch (which_vfo(rig, vfo)) { case 'A': - ttmode = respbuf[1]; + ttmode = respbuf[1]; break; case 'B': - ttmode = respbuf[2]; + ttmode = respbuf[2]; break; default: rig_debug(RIG_DEBUG_ERR,"%s: unsupported VFO %s\n", @@ -577,7 +576,7 @@ int tt538_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else width = tt538_filter_number((int) width); - cmd_len = sprintf((char *) cmdbuf, "*W%c" EOM, (unsigned char) width); + cmd_len = sprintf((char *) cmdbuf, "*W%c" EOM, (unsigned char) width); return tt538_transaction (rig, (char *) cmdbuf, cmd_len, NULL, NULL); } @@ -818,7 +817,7 @@ printf("%f\n", sstr); default: - rig_debug(RIG_DEBUG_ERR,"%s: unsupported level %d\n", + rig_debug(RIG_DEBUG_ERR,"%s: unsupported level %d\n", __FUNCTION__, level); return -RIG_EINVAL; } diff --git a/tentec/omnivii.c b/tentec/omnivii.c index 066e7ceab..1069c9ffd 100644 --- a/tentec/omnivii.c +++ b/tentec/omnivii.c @@ -2,21 +2,20 @@ * Hamlib TenTenc backend - TT-588 description * Copyright (c) 2003-2009 by Stephane Fillod * - * $Id: omnivii.c,v 1.3 2009-01-12 19:29:30 fillods 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 - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -54,7 +53,7 @@ struct tt588_priv_data { RIG_LEVEL_COMP|/*RIG_LEVEL_PREAMP|*/ \ RIG_LEVEL_SWR|RIG_LEVEL_ATT) -#define TT588_ANTS (RIG_ANT_1|RIG_ANT_2) +#define TT588_ANTS (RIG_ANT_1|RIG_ANT_2) #define TT588_PARMS (RIG_PARM_NONE) @@ -84,7 +83,7 @@ static int tt588_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val); /* * tt588 transceiver capabilities. * - * Protocol is documented at + * Protocol is documented at * http://www.rfsquared.com/ * * Only set_freq is supposed to work. @@ -336,7 +335,7 @@ int tt588_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) { resp_len = 32; retval = tt588_transaction (rig, (char *) cmdbuf, cmd_len, (char *) respbuf, &resp_len); - if (retval != RIG_OK) + if (retval != RIG_OK) return retval; curVfo = which_vfo(rig, vfo); @@ -381,7 +380,7 @@ int tt588_set_freq(RIG *rig, vfo_t vfo, freq_t freq) which_vfo(rig, vfo), bytes[3], bytes[2], bytes[1], bytes[0]); - return tt588_transaction(rig, (char *) cmdbuf, cmd_len, NULL, NULL); + return tt588_transaction(rig, (char *) cmdbuf, cmd_len, NULL, NULL); } /* @@ -410,10 +409,10 @@ int tt588_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) switch (which_vfo(rig, vfo)) { case 'A': - ttmode = respbuf[1]; + ttmode = respbuf[1]; break; case 'B': - ttmode = respbuf[2]; + ttmode = respbuf[2]; break; default: rig_debug(RIG_DEBUG_ERR,"%s: unsupported VFO %s\n", @@ -570,7 +569,7 @@ int tt588_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else width = tt588_filter_number((int) width); - cmd_len = sprintf((char *) cmdbuf, "*W%c" EOM, (unsigned char) width); + cmd_len = sprintf((char *) cmdbuf, "*W%c" EOM, (unsigned char) width); return tt588_transaction (rig, (char *) cmdbuf, cmd_len, NULL, NULL); } @@ -803,7 +802,7 @@ printf("%f\n", sstr); default: - rig_debug(RIG_DEBUG_ERR,"%s: unsupported level %d\n", + rig_debug(RIG_DEBUG_ERR,"%s: unsupported level %d\n", __FUNCTION__, level); return -RIG_EINVAL; } @@ -860,7 +859,7 @@ int tt588_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) break; default: - rig_debug(RIG_DEBUG_ERR,"%s: unsupported level %d\n", + rig_debug(RIG_DEBUG_ERR,"%s: unsupported level %d\n", __FUNCTION__, level); return -RIG_EINVAL; } diff --git a/tentec/orion.c b/tentec/orion.c index bf178b1d1..ced4c8e86 100644 --- a/tentec/orion.c +++ b/tentec/orion.c @@ -4,23 +4,23 @@ * Copyright (c) 2004-2010 by Stephane Fillod * * - * This library is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ -/* Edits by Martin Ewing AA6E, 23 Mar 2005 --> ?? +/* Edits by Martin Ewing AA6E, 23 Mar 2005 --> ?? * Added valid length settings before tentec_transaction calls. * Added vfo_curr initialization to VFO A * Fixed up VSWR & S-meter, set ATT, set AGC, add rough STR_CAL func. @@ -84,7 +84,7 @@ #include "orion.h" #include -#ifdef TT565_TIME +#ifdef TT565_TIME /** * \returns current time in secs/microsecs */ @@ -117,19 +117,19 @@ static int tt565_transaction(RIG *rig, const char *cmd, int cmd_len, char *data, struct rig_state *rs; static int passcount=0; #ifdef TT565_TIME - double ft1, ft2; + double ft1, ft2; #endif passcount++; // for debugging /* Capture buffer length for possible read re-try. */ data_len_init = (data && data_len) ? *data_len : 0; /* Allow transaction re-tries according to capabilities. */ - for (itry=0; itry < rig->caps->retry; itry++) { + for (itry=0; itry < rig->caps->retry; itry++) { rs = &rig->state; retval = write_block(&rs->rigport, cmd, cmd_len); if (retval != RIG_OK) return retval; - /* no data expected, TODO: flush input? */ + /* no data expected, TODO: flush input? */ if (!data || !data_len) { if (*cmd != '*') { // i.e. was not a 'write' to rig... rig_debug(RIG_DEBUG_ERR,"cmd reject 1\n"); @@ -141,7 +141,7 @@ static int tt565_transaction(RIG *rig, const char *cmd, int cmd_len, char *data, ft1 = tt565_timenow(); #endif *data_len = data_len_init; /* restore orig. buffer length */ - *data_len = read_string(&rs->rigport, data, *data_len, + *data_len = read_string(&rs->rigport, data, *data_len, EOM, strlen(EOM)); if (!strncmp(data,"Z!",2)) { // command unrecognized?? rig_debug(RIG_DEBUG_ERR,"cmd reject 2\n"); @@ -167,10 +167,10 @@ static int tt565_transaction(RIG *rig, const char *cmd, int cmd_len, char *data, and issue another read in hopes of eventual success. */ rig_debug(RIG_DEBUG_WARN, - "** retry after delay (io=%d, retry=%d) **\n", + "** retry after delay (io=%d, retry=%d) **\n", passcount, itry); *data_len = data_len_init; /* restore orig. buffer length */ - read_string(&rs->rigport, data, *data_len, + read_string(&rs->rigport, data, *data_len, EOM, strlen(EOM)); // purge the input stream... continue; // now go retry the full command } @@ -178,13 +178,13 @@ static int tt565_transaction(RIG *rig, const char *cmd, int cmd_len, char *data, #ifdef TT565_TIME ft2 = tt565_timenow(); if (*data_len == -RIG_ETIMEOUT) - rig_debug(RIG_DEBUG_ERR,"Timeout %d: Elapsed = %f secs.\n", + rig_debug(RIG_DEBUG_ERR,"Timeout %d: Elapsed = %f secs.\n", itry, ft2-ft1); else rig_debug(RIG_DEBUG_ERR, - "Other Error #%d, itry=%d: Elapsed = %f secs.\n", + "Other Error #%d, itry=%d: Elapsed = %f secs.\n", *data_len, itry, ft2-ft1); -#endif +#endif } /* end of itry loop */ rig_debug(RIG_DEBUG_ERR,"** Ran out of retries io=%d **\n", passcount); @@ -203,7 +203,7 @@ int tt565_init(RIG *rig) if (!priv) { return -RIG_ENOMEM; } /* no memory available */ memset(priv, 0, sizeof(struct tt565_priv_data)); priv->ch = 0; /* set arbitrary initial status */ - priv->vfo_curr = RIG_VFO_A; + priv->vfo_curr = RIG_VFO_A; rig->state.priv = (rig_ptr_t)priv; return RIG_OK; } @@ -238,7 +238,7 @@ int tt565_cleanup(RIG *rig) /* Detect version 1 or version 2 firmware. V2 is default. */ /* The only difference for us is the S-meter cal table */ - /* Get Orion's Version string (?V command response) */ + /* Get Orion's Version string (?V command response) */ buf = (char *)tt565_get_info(rig); /* Is Orion firmware version 1.* or 2.*? */ @@ -251,7 +251,7 @@ int tt565_cleanup(RIG *rig) } return RIG_OK; } - + /** * \param rig * \param vfo RIG_VFO_MAIN or RIG_VFO_SUB @@ -319,12 +319,12 @@ int tt565_set_freq(RIG *rig, vfo_t vfo, freq_t freq) char cmdbuf[TT565_BUFSIZE]; #ifdef TT565_ASCII_FREQ /* Use ASCII mode to set frequencies */ - cmd_len = sprintf (cmdbuf, "*%cF%"PRIll EOM, + cmd_len = sprintf (cmdbuf, "*%cF%"PRIll EOM, which_vfo(rig, vfo), (int64_t)freq); #else /* Use binary mode */ - /* Set frequency using Orion's binary mode (short) sequence. + /* Set frequency using Orion's binary mode (short) sequence. The short sequence transfers faster and may require less Orion firmware effort. */ @@ -367,7 +367,7 @@ int tt565_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) cmd_len = sprintf(cmdbuf, "?%c" EOM, which_vfo(rig, vfo)); #endif - resp_len = sizeof(respbuf); + resp_len = sizeof(respbuf); retval = tt565_transaction (rig, cmdbuf, cmd_len, respbuf, &resp_len); if (retval != RIG_OK) @@ -410,7 +410,7 @@ int tt565_set_vfo(RIG *rig, vfo_t vfo) if (vfo == RIG_VFO_MAIN || vfo == RIG_VFO_SUB) { /* Select Sub or Main RX */ - vfo_len = sprintf (vfobuf, "*K%c" EOM, + vfo_len = sprintf (vfobuf, "*K%c" EOM, vfo == RIG_VFO_SUB ? 'S' : 'M'); return tt565_transaction (rig, vfobuf, vfo_len, NULL, NULL); @@ -443,7 +443,7 @@ int tt565_get_vfo(RIG *rig, vfo_t *vfo) * \returns RIG_OK or < 0 * \brief Set split operating mode * - * Sets Main Rx to "vfo"( A or B) , Main Tx to "tx_vfo" (A, B, or N). + * Sets Main Rx to "vfo"( A or B) , Main Tx to "tx_vfo" (A, B, or N). * \n Sub Rx is set to "None". That should be fixed! */ int tt565_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) @@ -451,7 +451,7 @@ int tt565_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) int cmd_len, retval; char cmdbuf[TT565_BUFSIZE]; - cmd_len = sprintf (cmdbuf, "*KV%c%c%c" EOM, + cmd_len = sprintf (cmdbuf, "*KV%c%c%c" EOM, which_vfo(rig, vfo), 'N', /* FIXME */ which_vfo(rig, tx_vfo)); @@ -490,7 +490,7 @@ int tt565_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo) char ttreceiver; cmd_len = sprintf(cmdbuf, "?KV" EOM); - resp_len = sizeof(respbuf); + resp_len = sizeof(respbuf); retval = tt565_transaction (rig, cmdbuf, cmd_len, respbuf, &resp_len); if (retval != RIG_OK) @@ -571,7 +571,7 @@ int tt565_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) * \param width Receives current bandwidth setting, must be != NULL * \returns RIG_OK or < 0 * \brief Get op. mode and bandwidth for selected vfo - * + * * \remarks Confusion of VFO and Main/Sub TRx/Rx. See tt565_set_mode. */ int tt565_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) @@ -584,7 +584,7 @@ int tt565_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) /* Query mode */ cmd_len = sprintf(cmdbuf, "?R%cM" EOM, ttreceiver); - resp_len = sizeof(respbuf); + resp_len = sizeof(respbuf); retval = tt565_transaction (rig, cmdbuf, cmd_len, respbuf, &resp_len); if (retval != RIG_OK) @@ -615,7 +615,7 @@ int tt565_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) usleep(80000); // try 80 ms /* Query passband width (filter) */ cmd_len = sprintf(cmdbuf, "?R%cF" EOM, ttreceiver); - resp_len = sizeof(respbuf); + resp_len = sizeof(respbuf); retval = tt565_transaction (rig, cmdbuf, cmd_len, respbuf, &resp_len); if (retval != RIG_OK) @@ -668,7 +668,7 @@ int tt565_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts) cmd_len = sprintf(cmdbuf, "?R%cI" EOM, which_receiver(rig, vfo)); - resp_len = sizeof(respbuf); + resp_len = sizeof(respbuf); retval = tt565_transaction (rig, cmdbuf, cmd_len, respbuf, &resp_len); if (retval != RIG_OK) @@ -722,7 +722,7 @@ int tt565_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) cmd_len = sprintf(cmdbuf, "?R%cR" EOM, which_receiver(rig, vfo)); - resp_len = sizeof(respbuf); + resp_len = sizeof(respbuf); retval = tt565_transaction (rig, cmdbuf, cmd_len, respbuf, &resp_len); if (retval != RIG_OK) @@ -778,7 +778,7 @@ int tt565_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit) cmd_len = sprintf(cmdbuf, "?R%cX" EOM, 'M'); - resp_len = sizeof(respbuf); + resp_len = sizeof(respbuf); retval = tt565_transaction (rig, cmdbuf, cmd_len, respbuf, &resp_len); if (retval != RIG_OK) @@ -806,7 +806,7 @@ int tt565_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) { struct rig_state *rs = &rig->state; - return write_block(&rs->rigport, + return write_block(&rs->rigport, ptt==RIG_PTT_ON ? "*TK" EOM:"*TU" EOM, 4); } @@ -822,7 +822,7 @@ int tt565_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) int resp_len, retval; char respbuf[TT565_BUFSIZE]; - resp_len = sizeof(respbuf); + resp_len = sizeof(respbuf); retval = tt565_transaction (rig, "?S" EOM, 3, respbuf, &resp_len); if (retval != RIG_OK) @@ -855,7 +855,7 @@ int tt565_reset(RIG *rig, reset_t reset) char reset_buf[TT565_BUFSIZE]; if (reset == RIG_RESET_NONE) return RIG_OK; /* No operation requested. */ - + reset_len = sizeof(reset_buf); retval = tt565_transaction (rig, "XX" EOM, 3, reset_buf, &reset_len); if (retval != RIG_OK) return retval; @@ -879,16 +879,16 @@ const char *tt565_get_info(RIG *rig) static char buf[TT565_BUFSIZE]; /* FIXME: reentrancy */ int firmware_len, retval, i; - firmware_len = sizeof(buf); + firmware_len = sizeof(buf); retval = tt565_transaction (rig, "?V" EOM, 3, buf, &firmware_len); - if (retval != RIG_OK || firmware_len < 8) { + if (retval != RIG_OK || firmware_len < 8) { rig_debug(RIG_DEBUG_ERR,"%s: ack NG, len=%d\n", __FUNCTION__, firmware_len); buf[0] = '\0'; return buf; } buf[firmware_len] = '\0'; - + /* filter out any non-graphic characters */ for (i=0; i < strlen(buf); i++) if (!isgraph(buf[i])) buf[i] = ' '; // bad chars -> spaces @@ -903,9 +903,9 @@ const char *tt565_get_info(RIG *rig) * \returns RIG_OK or < 0 * \brief Sets any of Orion's "Level" adjustments * - * Unfortunately, "val" type is not well defined. Sometimes it is a float (AF gain), + * Unfortunately, "val" type is not well defined. Sometimes it is a float (AF gain), * an integer (RF Atten.), or an enum (RIG_AGC_FAST)... - * + * * Supported Levels and Units * \n -RIG_LEVEL_RFPOWER, float 0.0 - 1.0 * \n -RIG_LEVEL_AGC, int RIG_AGC_x, x= OFF, FAST, MEDIUM, SLOW, USER @@ -933,7 +933,7 @@ int tt565_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) switch (level) { case RIG_LEVEL_RFPOWER: - cmd_len = sprintf(cmdbuf, "*TP%d" EOM, + cmd_len = sprintf(cmdbuf, "*TP%d" EOM, (int)(val.f*100)); break; @@ -978,7 +978,7 @@ int tt565_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) while ( rig->caps->attenuator[++ii] != RIG_DBLST_END ) { if (rig->caps->attenuator[ii] > val.i) break; } - + cmd_len = sprintf(cmdbuf, "*R%cT%d" EOM, which_receiver(rig, vfo), ii); @@ -1003,13 +1003,13 @@ int tt565_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_MICGAIN: /* Mic gain, float 0.0 - 1.0 */ - cmd_len = sprintf(cmdbuf, "*TM%d" EOM, + cmd_len = sprintf(cmdbuf, "*TM%d" EOM, (int)(val.f*100)); break; case RIG_LEVEL_COMP: /* Speech Processor, float 0.0 - 1.0 */ - cmd_len = sprintf(cmdbuf, "*TS%d" EOM, + cmd_len = sprintf(cmdbuf, "*TS%d" EOM, (int)(val.f*9)); break; @@ -1020,7 +1020,7 @@ int tt565_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) */ if (val.i > TT565_TONE_MAX) val.i = TT565_TONE_MAX; else if (val.i < TT565_TONE_MIN) val.i = TT565_TONE_MIN; - cmd_len = sprintf(cmdbuf, "*CT%d" EOM, + cmd_len = sprintf(cmdbuf, "*CT%d" EOM, val.i); break; @@ -1038,20 +1038,20 @@ int tt565_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_NR: /* Noise Reduction (blanking) Float 0.0 - 1.0 For some reason NB setting is supported in 1.372, but - NR, NOTCH, and AN are not. - FOR NOW -- RIG_LEVEL_NR controls the Orion NB setting + NR, NOTCH, and AN are not. + FOR NOW -- RIG_LEVEL_NR controls the Orion NB setting */ cmd_len = sprintf(cmdbuf, "*R%cNB%d" EOM, which_receiver(rig, vfo), (int)(val.f*9)); break; - case RIG_LEVEL_VOX: + case RIG_LEVEL_VOX: /* VOX delay, float tenths of seconds */ cmd_len = sprintf(cmdbuf, "*TH%4.2f" EOM, 0.1*val.f); break; - case RIG_LEVEL_VOXGAIN: + case RIG_LEVEL_VOXGAIN: /* Float, 0.0 - 1.0 */ cmd_len = sprintf(cmdbuf, "*TG%d" EOM, (int)(100.0*val.f)); break; @@ -1098,7 +1098,7 @@ int tt565_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) * \n -RIG_LEVEL_VOX * \n -RIG_LEVEL_VOXGAIN * \n -RIG_LEVEL_ANTIVOX - * + * * (RIG_LEVEL_STRENGTH, int calibrated signal strength (dB, S9 = 0) is * handled in settings.c) @@ -1111,7 +1111,7 @@ int tt565_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) /* Optimize: sort the switch cases with the most frequent first */ switch (level) { case RIG_LEVEL_SWR: - lvl_len = sizeof(lvlbuf); + lvl_len = sizeof(lvlbuf); retval = tt565_transaction (rig, "?S" EOM, 3, lvlbuf, &lvl_len); if (retval != RIG_OK) return retval; @@ -1139,7 +1139,7 @@ int tt565_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_RAWSTR: /* provide uncalibrated raw strength, int */ /* NB: RIG_LEVEL_STRENGTH is handled in the frontend */ - lvl_len = sizeof(lvlbuf); + lvl_len = sizeof(lvlbuf); retval = tt565_transaction (rig, "?S" EOM, 3, lvlbuf, &lvl_len); if (retval != RIG_OK) return retval; @@ -1168,7 +1168,7 @@ int tt565_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_RFPOWER: - lvl_len = sizeof(lvlbuf); + lvl_len = sizeof(lvlbuf); retval = tt565_transaction (rig, "?TP" EOM, 4, lvlbuf, &lvl_len); if (retval != RIG_OK) return retval; @@ -1186,7 +1186,7 @@ int tt565_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) cmd_len = sprintf(cmdbuf, "?R%cA" EOM, which_receiver(rig, vfo)); - lvl_len = sizeof(lvlbuf); + lvl_len = sizeof(lvlbuf); retval = tt565_transaction (rig, cmdbuf, cmd_len, lvlbuf, &lvl_len); if (retval != RIG_OK) return retval; @@ -1212,7 +1212,7 @@ int tt565_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) cmd_len = sprintf(cmdbuf, "?U%c" EOM, which_receiver(rig, vfo)); - lvl_len = sizeof(lvlbuf); + lvl_len = sizeof(lvlbuf); retval = tt565_transaction (rig, cmdbuf, cmd_len, lvlbuf, &lvl_len); if (retval != RIG_OK) return retval; @@ -1230,7 +1230,7 @@ int tt565_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) cmd_len = sprintf(cmdbuf, "?R%cP" EOM, /* passband tuning */ which_receiver(rig, vfo)); - lvl_len = sizeof(lvlbuf); + lvl_len = sizeof(lvlbuf); retval = tt565_transaction (rig, cmdbuf, cmd_len, lvlbuf, &lvl_len); if (retval != RIG_OK) return retval; @@ -1248,7 +1248,7 @@ int tt565_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) cmd_len = sprintf(cmdbuf, "?R%cG" EOM, which_receiver(rig, vfo)); - lvl_len = sizeof(lvlbuf); + lvl_len = sizeof(lvlbuf); retval = tt565_transaction (rig, cmdbuf, cmd_len, lvlbuf, &lvl_len); if (retval != RIG_OK) return retval; @@ -1266,7 +1266,7 @@ int tt565_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) cmd_len = sprintf(cmdbuf, "?R%cT" EOM, which_receiver(rig, vfo)); - lvl_len = sizeof(lvlbuf); + lvl_len = sizeof(lvlbuf); retval = tt565_transaction (rig, cmdbuf, cmd_len, lvlbuf, &lvl_len); if (retval != RIG_OK) return retval; @@ -1289,7 +1289,7 @@ int tt565_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) val->i=0; break; } - lvl_len = sizeof(lvlbuf); + lvl_len = sizeof(lvlbuf); retval = tt565_transaction (rig, "?RME" EOM, 5, lvlbuf, &lvl_len); if (retval != RIG_OK) return retval; @@ -1307,7 +1307,7 @@ int tt565_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) cmd_len = sprintf(cmdbuf, "?R%cS" EOM, which_receiver(rig, vfo)); - lvl_len = sizeof(lvlbuf); + lvl_len = sizeof(lvlbuf); retval = tt565_transaction (rig, cmdbuf, cmd_len, lvlbuf, &lvl_len); if (retval != RIG_OK) return retval; @@ -1322,7 +1322,7 @@ int tt565_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_MICGAIN: - lvl_len = sizeof(lvlbuf); + lvl_len = sizeof(lvlbuf); retval = tt565_transaction (rig, "?TM" EOM, 4, lvlbuf, &lvl_len); if (retval != RIG_OK) return retval; @@ -1337,7 +1337,7 @@ int tt565_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_COMP: - lvl_len = sizeof(lvlbuf); + lvl_len = sizeof(lvlbuf); retval = tt565_transaction (rig, "?TS" EOM, 4, lvlbuf, &lvl_len); if (retval != RIG_OK) return retval; @@ -1383,7 +1383,7 @@ int tt565_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) /* RIG_LEVEL_NR controls Orion NB setting - TEMP */ cmd_len = sprintf(cmdbuf, "?R%cNB" EOM, which_receiver(rig, vfo)); - + lvl_len = sizeof(lvlbuf); retval = tt565_transaction (rig, cmdbuf, cmd_len, lvlbuf, &lvl_len); if (retval != RIG_OK) @@ -1437,7 +1437,7 @@ int tt565_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; default: - rig_debug(RIG_DEBUG_ERR,"%s: unsupported level %d\n", + rig_debug(RIG_DEBUG_ERR,"%s: unsupported level %d\n", __FUNCTION__, level); return -RIG_EINVAL; } @@ -1450,7 +1450,7 @@ int tt565_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) * \param ch Channel number * \returns RIG_OK * \brief This only sets the current memory channel locally. No Orion I/O. - * + * * Use RIG_OP_TO_VFO and RIG_OP_FROM_VFO to get/store a freq in the channel. * \sa tt565_vfo_op */ @@ -1501,7 +1501,7 @@ int tt565_vfo_op(RIG * rig, vfo_t vfo, vfo_op_t op) switch (op) { case RIG_OP_TO_VFO: case RIG_OP_FROM_VFO: - cmd_len = sprintf (cmdbuf, "*K%c%c%d" EOM, + cmd_len = sprintf (cmdbuf, "*K%c%c%d" EOM, op == RIG_OP_TO_VFO ? 'R' : 'W', which_vfo(rig, vfo), priv->ch); @@ -1514,13 +1514,13 @@ int tt565_vfo_op(RIG * rig, vfo_t vfo, vfo_op_t op) case RIG_OP_UP: case RIG_OP_DOWN: - cmd_len = sprintf (cmdbuf, "*%cS%c1" EOM, + cmd_len = sprintf (cmdbuf, "*%cS%c1" EOM, which_vfo(rig, vfo), op == RIG_OP_UP ? '+' : '-'); break; default: - rig_debug(RIG_DEBUG_ERR,"%s: Unsupported op %d\n", + rig_debug(RIG_DEBUG_ERR,"%s: Unsupported op %d\n", __FUNCTION__, op); return -RIG_EINVAL; } @@ -1536,17 +1536,17 @@ int tt565_vfo_op(RIG * rig, vfo_t vfo, vfo_op_t op) * \returns RIG_OK * \brief Send a string as morse characters * - * Orion keyer must be on for morse, but we do not have a "keyer on" function in + * Orion keyer must be on for morse, but we do not have a "keyer on" function in * hamlib (yet). Keyer will be forced on. * - * Orion can queue up to about 20 characters. + * Orion can queue up to about 20 characters. * We could batch a longer message into 20 char chunks, but there is no * simple way to tell if message has completed. We could calculate a * duration based on keyer speed and the text that was sent, but * what we really need is a handshake for "message complete". * Without it, you can't easily use the Orion as a code practice machine. * For now, we let the user do the batching. - * Note that rig panel is locked up for duration of message. + * Note that rig panel is locked up for duration of message. */ int tt565_send_morse(RIG *rig, vfo_t vfo, const char *msg) { @@ -1588,7 +1588,7 @@ int tt565_send_morse(RIG *rig, vfo_t vfo, const char *msg) * \n RIG_FUNC_VOX, off/on, 0/1 * \n RIG_FUNC_LOCK, unlock/lock, 0/1 * \n RIG_FUNC_NB, off/on, 0/1 (sets Orion NB=0 or =4), compare RIG_LEVEL_NR - * + * */ int tt565_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) { @@ -1626,7 +1626,7 @@ int tt565_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) default: rig_debug(RIG_DEBUG_ERR,"Unsupported set_func %#x", func); return -RIG_EINVAL; - } + } retval = tt565_transaction(rig, fcmdbuf, fcmdlen, NULL, NULL); if (retval != RIG_OK) @@ -1661,11 +1661,11 @@ int tt565_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) break; case RIG_FUNC_LOCK: - fcmdlen = sprintf(fcmdbuf, "?%cU" EOM, + fcmdlen = sprintf(fcmdbuf, "?%cU" EOM, which_vfo(rig, vfo) ); /* needs special treatment */ fresplen = sizeof(frespbuf); - retval = tt565_transaction(rig, fcmdbuf, fcmdlen, + retval = tt565_transaction(rig, fcmdbuf, fcmdlen, frespbuf, &fresplen); if (retval != RIG_OK) return retval; @@ -1681,7 +1681,7 @@ int tt565_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) which_receiver(rig, vfo) ); /* needs special treatment */ fresplen = sizeof(frespbuf); - retval = tt565_transaction(rig, fcmdbuf, fcmdlen, + retval = tt565_transaction(rig, fcmdbuf, fcmdlen, frespbuf, &fresplen); if (retval != RIG_OK) return retval; @@ -1709,7 +1709,7 @@ int tt565_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) * * We support Ant_1 and Ant_2 for M and S receivers. * \n Note that Rx-only antenna (Ant_3?) is not supported at this time. - * \n Orion command assigns MSBN (main rtx, sub rx, both, or none) to each ant, + * \n Orion command assigns MSBN (main rtx, sub rx, both, or none) to each ant, * but hamlib wants to assign an ant to rx/tx! * The efficient way would be to keep current config in rig priv area, but we will * ask the rig what its state is each time... @@ -1726,16 +1726,16 @@ int tt565_set_ant(RIG * rig, vfo_t vfo, ant_t ant) if (retval != RIG_OK) return retval; if (resp_len != 7 || respbuf[1] != 'K' || respbuf[2] != 'A') { - rig_debug(RIG_DEBUG_ERR,"%s; tt565_set_ant: ?KA NG %s\n", + rig_debug(RIG_DEBUG_ERR,"%s; tt565_set_ant: ?KA NG %s\n", __FUNCTION__, respbuf); return -RIG_EPROTO; } /* respbuf="@KAxxx" - * x='M'|'S'|'B'|'N'=main/sub/both/none for ants 1,2,3. + * x='M'|'S'|'B'|'N'=main/sub/both/none for ants 1,2,3. * but hardware will not permit all combinations! * respbuf [3,4] can be MS, SM, BN, NB - * decode to rx-centric view + * decode to rx-centric view */ if (respbuf[3] == 'M' || respbuf[3] == 'B') main_ant = RIG_ANT_1; else main_ant = RIG_ANT_2; @@ -1775,7 +1775,7 @@ int tt565_set_ant(RIG * rig, vfo_t vfo, ant_t ant) respbuf[5] = 'N'; /* Force no rx on Ant 3 */ respbuf[6] = EOM[0]; respbuf[7] = 0; - retval = tt565_transaction (rig, respbuf, 7, NULL, NULL); + retval = tt565_transaction (rig, respbuf, 7, NULL, NULL); if (retval != RIG_OK) return retval; return RIG_OK; @@ -1786,7 +1786,7 @@ int tt565_set_ant(RIG * rig, vfo_t vfo, ant_t ant) * \param ant receives antenna identifier * \returns RIG_OK or < 0 * \brief Find what antenna is "attached" to our vfo - * + * * \sa tt565_set_ant */ int tt565_get_ant(RIG *rig, vfo_t vfo, ant_t *ant) @@ -1795,11 +1795,11 @@ int tt565_get_ant(RIG *rig, vfo_t vfo, ant_t *ant) int resp_len, retval; resp_len = sizeof(respbuf); - retval = tt565_transaction(rig, "?KA" EOM, 4, respbuf, &resp_len); + retval = tt565_transaction(rig, "?KA" EOM, 4, respbuf, &resp_len); if (retval != RIG_OK) return retval; if (respbuf[1] != 'K' || respbuf[2] != 'A' || resp_len != 7) { - rig_debug(RIG_DEBUG_ERR,"%s; tt565_get_ant: NG %s\n", + rig_debug(RIG_DEBUG_ERR,"%s; tt565_get_ant: NG %s\n", __FUNCTION__, respbuf); return -RIG_EPROTO; } @@ -1811,7 +1811,7 @@ int tt565_get_ant(RIG *rig, vfo_t vfo, ant_t *ant) if (respbuf[4] == which_receiver(rig,vfo) || respbuf[4] == 'B' ) { *ant = RIG_ANT_2; return RIG_OK; - } + } *ant = RIG_ANT_NONE; /* ignore possible RIG_ANT_3 = rx only ant */ return RIG_OK; diff --git a/tentec/orion.h b/tentec/orion.h index 61f9a9769..bb7bdca3c 100644 --- a/tentec/orion.h +++ b/tentec/orion.h @@ -3,19 +3,19 @@ * Copyright (c) 2004-2006 by Stephane Fillod & Martin Ewing * * - * This library is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -38,7 +38,7 @@ * * Orion's own memory channel holds a freq, mode, and bandwidth. * May be captured from VFO A or B and applied to VFO A or B. - * It cannot directly be read or written from the computer! + * It cannot directly be read or written from the computer! */ #define TT565_MEM_CAP { \ .freq = 1, \ @@ -106,9 +106,9 @@ struct tt565_priv_data { RIG_LEVEL_SWR|RIG_LEVEL_ATT) /** \brief Orion Tx/Rx Antennas*/ -#define TT565_ANTS (RIG_ANT_1|RIG_ANT_2) +#define TT565_ANTS (RIG_ANT_1|RIG_ANT_2) /** \brief Orion Rx Antennas*/ -#define TT565_RXANTS (TT565_ANTS|RIG_ANT_3) +#define TT565_RXANTS (TT565_ANTS|RIG_ANT_3) /** \brief Orion Parameters */ #define TT565_PARMS (RIG_PARM_NONE) @@ -180,7 +180,7 @@ struct tt565_priv_data { 7015679 < freq < 7015936, etc. Use ascii mode. */ /** - * + * * \brief tt565 transceiver capabilities. * * All of the Orion's personality is defined here! @@ -217,7 +217,7 @@ const struct rig_caps tt565_caps = { .has_get_parm = TT565_PARMS, .has_set_parm = TT565_PARMS, -.level_gran = {}, +.level_gran = {}, .parm_gran = {}, .ctcss_list = NULL, .dcs_list = NULL, diff --git a/tentec/paragon.c b/tentec/paragon.c index 2d5f06d3e..1fe24eec9 100644 --- a/tentec/paragon.c +++ b/tentec/paragon.c @@ -3,19 +3,19 @@ * Copyright (c) 2003-2010 by Stephane Fillod * * - * This library is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -51,7 +51,7 @@ struct tt585_priv_data { #define TT585_LEVELS (RIG_LEVEL_NONE) -#define TT585_ANTS (RIG_ANT_1) +#define TT585_ANTS (RIG_ANT_1) #define TT585_PARMS (RIG_PARM_ANN|RIG_PARM_TIME) @@ -502,8 +502,8 @@ int tt585_get_status_data(RIG *rig) if (ret < 0) return ret; - ret = read_block(rigport, (char *) priv->status_data, - sizeof(priv->status_data)); + ret = read_block(rigport, (char *) priv->status_data, + sizeof(priv->status_data)); if (ret < 0) return ret; diff --git a/tentec/pegasus.c b/tentec/pegasus.c index 65103ac74..d9c7ba241 100644 --- a/tentec/pegasus.c +++ b/tentec/pegasus.c @@ -2,21 +2,20 @@ * Hamlib TenTenc backend - TT-550 PC-Radio description * Copyright (c) 2002-2004 by Stephane Fillod * - * $Id: pegasus.c,v 1.7 2004-02-15 11:05:32 fillods 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 - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -49,7 +48,7 @@ #define TT550_VFO (RIG_VFO_A ) #define TT550_VFO_OPS (RIG_OP_TUNE) -/* +/* * a bit coarse, but I don't have a TT550, and the manual is not * verbose on the subject. Please test it and report! --SF */ @@ -61,7 +60,7 @@ /* * tt550 receiver capabilities. * - * protocol is documented at + * protocol is documented at * http://www.tentec.com/550/550prg2.pdf * * TODO: diff --git a/tentec/rx320.c b/tentec/rx320.c index 53eabdc9b..521aae822 100644 --- a/tentec/rx320.c +++ b/tentec/rx320.c @@ -2,21 +2,20 @@ * Hamlib TenTenc backend - RX-320 PC-Radio description * Copyright (c) 2001-2008 by Stephane Fillod * - * $Id: rx320.c,v 1.10 2008-12-03 22:36:34 fillods 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 - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -38,9 +37,9 @@ #define RX320_VFO (RIG_VFO_A) -/* +/* * Modified 11/18/2008, Josh Rovero, KK1D - * Calibration via comparison with JRC NRD-525. + * Calibration via comparison with JRC NRD-525. * Highy non-linear.... */ #define RX320_STR_CAL { 17, { \ @@ -66,7 +65,7 @@ /* * rx320 receiver capabilities. * - * protocol is documented at + * protocol is documented at * http://www.tentec.com/rx320prg.zip * * TODO: @@ -94,8 +93,8 @@ const struct rig_caps rx320_caps = { .retry = 3, /* - * Added S-meter read support, Josh Rovero KK1D - * Only get_level is for RIG_LEVEL_RAWSTR + * Added S-meter read support, Josh Rovero KK1D + * Only get_level is for RIG_LEVEL_RAWSTR */ .has_get_func = RIG_FUNC_NONE, .has_set_func = RIG_FUNC_NONE, @@ -106,7 +105,7 @@ const struct rig_caps rx320_caps = { .level_gran = { [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 10000 } }, [LVL_AF] = { .min = { .f = 0 }, .max = { .f = 1 }, .step = { .f = 1.0/64 } }, - [LVL_IF] = { .min = { .i = -2000 }, .max = { .i = 2000 }, .step = { .i = 10} }, + [LVL_IF] = { .min = { .i = -2000 }, .max = { .i = 2000 }, .step = { .i = 10} }, [LVL_CWPITCH] = { .min = { .i = 0}, .max = { .i = 2000 }, .step = { .i = 100} } }, .parm_gran = {}, diff --git a/tentec/rx331.c b/tentec/rx331.c index 851533a4d..2bfad84ec 100644 --- a/tentec/rx331.c +++ b/tentec/rx331.c @@ -3,19 +3,20 @@ * Copyright (c) 2010 by Berndt Josef Wulf * * - * This library is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * */ #ifdef HAVE_CONFIG_H @@ -52,7 +53,7 @@ static const struct confparams rx331_cfg_params[] = { RIG_LEVEL_CWPITCH|RIG_LEVEL_AGC| \ RIG_LEVEL_ATT|RIG_LEVEL_PREAMP) -#define RX331_ANTS (RIG_ANT_1) +#define RX331_ANTS (RIG_ANT_1) #define RX331_PARMS (RIG_PARM_NONE) @@ -86,7 +87,7 @@ static const char* rx331_get_info(RIG *rig); /* * RX331 receiver capabilities. * - * Protocol is documented at + * Protocol is documented at * http://radio.tentec.com/downloads/receivers/RX331 * * TODO: from/to memory @@ -374,7 +375,7 @@ int rx331_set_freq(RIG *rig, vfo_t vfo, freq_t freq) freq_len = num_sprintf(freqbuf, "$%iF%.6f" EOM, priv->receiver_id, freq/1e6); - + retval = write_block(&rs->rigport, freqbuf, freq_len); return retval; @@ -399,7 +400,7 @@ int rx331_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) if (buf_len < 2 || buf[0] != 'F' || num_sscanf(buf+1, "%lf", &f) != 1) return -RIG_EPROTO; - + *freq = f*1e6; return RIG_OK; @@ -464,7 +465,7 @@ int rx331_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) if (buf_len < 4 || buf[0] != 'D' || buf[2] != 'I') return -RIG_EPROTO; - + switch (buf[1]) { case RX331_USB: *mode = RIG_MODE_USB; break; case RX331_LSB: *mode = RIG_MODE_LSB; break; @@ -482,7 +483,7 @@ int rx331_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) if (num_sscanf(buf+3, "%lf", &f) != 1) return -RIG_EPROTO; - + *width = f*1e3; return RIG_OK; @@ -535,7 +536,7 @@ int rx331_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) cmd_len = sprintf(cmdbuf, "$%iA%d" EOM, priv->receiver_id, 120-(int)(val.f*120)); break; - + case RIG_LEVEL_SQL: cmd_len = sprintf(cmdbuf, "$%iQ%d" EOM, priv->receiver_id, 120-(int)(val.f*120)); @@ -592,7 +593,7 @@ int rx331_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) } // Range is 0-120 covering the 120dB range of the receiver - + if(num_sscanf(lvlbuf+1,"%d",&val->i) != 1) return -RIG_EPROTO; diff --git a/tentec/rx331.h b/tentec/rx331.h index 7247dbdc9..6fabc3ef4 100644 --- a/tentec/rx331.h +++ b/tentec/rx331.h @@ -3,19 +3,20 @@ * Copyright (c) 2010 by Berndt Josef Wulf * * - * This library is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * */ #ifndef _RX331_H diff --git a/tentec/rx340.c b/tentec/rx340.c index 668eccf60..3b469dd66 100644 --- a/tentec/rx340.c +++ b/tentec/rx340.c @@ -3,19 +3,19 @@ * Copyright (c) 2003-2009 by Stephane Fillod * * - * This library is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -44,7 +44,7 @@ RIG_LEVEL_CWPITCH|RIG_LEVEL_AGC| \ RIG_LEVEL_ATT|RIG_LEVEL_PREAMP) -#define RX340_ANTS (RIG_ANT_1) +#define RX340_ANTS (RIG_ANT_1) #define RX340_PARMS (RIG_PARM_NONE) @@ -77,7 +77,7 @@ static const char* rx340_get_info(RIG *rig); /* * RX340 receiver capabilities. * - * Protocol is documented at + * Protocol is documented at * http://radio.tentec.com/downloads/receivers/RX340 * * TODO: from/to memory, scan, get_level, .. @@ -289,7 +289,7 @@ int rx340_set_freq(RIG *rig, vfo_t vfo, freq_t freq) char freqbuf[16]; freq_len = num_sprintf(freqbuf, "F%.6f" EOM, freq/1e6); - + retval = write_block(&rs->rigport, freqbuf, freq_len); return retval; @@ -313,7 +313,7 @@ int rx340_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) if (buf_len < 2 || buf[0] != 'F' || num_sscanf(buf+1, "%lf", &f) != 1) return -RIG_EPROTO; - + *freq = f*1e6; return RIG_OK; @@ -378,7 +378,7 @@ int rx340_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) if (buf_len < 4 || buf[0] != 'D' || buf[2] != 'I') return -RIG_EPROTO; - + switch (buf[1]) { case RX340_USB: *mode = RIG_MODE_USB; break; case RX340_LSB: *mode = RIG_MODE_LSB; break; @@ -397,7 +397,7 @@ int rx340_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) if (num_sscanf(buf+3, "%lf", &f) != 1) return -RIG_EPROTO; - + *width = f*1e3; return RIG_OK; @@ -434,7 +434,7 @@ int rx340_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_RF: cmd_len = sprintf(cmdbuf, "A%d" EOM, 120-(int)(val.f*120)); break; - + case RIG_LEVEL_SQL: cmd_len = sprintf(cmdbuf, "Q%d" EOM, 150-(int)(val.f*150)); break; diff --git a/tentec/rx350.c b/tentec/rx350.c index b91124f79..a6af4defe 100644 --- a/tentec/rx350.c +++ b/tentec/rx350.c @@ -2,21 +2,20 @@ * Hamlib TenTenc backend - RX-350 description * Copyright (c) 2003-2004 by Stephane Fillod * - * $Id: rx350.c,v 1.1 2004-05-03 22:33:13 fillods 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 - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -41,7 +40,7 @@ RIG_LEVEL_AF|RIG_LEVEL_AGC| \ RIG_LEVEL_SQL|RIG_LEVEL_ATT) -#define RX350_ANTS (RIG_ANT_1) +#define RX350_ANTS (RIG_ANT_1) #define RX350_PARMS (RIG_PARM_TIME) @@ -53,7 +52,7 @@ /* * RX350 receiver capabilities. * - * Protocol is documented at + * Protocol is documented at * http://www.rfsquared.com/ * * Only set_freq is supposed to work. diff --git a/tentec/tentec.c b/tentec/tentec.c index e009395ff..dd7bff953 100644 --- a/tentec/tentec.c +++ b/tentec/tentec.c @@ -2,21 +2,20 @@ * Hamlib Tentec backend - main file * Copyright (c) 2001-2009 by Stephane Fillod * - * $Id: tentec.c,v 1.19 2009-01-11 12:42:24 fillods 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 - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -149,7 +148,7 @@ int tentec_trx_open(RIG *rig) int retval; /* - * be kind: use XX first, and do 'Dsp Program Execute' only + * be kind: use XX first, and do 'Dsp Program Execute' only * in " DSP START" state. */ retval = tentec_transaction (rig, "P1" EOM, 3, NULL, NULL); @@ -176,12 +175,12 @@ static void tentec_tuning_factor_calc(RIG *rig) /* computed fcor only used if mode is not CW */ fcor = (int)floor((double)priv->width / 2.0) + 200; - + switch (priv->mode) { case RIG_MODE_AM: case RIG_MODE_FM: mcor=0; break; - case RIG_MODE_CW: + case RIG_MODE_CW: mcor=-1; cwbfo = priv->cwbfo; fcor = 0; break; case RIG_MODE_LSB: mcor=-1; break; @@ -219,11 +218,11 @@ int tentec_set_freq(RIG *rig, vfo_t vfo, freq_t freq) priv->freq = freq; tentec_tuning_factor_calc(rig); - freq_len = sprintf(freqbuf, "N%c%c%c%c%c%c" EOM, + freq_len = sprintf(freqbuf, "N%c%c%c%c%c%c" EOM, priv->ctf >> 8, priv->ctf & 0xff, priv->ftf >> 8, priv->ftf & 0xff, priv->btf >> 8, priv->btf & 0xff); - + retval = write_block(&rs->rigport, freqbuf, freq_len); if (retval != RIG_OK) { priv->freq = old_freq; @@ -287,7 +286,7 @@ int tentec_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) return -RIG_EINVAL; } - /* backup current values + /* backup current values * in case we fail to write to port */ saved_mode = priv->mode; @@ -301,7 +300,7 @@ int tentec_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) mdbuf_len = sprintf(mdbuf, "W%c" EOM "N%c%c%c%c%c%c" EOM "M%c" EOM, - ttfilter, + ttfilter, priv->ctf >> 8, priv->ctf & 0xff, priv->ftf >> 8, priv->ftf & 0xff, priv->btf >> 8, priv->btf & 0xff, @@ -358,12 +357,12 @@ int tentec_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) return retval; case RIG_LEVEL_AF: - /* FIXME: support also separate Lineout setting + /* FIXME: support also separate Lineout setting * -> need to create RIG_LEVEL_LINEOUT ? */ cmd_len = sprintf(cmdbuf, "C\x7f%c" EOM, (int)((1.0 - val.f) * 63.0)); retval = write_block(&rs->rigport, cmdbuf, cmd_len); - if (retval == RIG_OK) + if (retval == RIG_OK) priv->lnvol = priv->spkvol = val.f; return retval; @@ -371,12 +370,12 @@ int tentec_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) priv->pbt = val.i; retval = tentec_set_freq(rig, vfo, priv->freq); return retval; - + case RIG_LEVEL_CWPITCH: priv->cwbfo = val.i; if(priv->mode == RIG_MODE_CW) { retval = tentec_set_freq(rig, vfo, priv->freq); - } + } return retval; default: diff --git a/tentec/tentec.h b/tentec/tentec.h index 52081aa15..923a27047 100644 --- a/tentec/tentec.h +++ b/tentec/tentec.h @@ -3,19 +3,20 @@ * Copyright (c) 2001-2010 by Stephane Fillod * * - * This library is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * */ /** @@ -40,7 +41,7 @@ struct tentec_priv_data { freq_t freq; /*!< tuned frequency */ pbwidth_t width; /*!< filter bandwidth in Hz */ int cwbfo; /*!< BFO frequency: 1000 [0-2000Hz] */ - int pbt; /*!< Passband Tuning, IF shift: 0 [-2000Hz to 2000Hz] */ + int pbt; /*!< Passband Tuning, IF shift: 0 [-2000Hz to 2000Hz] */ float lnvol; /*!< line-out volume: 30 [0..63] */ float spkvol; /*!< speaker volume: 30 [0..63] */ int agc; /*!< AGC: medium */ diff --git a/tentec/tentec2.c b/tentec/tentec2.c index 5e50c98e3..f5aa7bdc7 100644 --- a/tentec/tentec2.c +++ b/tentec/tentec2.c @@ -2,21 +2,20 @@ * Hamlib Tentec backend - Argonaut, Jupiter, RX-350 * Copyright (c) 2001-2004 by Stephane Fillod * - * $Id: tentec2.c,v 1.6 2006-10-07 17:38:05 csete 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 - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ /* @@ -27,7 +26,7 @@ * and used on-air. * * Note for anyone wishing to expand on the command set. - * Recommend using the + * Recommend using the * * tentec_transaction (rig, sendbuf, sendlen, rcvbuf, &rcv_len) * @@ -47,7 +46,7 @@ * "Z\r" ----> you need to check for that condition * * The tentec_transaction(...) function will always terminate the rcvbuf with a null - * character. The pointer to the receive buffer length MUST be initialized to the + * character. The pointer to the receive buffer length MUST be initialized to the * length of the max # chars for that command PLUS 1 for the terminator. * For the above command, rcv_len should be 6. */ @@ -122,7 +121,7 @@ int tentec2_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (retval != RIG_OK || ret_len != 2) return -RIG_EINVAL; - + if (freqbuf[0] == 'G') return RIG_OK; @@ -142,7 +141,7 @@ int tentec2_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) if ((retval = tentec2_get_vfo(rig, &vfo)) != RIG_OK) return retval; } - + switch(vfo) { case RIG_VFO_A: break; case RIG_VFO_B: freqbuf[1] = 'B'; break; @@ -157,7 +156,7 @@ int tentec2_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) // or it will respond // "Z\r" meaning the command was rejected ret_len = 9; - + retval = tentec_transaction (rig, freqbuf, strlen(freqbuf), freqbuf, &ret_len); if (retval != RIG_OK) return retval; @@ -166,10 +165,10 @@ int tentec2_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) return -RIG_ERJCTED; if (ret_len < 6) return -RIG_EINVAL; - - *freq = (unsigned int)((freqbuf[1] & 0x0FF) << 24) + - (unsigned int)((freqbuf[2] & 0x0FF) << 16) + - (unsigned int)((freqbuf[3] & 0x0FF) << 8) + + + *freq = (unsigned int)((freqbuf[1] & 0x0FF) << 24) + + (unsigned int)((freqbuf[2] & 0x0FF) << 16) + + (unsigned int)((freqbuf[3] & 0x0FF) << 8) + (unsigned int)(freqbuf[4] & 0x0FF); return RIG_OK; @@ -204,12 +203,12 @@ int tentec2_set_vfo(RIG *rig, vfo_t vfo) } ret_len = 3; - + retval = tentec_transaction (rig, vfobuf, 5, vfobuf, &ret_len); - + if (retval != RIG_OK) return retval; - + if (vfobuf[0] == 'G') return RIG_OK; @@ -224,7 +223,7 @@ int tentec2_get_vfo(RIG *rig, vfo_t *vfo) { int ret_len, retval; unsigned char vfobuf[16] = "?E\r"; - + ret_len = 7; retval = tentec_transaction (rig, (char *) vfobuf, 3, (char *) vfobuf, &ret_len); if (retval != RIG_OK) @@ -237,7 +236,7 @@ int tentec2_get_vfo(RIG *rig, vfo_t *vfo) if (ret_len == 2 && vfobuf[0] == 'Z') return -RIG_ERJCTED; - + if (ret_len != 6) return -RIG_EPROTO; @@ -263,9 +262,9 @@ int tentec2_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) retbuf[1] = 1; else retbuf[1] = 0; - + ret_len = 3; - retval = tentec_transaction( rig, retbuf, 4, retbuf, &ret_len ); + retval = tentec_transaction( rig, retbuf, 4, retbuf, &ret_len ); if (retval != RIG_OK) return retval; @@ -273,7 +272,7 @@ int tentec2_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) if (ret_len == 2 && retbuf[0] == 'Z') return -RIG_ERJCTED; - return RIG_OK; + return RIG_OK; } /* @@ -302,7 +301,7 @@ int tentec2_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo) if (ret_len != 4) return -RIG_EPROTO; - + *split = splitbuf[1] == 0 ? RIG_SPLIT_OFF : RIG_SPLIT_ON; return RIG_OK; @@ -333,10 +332,10 @@ int tentec2_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) } ttmode_a = ttmode_b = ttmode; - + strcpy((char *) mdbuf, "*M00\r" ); ret_len = 3; - mdbuf[2] = ttmode_a; mdbuf[3] = ttmode_b; + mdbuf[2] = ttmode_a; mdbuf[3] = ttmode_b; retval = tentec_transaction (rig, (char *) mdbuf, 5, (char *) mdbuf, &ret_len); if (retval != RIG_OK) @@ -363,12 +362,12 @@ int tentec2_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) mdbuf[2] = ttfilter; ret_len = 3; retval = tentec_transaction (rig, (char *) mdbuf, 5, (char *) mdbuf, &ret_len); - + if (retval != RIG_OK) return retval; if (ret_len == 2 && mdbuf[0] == 'Z') return -RIG_ERJCTED; - + return RIG_OK; } @@ -428,7 +427,7 @@ int tentec2_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) ttfilter = mdbuf[1]; if (ttfilter < 0 || ttfilter > 36) return -RIG_EPROTO; - + if (ttfilter < 16) *width = (ttfilter + 4) * 50; else @@ -447,15 +446,15 @@ int tentec2_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) int retval, ret_len; char retbuf[10]; - ret_len = 3; - retval = tentec_transaction ( rig, - ptt==RIG_PTT_ON? "#1\r" : "#0\r", 3, + ret_len = 3; + retval = tentec_transaction ( rig, + ptt==RIG_PTT_ON? "#1\r" : "#0\r", 3, retbuf, &ret_len); if (retval != RIG_OK) return retval; if (ret_len == 2 && retbuf[0] == 'G') return RIG_OK; - + return -RIG_ERJCTED; } diff --git a/tentec/tentec2.h b/tentec/tentec2.h index d6171b298..b2aea3550 100644 --- a/tentec/tentec2.h +++ b/tentec/tentec2.h @@ -2,21 +2,20 @@ * Hamlib Tentec backend - Argonaut, Jupiter, RX-350 header * Copyright (c) 2001-2003 by Stephane Fillod * - * $Id: tentec2.h,v 1.1 2003-05-12 22:29:59 fillods 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 - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ diff --git a/tentec/tt550.c b/tentec/tt550.c index 995c415c5..1fd164563 100644 --- a/tentec/tt550.c +++ b/tentec/tt550.c @@ -1,23 +1,23 @@ /* * Hamlib Tentec Pegasus TT550 backend - main file - * - * This library is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * * Heavily modified for 550 support from the original tentec.c - * (c) Oct 2002, Jan,Feb 2004- Ken Koster N7IPB + * (c) Oct 2002, Jan,Feb 2004- Ken Koster N7IPB + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * */ #ifdef HAVE_CONFIG_H @@ -93,7 +93,7 @@ tt550_transaction (RIG * rig, const char *cmd, int cmd_len, char *data, } /* - * no data expected, TODO: flush input? + * no data expected, TODO: flush input? */ if (!data || !data_len) { Unhold_Decode (rig); @@ -144,7 +144,7 @@ tt550_tx_control (RIG * rig, char oper) * This function controls the tuner operations. * * - * The LDG tuner listens on the Pegasus' RS-232 + * The LDG tuner listens on the Pegasus' RS-232 * Rx Data line. The interface is one-way. The tuner can't * respond at all. The Pegasus will respond with Z when * it sees the commands meant for the tuner. This is normal. @@ -704,7 +704,7 @@ tt550_set_rx_mode (RIG * rig, vfo_t vfo, rmode_t mode, pbwidth_t width) } /* - * backup current values in case we fail to write to port + * backup current values in case we fail to write to port */ saved_mode = priv->rx_mode; saved_width = priv->width; @@ -803,7 +803,7 @@ tt550_set_tx_mode (RIG * rig, vfo_t vfo, rmode_t mode, pbwidth_t width) } - /* + /* * The tx filter array contains just the allowed filter values, but the * command assumes that the first allowed value is at offset 7. We add * 7 to compensate for the array difference @@ -971,7 +971,7 @@ tt550_set_level (RIG * rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_ATT: /* - * attenuator is either on or off + * attenuator is either on or off */ cmd_len = sprintf (cmdbuf, "B%c" EOM, val.i < 15 ? '0' : '1'); retval = write_block (&rs->rigport, cmdbuf, cmd_len); @@ -1242,7 +1242,7 @@ tt550_get_ptt (RIG * rig, vfo_t vfo, ptt_t * ptt) /* * The 550 doesn't have an explicit command to return ptt status, so we fake it * with the request for signal strength which returns a 'T' for the first - * character if we're transmitting + * character if we're transmitting */ len = 7; retval = tt550_transaction (rig, "?S" EOM, 3, buf, &len); diff --git a/tentec/tt550.h b/tentec/tt550.h index 48505ac47..b79426854 100644 --- a/tentec/tt550.h +++ b/tentec/tt550.h @@ -2,21 +2,20 @@ * Hamlib Tentec backend - main header * Copyright (c) 2001-2004 by Stephane Fillod * - * $Id: tt550.h,v 1.1 2004-02-09 22:11:08 fillods 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 - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -55,7 +54,7 @@ #define DISABLE_KEEPALIVE '8' #define ENABLE_KEEPALIVE '9' -/* This is needed until we come up with a way to guarantee that the +/* This is needed until we come up with a way to guarantee that the ** KEEPALIVE mechanism of the Pegasus is met. */ #define BYPASS_KEEPALIVE 1