Wykres commitów

146 Commity (ab3e6bb5a59df1ab1681938420e64ff82d25753e)

Autor SHA1 Wiadomość Data
Nate Bargmann ab3e6bb5a5 Formatted src/ to final coding guidelines 2017-10-04 21:32:08 -05:00
Jaroslav Skarvada 9693cce0b3 Fix serial_port DCD squelch
Hi,

I had trouble with CTS serial port squelch (on microHAM USB Interface III).
It seems there is a bug in the hamlib code and I think the similar thing
should be done as has been done for the pttport, i.e. if the dcdport is
the same as the rigport, do not reopen it. Otherwise the serial port will
be reset to its default and it will key the radio PTT forever (because
the RTS line is reset on the port reopen). Patch attached

73! Jaroslav, OK2JRQ
2017-09-10 21:04:55 -05:00
Bill Somerville 80a4097aba Add best guess transmit status to rig state structure
This flag can  be used by back  ends that need to  take special action
while the  rig is transmitting e.g.  the FT-747GX and similar  that do
not process CAT commands while transmitting.

The flag  is also used as  a default answer to  rig_get_ptt if nothing
better is available.

Deal with inaccurate CAT query for Rx/Tx on the Yaesu FT-847

This rig  doesn't set the Rx/Tx  status flag when PTT  is asserted via
the PTT pin on the rear PACKET  socket so we need to override which we
can do if we known we have asserted PTT via rig_set_ptt().

Adjust style and fix set PTT defects

Fix a warning from a declaration of a deleted function definition
2017-08-09 21:54:50 -05:00
Nate Bargmann f76b354588 Reformatted src directory 2017-08-09 06:14:31 -05:00
c vw fc6d87addf Do not set DTR/RTS on dedicated PTT port if it is already closed. 2017-05-29 09:37:32 +02:00
Bill Somerville 62fb76019f Fix a state machine defect with repeated PTT reset calls
When the PTT serial  port is not the control port  the intention is to
free the port  when PTT is reset so that  other applications can share
it. This logic  was faulty with attempts to call  port functions on an
unopened port when repeatedly calling the rig_set_ptt API.

Thanks to Christoph van Wullen, DL1YCF, for finding and analyzing this
defect.
2017-02-27 13:02:04 +00:00
Michael Black 199111bcc4 Changed some modules to LGPL in lieu of GPL 2016-10-31 11:05:24 -05:00
Nate Bargmann 234122bb50 Merge pull request #25 from mdblack98/master
Expose version and licensing via function calls
2016-08-31 20:46:18 -05:00
Bill Somerville e44566e8a7 Release the serial port used for PTT when possible
When  using  separate  serial port  for  PTT  via  RTS  pr DTR  it  is
convienent to close  the port when the PTT line  is not asserted. This
allows other applications to share the PTT serial port.

This has been  achieved by ensuring that file descriptor  for the port
is set to -1 when the port  is closed, this then allows the invalid FD
to be used as a PTT surrogate for the rig_get_ptt API when the port is
only being used for PTT.
2016-08-31 22:34:09 +01:00
Michael Black da40941d7f Merge branch 'master' of https://github.com/N0NB/hamlib 2016-08-31 09:22:13 -05:00
Michael Black 15b3e73e7f Exposed constants via function calls 2016-08-31 09:05:47 -05:00
Jeroen Vreeken 3ee7b68d42 Add missing breaks and improve error messages 2016-05-30 14:12:01 +02:00
Jeroen Vreeken 1bf736d650 Add support for GPIO PTT. 2016-05-28 16:00:03 +02:00
Bill Somerville 222ad74de7 Add RIG_PASSBAND_NOCHANGE as possible set_{split_,split_freq_,}mode argument
This change  allows the set_mode  functions to leave the  rig passband
unchanged  if required.  For the  few rigs  that do  not have  explcit
passband width control either current state is read and rewritten or a
"normal" width  is chosen e.g. select  a normal width when  there is a
choice like CW and CW-NARROW.
2016-04-19 21:27:52 +01:00
Bill Somerville 21c346453a Implement combined split VFO frequency and mode setting.
CAT protocols that don't allow  direct addressing of VFOs require that
the  "other" VFO  be queried  or set  via a  select then  get/set then
select back  to original or  swap then  get/set then swap  again. When
both frequncy and  mode need to be set the  sequences can be optimized
if a single funciton is avaiable.

