From 673733700f5b4d52e1057d266fce60583cb6e8a3 Mon Sep 17 00:00:00 2001 From: Wouter van Gulik Date: Tue, 17 Aug 2021 20:23:03 +0200 Subject: [PATCH] Move private data structs of ft100, ft600, ft817, ft857, ft897 to the C file. Note that is already so for all other Yaesu device. Leave private data in newcat; it is used by multiple rigs. --- rigs/yaesu/ft100.c | 7 +++++++ rigs/yaesu/ft100.h | 7 ------- rigs/yaesu/ft600.c | 8 ++++++++ rigs/yaesu/ft600.h | 8 -------- rigs/yaesu/ft817.c | 16 ++++++++++++++++ rigs/yaesu/ft817.h | 17 ----------------- rigs/yaesu/ft847.c | 20 +++++++++++++++++++- rigs/yaesu/ft847.h | 20 -------------------- rigs/yaesu/ft857.c | 18 ++++++++++++++++++ rigs/yaesu/ft857.h | 17 ----------------- rigs/yaesu/ft897.c | 17 +++++++++++++++++ rigs/yaesu/ft897.h | 18 ------------------ 12 files changed, 85 insertions(+), 88 deletions(-) diff --git a/rigs/yaesu/ft100.c b/rigs/yaesu/ft100.c index 52b18a8bb..fd7e9601d 100644 --- a/rigs/yaesu/ft100.c +++ b/rigs/yaesu/ft100.c @@ -41,6 +41,13 @@ #include "misc.h" #include "bandplan.h" +struct ft100_priv_data { + /* TODO: make use of cached data */ + FT100_STATUS_INFO status; + FT100_FLAG_INFO flags; +}; + + /* prototypes */ static int ft100_send_priv_cmd(RIG *rig, unsigned char cmd_index); diff --git a/rigs/yaesu/ft100.h b/rigs/yaesu/ft100.h index 64c2dc582..bb8c8fbf2 100644 --- a/rigs/yaesu/ft100.h +++ b/rigs/yaesu/ft100.h @@ -127,13 +127,6 @@ typedef struct FT100_FLAG_INFO; -struct ft100_priv_data { - /* TODO: make use of cached data */ - FT100_STATUS_INFO status; - FT100_FLAG_INFO flags; -}; - - static int ft100_init(RIG *rig); static int ft100_open(RIG *rig); static int ft100_cleanup(RIG *rig); diff --git a/rigs/yaesu/ft600.c b/rigs/yaesu/ft600.c index ab4838cb8..c0f353a1e 100644 --- a/rigs/yaesu/ft600.c +++ b/rigs/yaesu/ft600.c @@ -41,6 +41,14 @@ #include "misc.h" #include "bandplan.h" +struct ft600_priv_data { + FT600_STATUS_INFO status; + FT600_FLAG_INFO flags; + unsigned char s_meter; + +}; + + /* prototypes */ static int ft600_send_priv_cmd(RIG *rig, unsigned char cmd_index); diff --git a/rigs/yaesu/ft600.h b/rigs/yaesu/ft600.h index 22963d472..002554d16 100644 --- a/rigs/yaesu/ft600.h +++ b/rigs/yaesu/ft600.h @@ -112,14 +112,6 @@ typedef struct FT600_FLAG_INFO; -struct ft600_priv_data { - FT600_STATUS_INFO status; - FT600_FLAG_INFO flags; - unsigned char s_meter; - -}; - - static int ft600_init(RIG *rig); static int ft600_open(RIG *rig); static int ft600_cleanup(RIG *rig); diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c index a9d12590c..dc7b9f480 100644 --- a/rigs/yaesu/ft817.c +++ b/rigs/yaesu/ft817.c @@ -71,6 +71,22 @@ #include "bandplan.h" #include "cal.h" +struct ft817_priv_data +{ + yaesu_cmd_set_t pcs[FT817_NATIVE_SIZE]; /* TODO: why? */ + + /* rx status */ + struct timeval rx_status_tv; + unsigned char rx_status; + + /* tx status */ + struct timeval tx_status_tv; + unsigned char tx_status; + + /* freq & mode status */ + struct timeval fm_status_tv; + unsigned char fm_status[YAESU_CMD_LENGTH + 1]; +}; /* Native ft817 cmd set prototypes. These are READ ONLY as each */ /* rig instance will copy from these and modify if required . */ diff --git a/rigs/yaesu/ft817.h b/rigs/yaesu/ft817.h index d6fe017a5..97532dc07 100644 --- a/rigs/yaesu/ft817.h +++ b/rigs/yaesu/ft817.h @@ -122,23 +122,6 @@ enum ft817_native_cmd_e typedef enum ft817_native_cmd_e ft817_native_cmd_t; -struct ft817_priv_data -{ - yaesu_cmd_set_t pcs[FT817_NATIVE_SIZE]; /* TODO: why? */ - - /* rx status */ - struct timeval rx_status_tv; - unsigned char rx_status; - - /* tx status */ - struct timeval tx_status_tv; - unsigned char tx_status; - - /* freq & mode status */ - struct timeval fm_status_tv; - unsigned char fm_status[YAESU_CMD_LENGTH + 1]; -}; - /* fixme: why declare static? it has no effect */ static int ft817_init(RIG *rig); static int ft817_open(RIG *rig); diff --git a/rigs/yaesu/ft847.c b/rigs/yaesu/ft847.c index da42a36d1..8699780fa 100644 --- a/rigs/yaesu/ft847.c +++ b/rigs/yaesu/ft847.c @@ -60,8 +60,26 @@ #include "bandplan.h" #include "tones.h" -/* prototypes */ +/* + * ft847 instance - private data + * + */ +struct ft847_priv_data { + split_t sat_mode; + + unsigned char rx_status; /* tx returned data */ + unsigned char tx_status; /* rx returned data */ + /* for early ft847's we keep our own memory items */ + /* Early rigs are one-way com to the rig */ + freq_t freqA,freqB; + mode_t mode; + pbwidth_t width; + ptt_t ptt; +}; + + +/* prototypes */ static int ft847_send_priv_cmd(RIG *rig, int cmd_index); diff --git a/rigs/yaesu/ft847.h b/rigs/yaesu/ft847.h index 694697879..9c20fc23b 100644 --- a/rigs/yaesu/ft847.h +++ b/rigs/yaesu/ft847.h @@ -144,26 +144,6 @@ typedef enum ft847_native_cmd_e ft847_native_cmd_t; -/* - * ft847 instance - private data - * - */ - -struct ft847_priv_data { - split_t sat_mode; - - unsigned char rx_status; /* tx returned data */ - unsigned char tx_status; /* rx returned data */ - /* for early ft847's we keep our own memory items */ - /* Early rigs are one-way com to the rig */ - freq_t freqA,freqB; - mode_t mode; - pbwidth_t width; - ptt_t ptt; -}; - - - /* * API local implementation */ diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index 12df2a91c..33f7a27b8 100644 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@ -74,6 +74,24 @@ #include "tones.h" #include "bandplan.h" +struct ft857_priv_data { + yaesu_cmd_set_t pcs[FT857_NATIVE_SIZE]; /* TODO: why? */ + + /* rx status */ + struct timeval rx_status_tv; + unsigned char rx_status; + + /* tx status */ + struct timeval tx_status_tv; + unsigned char tx_status; + + /* freq & mode status */ + struct timeval fm_status_tv; + unsigned char fm_status[YAESU_CMD_LENGTH+1]; +}; + + + /* Native ft857 cmd set prototypes. These are READ ONLY as each */ /* rig instance will copy from these and modify if required . */ /* Complete sequences (1) can be read and used directly as a cmd sequence . */ diff --git a/rigs/yaesu/ft857.h b/rigs/yaesu/ft857.h index 6634ce1a4..2f1699ae1 100644 --- a/rigs/yaesu/ft857.h +++ b/rigs/yaesu/ft857.h @@ -118,23 +118,6 @@ enum ft857_native_cmd_e { typedef enum ft857_native_cmd_e ft857_native_cmd_t; -struct ft857_priv_data { - yaesu_cmd_set_t pcs[FT857_NATIVE_SIZE]; /* TODO: why? */ - - /* rx status */ - struct timeval rx_status_tv; - unsigned char rx_status; - - /* tx status */ - struct timeval tx_status_tv; - unsigned char tx_status; - - /* freq & mode status */ - struct timeval fm_status_tv; - unsigned char fm_status[YAESU_CMD_LENGTH+1]; -}; - - static int ft857_init(RIG *rig); static int ft857_open(RIG *rig); static int ft857_cleanup(RIG *rig); diff --git a/rigs/yaesu/ft897.c b/rigs/yaesu/ft897.c index ccc40395e..d8963abcf 100644 --- a/rigs/yaesu/ft897.c +++ b/rigs/yaesu/ft897.c @@ -79,6 +79,23 @@ #include "tones.h" #include "bandplan.h" +struct ft897_priv_data { + yaesu_cmd_set_t pcs[FT897_NATIVE_SIZE]; /* TODO: why? */ + + /* rx status */ + struct timeval rx_status_tv; + unsigned char rx_status; + + /* tx status */ + struct timeval tx_status_tv; + unsigned char tx_status; + + /* freq & mode status */ + struct timeval fm_status_tv; + unsigned char fm_status[YAESU_CMD_LENGTH+1]; +}; + + static int ft897_init(RIG *rig); static int ft897_open(RIG *rig); diff --git a/rigs/yaesu/ft897.h b/rigs/yaesu/ft897.h index 9e8c62ed6..a879e4923 100644 --- a/rigs/yaesu/ft897.h +++ b/rigs/yaesu/ft897.h @@ -115,22 +115,4 @@ enum ft897_native_cmd_e { typedef enum ft897_native_cmd_e ft897_native_cmd_t; - -struct ft897_priv_data { - yaesu_cmd_set_t pcs[FT897_NATIVE_SIZE]; /* TODO: why? */ - - /* rx status */ - struct timeval rx_status_tv; - unsigned char rx_status; - - /* tx status */ - struct timeval tx_status_tv; - unsigned char tx_status; - - /* freq & mode status */ - struct timeval fm_status_tv; - unsigned char fm_status[YAESU_CMD_LENGTH+1]; -}; - - #endif /* _FT897_H */