Commit graph

97 commits

Author SHA1 Message Date
Michael Black
da3059fb07 Add get_dcd to swg bindings 2020-02-07 23:03:29 -06:00
Michael Black
04ff3dee97 Fix get_ant for bindings 2020-02-07 12:29:47 -06:00
Michael Black
d853c36fb3
Change get_ant to add another option for icom rigs (and others if needed) 2020-01-21 17:53:12 -06:00
Michael Black
09b5d87449
Fix lua bindings for 64-bit compilation
Tested on swig 4.0.1 and lua 5.3.5
2020-01-19 11:15:44 -06:00
Gisle Vanem
d1c194bdf6
Enable verbose mode in bindings/pytest.py
Support 'pytest.py -v to show more details.
2019-10-12 01:47:44 +02:00
Bill Somerville
df4ec51909 Simplify SWIG interface definition and hide 64-bit values from Lua binding
By  including the  stdint  SWIG  typemaps we  can  directly use  types
derived from [u]int64_t etc.

Because Lua numbers are  implemented using a double-precision floating
point type and  also because SWIG when generating a  Lua wrappings can
only define  constants from #define and  enum values that fit  into an
'int' type we  must hide any constants that require  more than 32-bits
to represent themselves,  as they cannot be represented  in Lua.  This
applies  to  rmode_t  and  the  RIG_FUNC... defines  at  the  time  of
writing. By  hiding them from  the Lua binding  they will get  a 'nil'
value in Lua i.e. undefined so clients using the Lua binding will know
they are  not there.  This is  a nasty hack  but without  major design
changes to the Hamlib API it is do this or drop the Lua binding.
2018-12-28 20:33:30 +00:00
Nate Bargmann
a8c56853d3 Rename autogen.sh to bootstrap to follow GNU guidelines
Update relevant document files to describe 'boostrap' and 'configure'.
2017-07-27 21:30:13 -05:00
Nate Bargmann
f1c0267867 Apply silent rules to LUA
Use $(LUA) to run luatest.lua.
2017-07-27 16:48:03 -05:00
Nate Bargmann
2ef6d5ce0e Apply silent rules to Perl to the extent possible
Run the perltest.pl script for the check-perl test.
2017-07-27 15:54:57 -05:00
Nate Bargmann
7f76171259 Apply silent rule variables to Python 2017-07-27 15:08:22 -05:00
Nate Bargmann
21a86f429e Fix TCL script test target--check-tcl
Found that when nothing was installed that check-tcl failed with a
failure of tclsh not being able to load the shared library.  Thanks to
assistance from comp.lang.tcl, copying pkgIndex.tcl to $(builddir)/.libs
prior to loading the test script allows the script to load the shared
library immediately after 'make' and before 'make install'.

Prefixed various TCL section target commands with either $(AM_V_GEN) or
$(AM_V_at) to conditionally silence the output of 'make'.
2017-07-27 14:44:40 -05:00
Nate Bargmann
4f9085f8f5 Bindings tweaks for Python and TCL
Remove execute bits for all test scripts and install them into
doc/examples.

Make sure check-py and check-tcl targets work.

Set a conditional for Python3 or Python2 and install/test the correct
script file.

Use Makefile variables instead of configure substitutions wherever
possible.

Generate tcltest.tcl at make time to insert installation library path
into the script so that tests pass.
2017-07-26 06:33:42 -05:00
Nate Bargmann
a2a873bbc9 Update ax_python_devel.m4 macro
Also reorder its call in configure.ac which now allows the PYTHON_VERSION
environment variable to be recognized and processed correctly by the
build system.

Correctly add PYTHON_LIBS (correct ouput variable of AX_PYTHON_DEVEL) to the
Makefile for the Python bindings.

