Commit graph

346 commits

Author SHA1 Message Date
Jon Snow
ac05900450 add PR comments, change rig and folder name 2026-07-12 13:38:06 -04:00
George Baltz N3GB
7ab9d9f8e5 Move multicast internals out of rig.h into multicast.h
This data (I think) was part of multicast V1, and doesn't seem to be used any
  more. Since neither V1 or V2 are enabled, there should be no external
  conflicts.
2026-04-28 10:32:27 -04:00
Leo Pizzolante
2691e10cee
Add Hamgeek uSDX 2026-04-24 17:40:34 +02:00
Nate Bargmann
d784cc49d9
Add RIG_MODEL_PRC138 to test_Hamlib_class.py
Reported by Walter Fey:
4f4507fa8c (commitcomment-182142320)

(cherry picked from commit 8cde902c7c)
2026-04-11 08:16:34 -05:00
Dhiru Kholia
debe6fcaf9 Add support for rigs using the 'Simple CAT' protocol
See 'rigs/simplecat/SIMPLE_CAT_PROTOCOL.md' for the protocol spec.

Notes:

- Memory correctness checks were done using Valgrind.

- Tested with wsjtx-3.1.0_improved_PLUS_260228.tgz (with mods) and
  Bunzee Labs' DDX HF Digital Transceiver

  https://bunzee-labs.com/products/ddx

Tested on:

- Ubuntu Linux
- macOS Tahoe
- Windows 11
2026-03-25 17:42:32 +05:30
George Baltz N3GB
97a005d52e The big cut - Remove all old embedded structures
Drop all fixed structures in RIG and state. Clean out old definitions,
  purge all references to same.

Undo the other conflicts in amp_state.h
2026-02-23 11:15:46 -05:00
George Baltz N3GB
7fadc49ef7 Fix some straggling state references
Add includes to the bindings skeleton
  and repair a cut&paste error
2026-02-23 11:12:15 -05:00
George Baltz N3GB
be6b0086eb Mark more deprecated stuff for exclusion and removal
Also mark the bindings that will no longer need to be ignored.
2026-02-23 11:12:15 -05:00
George Baltz N3GB
7a1a0d35ec And finally, the amplifiers
Resolve conflicts with new amp code/
Why move the ampport, rather than adding stuff after it???
2026-02-23 11:10:20 -05:00
George Baltz N3GB
2b3bb97dbf Convert rotators to heap storage
Just like the rigs
2026-02-23 11:02:34 -05:00
George Baltz N3GB
b01914aa3c Mark some data as private and not safe for applications
The pointers may move, or the method to get the address may change.
2026-02-23 11:02:34 -05:00
George Baltz N3GB
a475d697aa Deprecate ports in rig_state struct
Mark all ports in struct rig_state as deprecated.
Remove them from the bindings.
2026-02-23 11:02:34 -05:00
Mikael Nousiainen
e48fcc3035 Attempt to fix CodeQL issues and distcheck Python tests 2026-02-20 19:02:20 +02:00
George Baltz N3GB
468a299924 Add Icom IC-7300MK2
Add baseline support for MK2 version, same as original
Differences:
  - Default CI-V address 0xB6
  - Status Beta
2025-12-31 05:34:32 -05:00
Nate Bargmann
bb39a8f73d
Add ID52+ to Python test class 2025-12-10 09:51:09 -06:00
George Baltz N3GB
d3769bf948 Don't forget the noise 2025-10-03 11:56:04 -04:00
Nate Bargmann
584eddbb6e
Merge GitHub PR #1921 2025-09-23 08:15:05 -05:00
Nate Bargmann
1557d848ed
Merge GitHub PR #1920 2025-09-22 21:32:40 -05:00
Daniele Forsi IU5HKX
54bd989e72 Add various get and set methods for amplifiers to the bindings
Adds get_ext_level, has_get_level, has_set_level, set_ext_level,
set_level.
Brings function coverage of amplifier.c above 90%.
2025-09-21 16:27:12 +02:00
Daniele Forsi IU5HKX
8b9e271ce1 Add various get and set methods for rotators to the bindings
Adds has_get_func, has_get_level, has_get_parm, has_set_func,
has_set_level, has_set_parm.
Brings tests coverage of rot_settings.c to 100%.
2025-09-21 16:27:12 +02:00
Daniele Forsi IU5HKX
5f89ab7d56 Add a SWIG macro for "has_get" and "has_set" bindings 2025-09-21 16:27:12 +02:00
Daniele Forsi IU5HKX
8d28c579f3 Use *_data_pointer() to get pointer to "state"
Increases function coverage of functions and makes the bindings
more future-proof.
2025-09-21 15:58:43 +02:00
Daniele Forsi IU5HKX
b48ff58895 Add rig_has_get_func() and rig_has_get_parm() to the bindings
Brings tests coverage of settings.c above 80%.
2025-09-21 11:27:27 +02:00
Daniele Forsi IU5HKX
0a30ba6dc7 Add rig_get_debug() and rig_set_debug_time_stamp() to the bindings
Brings test coverage of debug.c over 55%.
2025-09-21 11:27:27 +02:00
Daniele Forsi IU5HKX
194f9d3a62 Add tests for dmmm2dec() dec2dmmm() azimuth_long_path()
Brings function coverage of locator.c to 100%.
2025-09-21 11:27:27 +02:00
Daniele Forsi IU5HKX
df975aaf12 Fix compiler warnings issued by clang
Fixes:
hamlibpy_wrap.c:4692:35: warning: passing 'char *' to parameter of type 'const unsigned char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
 4692 |                 count = rig_send_raw(self->rig, send, send_len, reply_buffer, reply_len, term);
      |                                                 ^~~~