This enhancement adds those single functions rig_set_split_freq_mode()
and  rig_get_split_freq_mode()  with  a default  impelementation  that
calls the individual rig_{get,set}_split_{freq,mode}() functions. Back
ends  can choose  to  implement  an optimized  version  which is  used
instead of the default if present.

Using these  functions when  an optimized implementation  is available
allows the TX VFO's frequency and mode to be set in a single operation
with  only  one   VFO  exchange  or  selection  either   side  of  the
operation.  Many CAT  protocols  are very  efficient  when getting  or
setting both  frequency and mode  and some even  combine the two  in a
single command.

The letters 'K' and 'k' are used for the rigctl short command name for
these functions.
2016-03-23 17:09:26 +00:00
Bill Somerville cf65505511 Honour any error status from serial port calls
The  previous commit  introduced  a regression  that  masks any  error
return from  opening the serial  port used for  PTT when that  port is
different from the CAT serial port.
2015-04-22 22:16:35 +01:00
Bill Somerville de3fccf033 Lower both RTS and DTR on alternate PTT serial port
Before this  change only the  line used for  PTT was being  lowered on
open.   It is  necessary for  platforms  other than  Windows to  avoid
issues with other uses of the line not used for PTT such as interfaces
that wire-or RTS and DTR together or use it for CW or FSK keying. This
is because  platforms other  than Windows  raise both  DTR and  RTS on
serial port opening.

Also changed  code that opens CAT  port to lower  RTS or DTR if  it is
used for PTT. In this case there is no need to lower the other line of
DTR  or RTS  as there  is  already a  config parameter  to control  it
(dtr_state or rts_state). This change is necessary to maintain current
functionality.
2015-04-16 23:59:43 +01:00
Bill Somerville ddb0a12403 Use correct argument type for serial control line functions
The serial port  line control functions take a boolean  argument not a
ptt_t argument.   Changed usage in  rig_open() to use a  explicit zero
instead of RIG_PTT_OFF  value which only coincidentally  happens to be
zero.
2015-04-14 10:04:31 +01:00
Bill Somerville 36b8a972cf Error checks on simulated direct VFO addressing
Many APIs  emulate direct VFO  addressing by using  caps->set_vfo() or
caps->vfo_op(..., RIG_OP_TOGGLE)  to simulate  direct addressing  of a
non-current  VFO. The  mirrored function  call to  revert back  to the
original  current  VFO was  not  checking  for  errors.  This  is  not
unreasonable but it turns out that some rigs can arbitarily fail doing
VFO changes or swaps (e.g. Yaesu FT-450).

I have added checks to these calls but only fail with the error if the
API call being wrapped does not fail itself. This allows the mirroring
VFO  operation to  be  completed,  if possible,  even  if the  wrapped
function could not be completed,  hence as before, making every effort
not to change the rig state unnecessarily.
2014-12-11 17:14:58 +00:00
Bill Somerville 4e2a6adf12 Move serial line control error checks to lower level routines
Moved in preference to introducing errno.h into rig.c.
2014-11-24 00:51:12 +00:00
Bill Somerville 0e0779877d Add more diagnostics and error checks to serial line control 2014-11-24 00:18:48 +00:00
Bill Somerville e1a0e9121c Always clear serial control lines when used for PTT
When a serial  control line (DTR or  RTS) is used for  PTT control the
rig_open()  function clears  the PTT  control line  after opening  the
port. This  is necessary on Linux  because opening the port  sets them
both as part  of the normal RS-232 protocol. The  lines were not being
cleared when the PTT port was the same port as the CAT control port.
2014-11-21 20:58:18 +00:00
Bill Somerville cd44a8d926 Only check for serial control line conflicts if PTT shares CAT port 2014-10-14 12:51:23 +01:00
Bill Somerville 19f131b1b8 Remove redundant RIG_PTT_SERIAL_CAT enum from ptt_t
The Icom IC-7100 back end added this enum instead of using the extant
RIG_PTT_RIG enum.  Also the rig_get_ptt() implementation didn't handle
it and errored out.