Update README.python for use of PYTHON_VERSION.
2017-07-23 10:52:16 -05:00
Nate Bargmann
6e3b79fc69 Initial Python3 build steps and test script
The increasing popularity of Python3 requires that Hamlib provide a
means of instruction for building and installing its module concurrent
with the Python2 module.  README.python outlines the required steps.
py3test.py is a reworking of the pytest.py script for Python3 syntax.
2017-07-19 21:17:34 -05:00
Ervin Hegedus
b91768360a Added new example to Python demo script (set/get float type level) 2016-12-13 16:28:41 -06:00
Ervin Hegedus
2b657e7c9d Added Lua binding and demo script 2016-12-13 16:28:41 -06:00
Hegedüs Ervin
37cac121f4 Fixed int[10] type variable error in bindings 2016-08-27 21:24:17 +02:00
Hegedüs Ervin
cef8c2d157 Leave off multiply 'typedef const char * const_char_string' definition (in rig.swg and rotator.swg) 2016-05-20 22:46:23 +02:00
Hegedüs Ervin
c7476de364 Check SWIG string functions for some languages 2016-05-20 22:08:10 +02:00
Stephane Fillod
c61fe45b29 New IC-M710 and IC-M802 backends 2015-01-24 18:46:34 +01:00
Richard Shaw
c2337d9597 Fix location of custom Python bindings.
I have a small patch to correct the install location of the python
bindings.

Since it's not a pure python extension is belongs in pyexecdir instead
of pythondir, which for multilib systems like Fedora will get installed
into /usr/lib64/python{ver}/site-packages on 64bit systems.

This is consistent with the automake documentation:

http://www.gnu.org/software/automake/manual/html_node/Python.html

(Patch adjusted by n0nb for Hamlib 3.0 bindings/Makefile.am)

Signed-off-by: Nate Bargmann <n0nb@n0nb.us>
2014-09-08 20:48:38 -05:00
Ervin Hegedus
8c4bb72b99 Fixed SWIG `Setting a const char * variable may leak memory' error 2014-02-03 22:38:48 +01:00
Nate Bargmann
49d2124a03 Binding test scripts--fix set_freq ordering
Due to the changes of the patch contributed by Ervin Hegedüs, correct
the bindings test scripts to work with the corrected ordering of VFO and
frequency arguments.

Also add a call to send_morse() in each script.
2013-02-12 18:51:38 -06:00
Ervin Hegedüs
d9fc9c04d7 rig.swg: New properly formatted macro
I made a patch, you can see in that there is the solution, which
describe the error: if a function in hamlib looks 3 argument
(rig, vfo, any 3rd arg), the order of the 2nd and 3rd argument
were reversed, because the macro METHOD1 reversed them.

I've collected these functions, compared its arguments with
hamlib docs (http://hamlib.sourceforge.net/manuals/1.2.15/), and
where 1st arg is rig, 2nd arg is vfo, and 3rd is any kind of
type, changed to METHOD3, which is a new macro, and keeps the
correct order of original function - see the patch. (I didn't
find any info about the expected diff format, so I just created
the `diff -uprN ORIG NEW'.)

To check my theory, I've tested with another function, which uses
vfo type at 2nd argument, eg. rig_set_freq; here is the Python
code:

  my_rig.set_freq(Hamlib.RIG_VFO_A, 7013200.0)

and the original code drop the exception:

    my_rig.set_freq(Hamlib.RIG_VFO_A, 7012500.0)
  File "/usr/local/lib/python2.7/dist-packages/Hamlib.py", line 2513, in
set_freq
    def set_freq(self, *args): return _Hamlib.Rig_set_freq(self, *args)
TypeError: in method 'Rig_set_freq', argument 3 of type 'vfo_t'

As you can see, it's same as my original error above.

So, after I patched the source and recompiled it again, these two
function works correctly - I will test it at soon, but I think
_this_ is good and stable.

Signed-off-by: Nate Bargmann <n0nb@n0nb.us>
2013-02-12 18:35:03 -06:00
Nate Bargmann
44d99a61cd Build system fixes for the Perl/Python/TCL bindings
Various fixes for building the bindings properly.

Install TCL binding to $(libdir)/tcl/Hamlib, arbitrarily chosen since
there seems to be no standard installation location.  When install
location is changed, tcltest.tcl documents the needed change to a TCL
script.

In the Perl and Python test scripts, improved the QRA examples.  In all
scripts used tabs to line up printed values nicely.