../include/hamlib/rig.h:3466:71: note: passing argument to parameter 'send' here
 3466 | extern HAMLIB_EXPORT(int) rig_send_raw(RIG *rig, const unsigned char* send, int send_len, unsigned char* reply, int reply_len, unsigned char *term);
      |                                                                       ^
hamlibpy_wrap.c:4692:76: warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
 4692 |                 count = rig_send_raw(self->rig, send, send_len, reply_buffer, reply_len, term);
      |                                                                                          ^~~~
../include/hamlib/rig.h:3466:143: note: passing argument to parameter 'term' here
 3466 | extern HAMLIB_EXPORT(int) rig_send_raw(RIG *rig, const unsigned char* send, int send_len, unsigned char* reply, int reply_len, unsigned char *term);
      |                                                                                                                                               ^
hamlibpy_wrap.c:4696:39: warning: passing 'unsigned char[256]' to parameter of type 'const char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
 4696 |                         return PyUnicode_FromStringAndSize(reply_buffer, count);
      |                                                            ^~~~~~~~~~~~
/usr/include/python3.13/unicodeobject.h:123:17: note: passing argument to parameter 'u' here
  123 |     const char *u,             /* UTF-8 encoded string */
      |                 ^
hamlibpy_wrap.c:4698:37: warning: passing 'unsigned char[256]' to parameter of type 'const char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
 4698 |                         return PyBytes_FromStringAndSize(reply_buffer, count);
      |                                                          ^~~~~~~~~~~~
/usr/include/python3.13/bytesobject.h:31:62: note: passing argument to parameter here
   31 | PyAPI_FUNC(PyObject *) PyBytes_FromStringAndSize(const char *, Py_ssize_t);
      |                                                              ^
2025-09-20 19:02:59 +02:00
Daniele Forsi IU5HKX
aa665d1e19 Fix compiler warning issued by clang
Fixes:
hamlibpy_wrap.c:4668:46: warning: passing 'size_t *' (aka 'unsigned long *') to parameter of type 'Py_ssize_t *' (aka 'long *') converts between pointers to integer types with different sign [-Wpointer-sign]
 4668 |                         PyBytes_AsStringAndSize(bytes_obj, &send, &send_len);
      |                                                                   ^~~~~~~~~
2025-09-18 21:34:33 +02:00
Daniele Forsi IU5HKX
4c3cf66d84 Fix compiler warnings issued by clang
Fixes:
hamlibpy_wrap.c:4194:12: warning: expression which evaluates to zero treated as a null pointer constant of type 'int *' [-Wnon-literal-null-conversion]
 4194 |     return RIG_OK;
      |            ^~~~~~
hamlibpy_wrap.c:4213:12: warning: expression which evaluates to zero treated as a null pointer constant of type 'int *' [-Wnon-literal-null-conversion]
 4213 |     return RIG_OK;
      |            ^~~~~~
hamlibpy_wrap.c:4230:12: warning: expression which evaluates to zero treated as a null pointer constant of type 'int *' [-Wnon-literal-null-conversion]
 4230 |     return RIG_OK;
      |            ^~~~~~
hamlibpy_wrap.c:4248:12: warning: expression which evaluates to zero treated as a null pointer constant of type 'int *' [-Wnon-literal-null-conversion]
 4248 |     return RIG_OK;
      |            ^~~~~~
hamlibpy_wrap.c:4266:12: warning: expression which evaluates to zero treated as a null pointer constant of type 'int *' [-Wnon-literal-null-conversion]
 4266 |     return RIG_OK;
      |            ^~~~~~
hamlibpy_wrap.c:4282:12: warning: expression which evaluates to zero treated as a null pointer constant of type 'int *' [-Wnon-literal-null-conversion]
 4282 |     return RIG_OK;
      |            ^~~~~~
hamlibpy_wrap.c:4298:12: warning: expression which evaluates to zero treated as a null pointer constant of type 'int *' [-Wnon-literal-null-conversion]
 4298 |     return RIG_OK;
      |            ^~~~~~
