From f926ab04ce71fd71fd94ab47fb51957a901b8ab8 Mon Sep 17 00:00:00 2001 From: "Frank Singleton, VK3FCS" Date: Mon, 4 Sep 2000 19:58:56 +0000 Subject: [PATCH] adding rig_caps stuff git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@88 7ae35d74-ebe9-4afe-98af-79ac388436b8 --- ft747/ft747.c | 20 ++++++++++++++------ ft747/ft747.h | 7 +++++-- ft747/test/testlibft747.c | 10 +++++++--- ft847/test/testlibft847.c | 3 +-- 4 files changed, 27 insertions(+), 13 deletions(-) diff --git a/ft747/ft747.c b/ft747/ft747.c index 0ccdbcb34..0c168ab84 100644 --- a/ft747/ft747.c +++ b/ft747/ft747.c @@ -7,7 +7,7 @@ * box (FIF-232C) or similar * * - * $Id: ft747.c,v 1.9 2000-09-04 04:07:33 javabear Exp $ + * $Id: ft747.c,v 1.10 2000-09-04 19:58:55 javabear Exp $ * * * This program is free software; you can redistribute it and/or @@ -40,7 +40,7 @@ #include "ft747.h" static struct rig_caps rigft747 = { - "ft747", 4800, 4800, 8, 2, RIG_PARITY_NONE + "ft747", 4800, 4800, 8, 2, RIG_PARITY_NONE, "" }; @@ -55,8 +55,18 @@ static struct rig_caps rigft747 = { */ -int rig_open(char *serial_port) { - return open_port(serial_port); +/* int rig_open(char *serial_port) { */ +/* return open_port(serial_port); */ +/* } */ + +/* + * Open serial connection to rig using rig_caps + * returns fd. + */ + + +int rig_open(struct rig_caps *rc) { + return open_port2(rc); } /* @@ -80,8 +90,6 @@ struct rig_caps *rig_get_caps() { printf("rig = %s \n", r->rig_name); - printf("rig = %s \n", rigft747.rig_name); - printf("rig serial_rate_min = = %u \n", rigft747.serial_rate_min); diff --git a/ft747/ft747.h b/ft747/ft747.h index 67a880e1b..09739db18 100644 --- a/ft747/ft747.h +++ b/ft747/ft747.h @@ -7,7 +7,7 @@ * box (FIF-232C) or similar * * - * $Id: ft747.h,v 1.6 2000-09-04 03:58:06 javabear Exp $ + * $Id: ft747.h,v 1.7 2000-09-04 19:58:55 javabear Exp $ * * * This program is free software; you can redistribute it and/or @@ -87,9 +87,12 @@ const float band_data[11] = { 0.0, 0.1, 2.5, 4.0, 7.5, 10.5, 14.5, 18.5, 21.5, 2 * Visible functions in shared lib. * */ -int rig_open(char *serial_port); /* return fd or -1 on error */ + +/* int rig_open(char *serial_port); */ /* return fd or -1 on error */ + int rig_close(int fd); /* close port using fd */ struct rig_caps *rig_get_caps(); /* return ptr to capabilities */ +int rig_open(struct rig_caps *rc); /* use rig_caps struct to open */ /* * set commands diff --git a/ft747/test/testlibft747.c b/ft747/test/testlibft747.c index 958eb0ea8..2706b2522 100644 --- a/ft747/test/testlibft747.c +++ b/ft747/test/testlibft747.c @@ -6,7 +6,7 @@ * box (FIF-232C) or similar. * * - * $Id: testlibft747.c,v 1.9 2000-09-04 04:06:14 javabear Exp $ + * $Id: testlibft747.c,v 1.10 2000-09-04 19:58:55 javabear Exp $ * * * This program is free software; you can redistribute it and/or @@ -225,10 +225,14 @@ int main(void) { rc = rig_get_caps(); /* find capabilities */ printf("rig_name = %s \n", rc->rig_name); + strcpy(rc->serial_port_name,SERIAL_PORT); /* put wanted serial port in caps */ - fd = rig_open(SERIAL_PORT); - printf("port opened ok \n"); +/* fd = rig_open(SERIAL_PORT); */ +/* printf("port opened ok \n"); */ + fd = rig_open(rc); + printf("port %s opened ok \n", rc->serial_port_name); + test(fd); printf("testing communication result ok \n"); diff --git a/ft847/test/testlibft847.c b/ft847/test/testlibft847.c index a2566c539..0642cbb2f 100644 --- a/ft847/test/testlibft847.c +++ b/ft847/test/testlibft847.c @@ -5,7 +5,7 @@ * via serial interface to an FT-847 using the "CAT" interface. * * - * $Id: testlibft847.c,v 1.15 2000-09-04 17:51:35 javabear Exp $ + * $Id: testlibft847.c,v 1.16 2000-09-04 19:58:56 javabear Exp $ * * * This program is free software; you can redistribute it and/or @@ -207,7 +207,6 @@ int main(void) { rc = rig_get_caps(); /* find capabilities */ printf("rig_name = %s \n", rc->rig_name); - rc->serial_data_bits = 8; printf("Initial serial_port_name = %s \n", rc->serial_port_name); strcpy(rc->serial_port_name,SERIAL_PORT); /* put wanted serial port in caps */