Wykres commitów

491 Commity (a3522a627fc4a7f6086b0c0ab659d9f088ded064)

Autor SHA1 Wiadomość Data
Michael Black W9MDB 21a6909a9a Add Barrett 2050 backend 2017-07-04 12:50:23 -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
Jeroen Vreeken 70127b6b9c Add Dorji DRA818 modules (VHF and UHF variants)
Also works with NiceRF SA818 modules
2017-02-22 12:14:50 +01:00
Jae Stutzman dfd969acd3 Use Windows ioctlsocket to avoid buffer overrun 2017-01-26 19:42:00 -06:00
Jae Stutzman 230430c4e9 Clears potential garbage data in read buffer prior to command being sent 2017-01-25 20:45:24 -06:00
Michael Tatarinov 7848d49a53 Fix typos. 2016-12-18 08:17:54 +04: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
Bill Somerville 4e53f99e51 Adjust rig_list_foreach to allow use for unregistering
This patch changes rig_list_foreach such  that the called function may
call rig_unregister without having to access freed memory. This avoids
a valgrind  MemCheck and makes  it possible  to clean up  teh rig_list
database.
2016-06-10 01:13:57 +01:00
Nate Bargmann bf2b5c80ba Merge branch 'master' of http://video.vreeken.net/~pe1rxq/hamlib-code 2016-06-05 11:43:53 -05:00
Michael Black W9MDB\n d5b3c049af Fixed SCAN_STOP for all rigs and implmented it plus SCOPE for ic7300 2016-06-02 23:08:22 -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
Nate Bargmann 0db862e560 Apply Linux C Style to parallel.c 2016-02-21 15:06:16 -06:00
Nate Bargmann 6a3214fd43 Apply Linux C style
Update files modified to support libusb-1.0.
2016-02-21 14:56:44 -06:00
Nate Bargmann 07353e1f80 Fix compiler warnings with x86_64-w64-mingw32-gcc
Compiling for Windows 64 resulted in several warnings.  Correct them by
using proper Windows function calls rather than casts.
2016-02-20 11:44:19 -06:00
Nate Bargmann 9ec98e0fe3 Check for libusb-1.0/libusb.h
Some distributions--Debian and Alpine tested--put libusb.h under the
libusb-1.0 directory.  Test for its presence and if found define
HAVE_LIBUSB_1_0_LIBUSB_H.  Also test for HAVE_LIBUSB or
HAVE_LIBUSB_1_0_LIBUSB_H and conditionally include the correct header
file in the sources.
2016-02-15 08:10:07 -06:00
Stephane Fillod 8d7697c3bd Migrating from libusb-0.1 to libusb-1.0 2016-02-14 18:02:26 +01:00
Michael Black 61a0e77110 Fix port->pathname checks
Was always true since it's statically allocated

RRR
Mike W9MDB
2016-02-09 10:59:09 -06:00
Bill Somerville fca48348a6 Add missing configuration getters 2016-02-04 09:09:35 -06:00
Dario Ventura 46fe57190e New Prosistel rotor backend from IZ7CRX
This is patch adding prosistel rotator backend.
Simply reading and setting azimuth for now.

73,
Dario Iz7crx
2015-12-31 08:25:14 -06:00
Bill Somerville aebe52a45e Add a new command line option '--no-restore-ai' ('-n') to rigctl
As Hamlib now restores the rig auto information state (AI) on exit
there is now a need to disable that functionality so that rigctl can
be used to set/reset AI mode on the rig explicitly.

A new  public API  function 'rig_no_restore_ai()'  is also  added that
allows any  client to  disable this auto  AI restore  functionality if
required. Most  clients should do nothing  as restoring AI state  is a
good thing.
2015-12-04 00:22:01 +00:00
Bill Somerville ca7cbd89f4 Fix compiler warnings 2015-11-27 19:17:47 +00:00
Bill Somerville 181a3e9697 Proper IPv6 and dual stack networking
This means that rigctl & rigctld  now work with default arguments on a
modern Windows  machine with dual  stack and localhost being  [::1] as
the first interface returned by getaddrinfo().