2025-09-18 21:28:35 +02:00
George Baltz N3GB
4e6bcb11c9 Yet another variation on the name 2025-09-15 18:08:44 -04:00
George Baltz N3GB
25a7c25a0f This did nothing locally, maybe needed remotely 2025-09-15 17:46:43 -04:00
George Baltz N3GB
8cb93e4b9c Generate required noise 2025-09-15 17:12:25 -04:00
George Baltz N3GB
11ca438222 Deprecate rig_get_trn() and rig_set_trn()
They have been marked as deprecated in doxygen for years.
They both do nothing but return -RIG_EDEPRECATED.

Remove them from the bindings.
AFAICT adding them to bindings/ignore.swg has no effect.
2025-09-13 21:37:25 -04:00
Daniele Forsi IU5HKX
a9afa8d4d9 Handle --rot-file and --serial_speed in bindings tests
This allow to run the tests for a specific model, eg.
PYTHONPATH=bindings/:bindings/.libs bindings/python/test_rot.py --model 2
2025-09-09 20:36:58 +02:00
Daniele Forsi IU5HKX
911169d794 Handle --amp-file and --serial_speed in bindings tests
This allow to run the tests for a specific model, eg.
PYTHONPATH=bindings/:bindings/.libs bindings/python/test_amp.py --model 2
2025-09-09 20:36:58 +02:00
Daniele Forsi IU5HKX
e1761827d9 Fix handling of command line parameters for pytests 2025-09-09 20:36:58 +02:00
Daniele Forsi IU5HKX
6eb7c1d6dd Fix build failure on openSUSE Tumbleweed, Slowroll and Leap 16.0
Thanks to @dl8fcl Walter.
2025-08-22 22:02:01 +02:00
Daniele Forsi IU5HKX
8847cbeafb Implement send_raw for the Perl bindings
Doesn't allow '\0' embedded in the strings to be sent or received.
Closes #1479.
2025-08-20 19:18:02 +02:00
Daniele Forsi IU5HKX
b2828881b6
Make output of the TCL test less verbose
Uses the function that gets only the error message corresponding to
the argument passed.
2025-08-18 07:47:12 -05:00
Daniele Forsi IU5HKX
663fd4f738 Fix compiler warnings
Fixes:
hamlibpy_wrap.c: In function 'Rig_send_raw':
hamlibpy_wrap.c:4668:30: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 4668 |                         send = PyUnicode_AsUTF8AndSize(send_obj, &send_len);
      |                              ^
hamlibpy_wrap.c:4679:30: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 4679 |                         term = PyUnicode_AsUTF8AndSize(term_obj, NULL);
      |                              ^

Thanks to @GeoBaltz
2025-08-13 11:33:40 +02:00
Nate Bargmann
c51357388c
Merge GitHub PR #1841 2025-08-12 07:04:50 -05:00
Daniele Forsi IU5HKX
3b79b13f6d Make the tests for set_conf() and get_conf() more meaningful 2025-08-11 23:41:39 +02:00
Daniele Forsi IU5HKX
e2feb1d1d0 Fix "val_len" paramenter for rot_get_conf2() and amp_get_conf2()
Thanks to @GeoBaltz.
2025-08-11 23:40:01 +02:00
Daniele Forsi IU5HKX
19dce9dc32 Remove deprecated functions and methods from the bindings 2025-08-11 15:50:10 +02:00
Daniele Forsi IU5HKX
6dec579144 Replace library functions deprecated in Hamlib 2025-08-11 15:09:49 +02:00
Daniele Forsi IU5HKX
e16f4077e7 Implement the Python bindings and the tests for rig_send_raw()
Allows to send either string or bytes and to receive a response
converted to the same datatype. Also the "term" argument can be
of either type (but  it can't contain NULs, it's a single char
or byte anyway).

Closes #1624.
2025-08-11 12:33:49 +02:00
Daniele Forsi IU5HKX
10303d5803 Fix function signature of spectrum_callback() 2025-08-09 18:09:17 +02:00
Daniele Forsi IU5HKX
81cb260670 Fix ptt_callback() 2025-08-09 17:57:18 +02:00
Daniele Forsi IU5HKX
2890da9d79 Split the tests
It makes it easier in future to conditionally run some tests(eg.
to not test PTT for receiver-only rigs), or to run tests in
isolation (after renaming them).
It makes it easier to look at failing tests because pytest prints
the code of the failing test up to the failure including any
function that called the failed test (in this case would print
everything from def test_with_open() up to the line with the
failed assert.
2025-08-09 15:57:45 +02:00
Daniele Forsi IU5HKX
9e1c7b5ec1 Allocate zereod memory for struct python_callbacks
Otherwise Py_XDECREF() would randomly segfault trying to use
uninitialized memory that by chance is not zeroed.
2025-08-09 10:33:54 +02:00
Daniele Forsi IU5HKX
3bc1cc8744 Implement remaining event callbacks
Implements:
rig_set_dcd_callback(), rig_set_freq_callback(), rig_set_mode_callback(),
rig_pltune_callback(), rig_set_ptt_callback(), rig_set_spectrum_callback(),
rig_set_vfo_callback()
2025-08-09 10:33:51 +02:00