Updated INSTALL and NEWS for recent updates.  Better documented bindings
installation and uninstallation in INSTALL.
2012-11-28 17:11:41 -06:00
Nate Bargmann
aa504fe024 bindings/Makefile.am: Group variables and targets 2012-11-19 14:30:48 -06:00
Nate Bargmann
a62d40647e bindings/Makefile.am: Fix 'make dist'
'make dist' was broken by the previous patch.  Now tell Automake not to
build or distribute Hamlib.py.
2012-11-19 12:10:25 -06:00
Nate Bargmann
00aaaf4c50 configure.ac: Clean up the binding builds a bit.
A Perl file was being compile whether Perl binding was enabled or not.
Fixed that and configured an AM_CONDITIONAL for Perl so its components
will not be built when it is not enabled.
2012-11-17 08:45:16 -06:00
Nate Bargmann
33f25820ac Fix bindings build by replacing *all* INCLUDES! 2012-02-04 07:51:25 -06:00
Nate Bargmann
a5f13e0056 Set AC_PREREQ to 2.67, enable Automake warnings
Deprecate the use of the INCLUDES variable in favor of the AM_CPPFLAGS
variable per Automake warnings and documentation.
2012-02-03 22:09:45 -06:00
Frank Goenninger
f6ea9f1246 Add ADAT ADT-200A backend
Signed-off-by: Stephane Fillod <fillods@users.sf.net>
2012-01-11 23:16:41 +01:00
Stephane Fillod
443cf020e4 add rig_debug() in python binding 2011-09-14 22:43:06 +02:00
Nate Bargmann
a7f758d582 Update LGPL header in bindings source files.
TNX to Lucian Laga, YO6PLB, for the notification.
2011-08-22 21:38:34 -05:00
Stephane Fillod
be74cf0f54 add rotator Celestron/Orion Teletrack Az-G telescope mount 2011-08-21 23:30:41 +02:00
Stephane Fillod
b60c28894a Add IF-100 rotor support 2011-05-26 22:07:26 +02:00
Stéphane Fillod, F8CFE
1d8e24003a added TRM8060
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2997 7ae35d74-ebe9-4afe-98af-79ac388436b8
2010-10-26 20:47:35 +00:00
Stéphane Fillod, F8CFE
a02cf50c71 fix simple make dist
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2906 7ae35d74-ebe9-4afe-98af-79ac388436b8
2010-05-04 22:18:11 +00:00
Stéphane Fillod, F8CFE
3de1b6918d fix build when tcl binding selected but not python
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2903 7ae35d74-ebe9-4afe-98af-79ac388436b8
2010-05-02 21:55:00 +00:00
Stéphane Fillod, F8CFE
30f7124435 declare M2 and ARS backends
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2894 7ae35d74-ebe9-4afe-98af-79ac388436b8
2010-04-25 17:24:25 +00:00
Stéphane Fillod, F8CFE
49f0f17a86 more example code
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2866 7ae35d74-ebe9-4afe-98af-79ac388436b8
2010-04-05 10:10:16 +00:00
Thomas Beierlein, DL1JBE
28eb7c00b0 Fix for python install path. Goes now to .../site-packages where it belongs.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2855 7ae35d74-ebe9-4afe-98af-79ac388436b8
2010-03-14 15:01:09 +00:00
Stéphane Fillod, F8CFE
4c0e471128 SPID backend
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2748 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-11-01 22:03:54 +00:00
Stéphane Fillod, F8CFE
9b363f9c96 Make building tcl-bindings optional
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2684 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-03-23 22:49:45 +00:00
Stéphane Fillod, F8CFE
28b80e4931 add IC-7200 and R&S ESMC
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2672 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-03-05 15:45:28 +00:00
Stéphane Fillod, F8CFE
8dd158daa6 Heathkit HD 1780 Intellirotor backend, by Rob Frohne, KL7NA
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2590 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-20 19:44:04 +00:00
Stéphane Fillod, F8CFE
5d3e8c1385 new kit backend
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2462 7ae35d74-ebe9-4afe-98af-79ac388436b8
2008-11-02 17:05:54 +00:00
Thomas Beierlein, DL1JBE
bd65eb907e fix for gcc warnings: dereferencing type-punned pointer will break strict-aliasing rules"
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2369 7ae35d74-ebe9-4afe-98af-79ac388436b8
2008-06-26 15:23:06 +00:00
Stéphane Fillod, F8CFE
f6a7e6628c added GS-232A rotator controller
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2361 7ae35d74-ebe9-4afe-98af-79ac388436b8
2008-05-23 14:14:17 +00:00
Stéphane Fillod, F8CFE
1cba659924 allow perl binding to find libhamlib in src, but nuke LD_RUN_PATH, hence preventing any rpath backdoor
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2360 7ae35d74-ebe9-4afe-98af-79ac388436b8
2008-05-17 16:36:54 +00:00
Stéphane Fillod, F8CFE
dad9fe5f7c more tests/examples
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2353 7ae35d74-ebe9-4afe-98af-79ac388436b8
2008-05-04 21:47:06 +00:00