Note: RIG_PTT_SERIAL_CAT was added in commit
e9ee671149  - N0NB
2014-10-09 10:25:38 -05:00
Nate Bargmann 0fa8a5656c Quell warning from MinGW on setting CM108 pttbitnum
MinGW was issuing the following warning:

  CC     rig.lo
rig.c: In function 'rig_init':
rig.c:330:36: warning: assignment makes integer from pointer without a cast [enabled by default]
  rs->rigport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM;
                                    ^

The constant DEFAULT_CM108_PTT_BITNUM was being defined as a string on
non-linux platforms.  Now defined to an integer on these platforms.  The
actual value may need to be corrected at some point in the future when
CM108 support is completed for those platforms.
2014-02-16 07:33:42 -06:00
mvcstroomer e9ee671149 Add Icom IC-7100 support.
From Martin, CT1IQI:

"Several programs under Linux rely on Hamlib for control. I wanted to
try WSJT-X (digital modes like JT65) and found that my new IC-7100 was
not yet supported, also after having compiled the current git version of
Hamlib and having compiled WSJT-X against that.

So I added a IC-7100 by taking the ic-7200 and 7420 rig files as
example, be it without going (yet) through all of the very many commands
the ic-7100 supports.

This produced the situation where there was communication, e.g. setting
and reading frequencies, but the PTT control did not work.  I debugged
that to actually the lack of a PTT mode in Hamlib that uses serial and
CAT at the same time; currently PTT per 'serial' seems equivalent to
toggling certain RS232 pins but not to any serial command level. So I
added a RIG_PTT_SERIAL_CAT mode for PTT control. Now the wsjt-x program
works nicely with the ic-7100 and controls both frequency and PTT via
the single USB cable."

Signed-off-by: Nate Bargmann <n0nb@n0nb.us>
2013-10-25 08:40:36 -05:00
Bill Somerville efd1917e98 Fix rig_open not failing when PTT/DCD port is unavailable.
rig_open was giving RIG_DEBUG_ERR messsages if PTT or DCD
port was unavailable but the function was not returning an
error status.

Signed-off-by: Nate Bargmann <n0nb@n0nb.us>
2013-09-21 21:14:11 -05:00
Bill Somerville ef28e435d8 Patch to allow same serial port for PTT and CAT.
Hi,

patch attached to enable the above which was partially coded but not
quite working.

73
Bill
G4WJS.

>From 9dab3a250dfad7203772df91aadf79d38c108f04 Mon Sep 17 00:00:00 2001
From: Bill Somerville <bill@classdesign.com>
Date: Fri, 6 Sep 2013 01:13:34 +0100
Subject: [PATCH] Fix using same serail port for PTT and CAT

src/rig.c was coded to allow the same serial port for PTT and
CAT but them tried to open the port twice. I have added code
to share the file descriptor in this situation.

Signed-off-by: Nate Bargmann <n0nb@n0nb.us>
2013-09-18 12:34:20 -05:00
Kamal Mostafa 3466512dbd Fix spelling errors 2012-08-21 19:54:50 -07:00
Stephane Fillod 46033db165 CM108 GPIO PTT: do not break ABI
Move around the ptt_bitnum field in the union of hamlib_port_t.
Increase Hamlib frontend revision.
2012-01-11 23:28:01 +01:00
Andrew Errington 1a77ef9eb9 Initial support for CM108 GPIO contorl of PTT
Signed-off-by: Nate Bargmann <n0nb@n0nb.us>
2012-01-11 06:16:51 -06:00
Nate Bargmann b31cc6ecd9 Assure NULL terminated strings in src files.
Various strncpy operations could result in a port pathname that is not a
NULL terminated string as the allowed string length is the same size as
the buffer per the strncpy manual page.  This is corrected by assuring
that the allowed length is FILPATHLEN - 1.
2012-01-07 20:50:34 -06:00
Stephane Fillod da80137819 Add support for RIG_PORT_UDP_NETWORK
Also some copyright year update,
and default serial device on MacOSX
2012-01-06 09:28:24 +01:00
Nate Bargmann dad27d1f69 Update LGPL header in src source files.
TNX to Lucian Laga, YO6PLB, for the notification.
2011-08-22 21:38:37 -05:00
Stephane Fillod 421909bad2 Let set_ptt() select source, either TX mic or TX data 2011-07-20 00:09:50 +02:00
Stéphane Fillod, F8CFE 5c24ee2925 Workaround SF#3055689
* make sure the PTT is not set when configured as RTS/DTR at open()/close() time.
  It appears the Linux kernel force their value as explained here[1] during open.
  Also obvious when reading the source code[2], esp. in uart_startup() 
  and uart_update_termios() where uart_set_mctrl(port, TIOCM_DTR | TIOCM_RTS) 
  is called.