Try all the interfaces return by DNS lookups to establish a connection
or listening  port. Handle  Windows network  errors correctly  so that
meaningful messages are printed.

The rigctl program now accepts  IPv6 numeric addresses in the portname
field like [<addr>}:<port> for example  the IPv6 loopback on port 4531
would be [::1]:4531.
2015-11-27 13:47:48 +00:00
Nate Bargmann ffe3126a85 Make cnctrk visible to rotctl
After all these years one would think I would remember to read the
directions for all the steps involved.  Ummm, nope!

cnctrk is now visible to rotctl.
2015-08-22 11:21:23 -05:00
Michael Black e780f2dc66 Flush the debug stream
Testing under JTSDK MSYS environment debug info was not being seen while
running rigctl -vvvv

Adding a flush to the debug stream fixes it.

Mike W9MDB
2015-05-07 17:13:44 -05: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 143f305b49 Further clarification in the implementation of kenwood_transaction()
Buffer size is  now an input parameter only as  the return data length
is  implicit since  a null  terminated C  string is  returned.  Better
precondition checks are impelmented.
2015-02-16 12:46:35 +00:00
Stephane Fillod 80f921954b New IC-M700PRO backend
Backend for the ICOM IC-M700PRO marine transceiver.
2015-01-21 23:57:08 +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 82b8649030 Revert read_string() to partial results are a success status
The read_string() function was changed to return a -RIG_ETIMEOUT error
when timing out after having read  some characters. This caused a back
end to fail because it was  using a read_string() with an invalid stop
character  and relying  on the  timed out  read_string() to  fetch the
data. This  patch reverts to  the prior  behavior of returning  a null
terminated buffer and  read bytes count if at least  one byte has been
read.
2014-12-10 01:25:33 +00:00
Bill Somerville 849f1e1bf8 Fix serial i/o on Windows.
Fix bytes read count accumulation in Windows serial I/O.

read_string  from  communications  port   doesn't  handle  timeout  on
anything but the first character read.

Honour VMIN tty parameter correctly.
2014-11-30 11:22: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
Nate Bargmann 870da0a422 Merge branch 'serial-contro-line-error-fix'
of git://git.code.sf.net/u/bsomervi/hamlib
2014-10-18 07:37:20 -05:00
Bill Somerville cd44a8d926 Only check for serial control line conflicts if PTT shares CAT port 2014-10-14 12:51:23 +01:00
Nate Bargmann c38dfb97aa Quell compiler warning--missing parens
Got too quick on the trigger on the previous commit.  Added compiler
requested parentheses around AND test for previous commit.
2014-10-12 09:17:31 -05:00
Veijo Arponen 89ebe6bc84 Add support for DMK Engineering URI
I have a problem with the CM119A GPIO. The PTT line of the DMK
Engineering URI was not activated by the hamlib  when using fldigi or
rigctl.

I fiddled with the source code and managed to edit the code in cm108.c
to get the PTT-line activate on my URI-box.
A successful rigctl command is:

rigctl -p /dev/hidraw0 -C ptt_pathname=/dev/hidraw0,ptt_type=CM108,ptt_bitnum=2
Attached is the modified source code file and a patch in 'git diff'
format.

The version of origin is 1.2.15.3.

73 de Veijo OH3NFC

Signed-off-by: Nate Bargmann <n0nb@n0nb.us>
2014-10-12 09:05:25 -05: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
Nate Bargmann 6ea09a138a Clean up build system, fix test programs
Clean up various left over commented lines from dlopen to single
libhamlib transition.  Remove unneeded configure variables.

Correct minor inconsistencies in Makefile.am files.

Define a new variable, READLINE_LIBS, so that only programs that offer
Readline support are linked against it.

Fix various compilation warnings and errors in test files revealed with
'make check' on MinGW.

Define rig and rotor backends to (mostly) be built in alphabetical
order.
2013-12-10 20:14:22 -06:00