kopia lustrzana https://github.com/Hamlib/Hamlib
				
				
				
			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.pull/769/head
							rodzic
							
								
									9cf4b1658f
								
							
						
					
					
						commit
						673733700f
					
				| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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 . */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
 */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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 . */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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 */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Ładowanie…
	
		Reference in New Issue