From 2256d878165064b06926940d8cf24a3832d449d1 Mon Sep 17 00:00:00 2001 From: dj2ls Date: Tue, 28 Dec 2021 21:25:19 +0100 Subject: [PATCH] accessed static --- test/hamlib-test.py | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/test/hamlib-test.py b/test/hamlib-test.py index 0c453ed4..289ceead 100644 --- a/test/hamlib-test.py +++ b/test/hamlib-test.py @@ -85,25 +85,36 @@ myport.parm.serial.rate = 9600 rig = hamlib.rig_init(myrig_model) -retcode = hamlib.serial_setup(myport) + +retcode = hamlib.rig_set_parm(rig, 'stop_bits', 5) print(retcode) +''' +parameter = create_string_buffer(16) +retcode = hamlib.rig_get_parm(rig, 0, parameter) +print(retcode) +print(bytes(parameter)) +''' + + +# attempt to access global vars. Maybe we can access structures as well? +# https://github.com/Hamlib/Hamlib/blob/f5b229f9dc4b4364d2f40e0b0b415e92c9a371ce/src/rig.c#L95 +hamlib_version = ctypes.cast(hamlib.hamlib_version, ctypes.POINTER(ctypes.c_char*21)) +print(hamlib_version.contents.value) + + +''' +retcode = hamlib.rig_has_get_parm(rig, 7) +print(retcode) +''' + +''' retcode = hamlib.rig_open(rig) print(retcode) hamlib.rig_close(rig) - - - - - - - - - - - +'''