[1] http://books.google.fr/books?id=75eeBNcjcuIC&lpg=PA152&ots=Qvgi6VDLvm&pg=PA152#v=onepage&q&f=false
[2] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=drivers/serial/serial_core.c;hb=HEAD

* don't let the OS change modem signals at close() time


git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2983 7ae35d74-ebe9-4afe-98af-79ac388436b8
2010-09-17 14:46:16 +00:00
Stéphane Fillod, F8CFE b818045a0a - better portability check with HAVE_SIGACTION
- fix segfault when doing rig_set_trn(POLL->OFF->POLL)
- implement remove_trn_rig()/remove_trn_poll_rig() for rig_set_trn(TRN_OFF)


git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2956 7ae35d74-ebe9-4afe-98af-79ac388436b8
2010-08-21 11:37:58 +00:00
Stéphane Fillod, F8CFE 6feb18f611 use ptt port pathname same as rig port pathname when unset and rig is type serial
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2915 7ae35d74-ebe9-4afe-98af-79ac388436b8
2010-05-17 22:20:58 +00:00
Stéphane Fillod, F8CFE 453995e7c0 fix segfault and allow mode listing in rigctl
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2865 7ae35d74-ebe9-4afe-98af-79ac388436b8
2010-04-05 10:01:09 +00:00
Kamal Mostafa, KA6MAL 5e21991a28 Hard-code length of hamlib_version and hamlib_copyright strings
to stay compliant with hamlib 1.2 ABI and avoid spurious "consider
relinking" warnings from dynamic loader.



git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2839 7ae35d74-ebe9-4afe-98af-79ac388436b8
2010-02-27 16:09:07 +00:00
Nate Bargmann, N0NB 6763e8e750 Fixed long path calculation in azimuth_long_path() in locator.c
Spelling edits and removal of space at the end of lines in rig.c



git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2829 7ae35d74-ebe9-4afe-98af-79ac388436b8
2010-02-14 21:47:49 +00:00
Stéphane Fillod, F8CFE 46289ed58e convert parallel ptt to cwdaemon interface(STROBE+INIT)
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2747 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-11-01 18:48:27 +00:00
Stéphane Fillod, F8CFE bbafe261fd factorize port_open/port_close, fix a bug when setting RTS/DTR
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2729 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-09-14 07:49:04 +00:00
Stéphane Fillod, F8CFE 976540de77 set/get_split_{freq,mode} assisted by frontend
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2655 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-02-20 14:14:31 +00:00
Stéphane Fillod, F8CFE b3037797c8 fix error code in rig_mW2power()
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2515 7ae35d74-ebe9-4afe-98af-79ac388436b8
2008-12-16 22:40:32 +00:00
Stéphane Fillod, F8CFE ab24cf45e3 MinGW network fixes
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2472 7ae35d74-ebe9-4afe-98af-79ac388436b8
2008-11-05 23:02:00 +00:00
Stéphane Fillod, F8CFE 30245bf73a resolve normal passband where available in rig_get_mode/rig_get_split_mode
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2445 7ae35d74-ebe9-4afe-98af-79ac388436b8
2008-10-31 23:08:59 +00:00
Stéphane Fillod, F8CFE 2492903ea9 accept partial 'pathname' for PORT_NETWORK
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2406 7ae35d74-ebe9-4afe-98af-79ac388436b8
2008-09-23 22:02:40 +00:00
Stéphane Fillod, F8CFE 0e7d1eacea implementation of PORT_NETWORK
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2395 7ae35d74-ebe9-4afe-98af-79ac388436b8
2008-09-21 19:30:35 +00:00
Stéphane Fillod, F8CFE 6f4705fc20 BUG#2106524: allow backend specific override get_ptt even if RIG_PTT_SERIAL_DTR (e.g. FT757GXII)
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2379 7ae35d74-ebe9-4afe-98af-79ac388436b8
2008-09-12 11:49:32 +00:00