Porównaj commity

...

48 Commity

Autor SHA1 Wiadomość Data
Michael Black 17b9321310
Merge pull request #1485 from GeoBaltz/ctcss
CTCSS/TONE functions for TS-890S
2024-01-23 10:36:01 -06:00
George Baltz N3GB 75079d40a8 Add remaining rigs, matching old behavior.
Fix copy/paste foulup.
2024-01-23 09:55:35 -05:00
George Baltz N3GB 5ad803d90c Add funcs to set/clear TONE/CTCSS modes for TS-890S 2024-01-23 09:55:35 -05:00
George Baltz N3GB e42bb719b9 Fix off by one error in tones for TS-590/890/990
Fix some rigs I found docs for - more needed
2024-01-23 09:55:35 -05:00
George Baltz N3GB a703c77c2d Implement ctcss tone for TS-890S. 2024-01-23 09:55:35 -05:00
Mike Black W9MDB 74b0752898 Add Guohe Q900
https://github.com/Hamlib/Hamlib/issues/1483
2024-01-22 16:34:18 -06:00
Mike Black W9MDB a52d0c5931 map token_t to hamlib_token_t for API backwards compatility
https://github.com/Hamlib/Hamlib/issues/1469
2024-01-22 11:48:06 -06:00
Mike Black W9MDB efeba2dfe0 Fix some more hamlib_token_t
https://github.com/Hamlib/Hamlib/issues/1469
2024-01-22 10:50:30 -06:00
Mike Black W9MDB 75cf467c1d Change to hamlib_token_t in swg files
05033171c3 (commitcomment-137562136)
2024-01-22 09:31:50 -06:00
Mike Black W9MDB 1bb469f90f More token_t changes
https://github.com/Hamlib/Hamlib/issues/1469
2024-01-21 23:33:19 -06:00
Mike Black W9MDB 354606f46d Comment out __TIMESIZE check as mingw64 thinks it is not 64 bits -- so we may not need this
https://github.com/Hamlib/Hamlib/issues/1478
2024-01-21 23:31:11 -06:00
Mike Black W9MDB 046f3b849c Fix mingw build
https://github.com/Hamlib/Hamlib/issues/1478
2024-01-21 23:28:41 -06:00
Mike Black W9MDB 05033171c3 Change token_t to hamlib_token_t to avoid collsions with libbsm and others
https://github.com/Hamlib/Hamlib/issues/1469
2024-01-21 23:11:55 -06:00
Mike Black W9MDB 67aee82133 Add compile-time warning if __TIMESIZE != 64
https://github.com/Hamlib/Hamlib/issues/1478
2024-01-21 22:39:57 -06:00
Mike Black W9MDB e62dcd0b4a Merge branch 'master' of https://github.com/Hamlib/Hamlib 2024-01-21 16:40:54 -06:00
Mike Black W9MDB 2cc68f4773 Fix compilation for mingw DLL 2024-01-21 16:38:19 -06:00
Michael Black c4733d9dc3
Merge pull request #1482 from mikaelnousiainen/update-news-for-vfo-and-split-changes
Update NEWS for split/VFO handling changes
2024-01-21 16:13:04 -06:00
Mikael Nousiainen 66218e57f7 Update NEWS for split/VFO handling changes 2024-01-22 00:10:42 +02:00
Mike Black W9MDB e4e12f3ce7 Fix testcache.c for new behavior 2024-01-21 14:41:25 -06:00
Michael Black 1dfd17cc18
Merge pull request #1481 from mikaelnousiainen/streamline-vfo-targeting-and-split-functionality
Streamline VFO targeting and split functionality
2024-01-21 14:24:48 -06:00
Mikael Nousiainen 8bb5bcefb9 Merge upstream and fix conflicts 2024-01-21 20:59:54 +02:00
Mike Black W9MDB 7d0c737e96 Fix Icom startup with poweron
https://github.com/Hamlib/Hamlib/issues/1480
2024-01-21 11:39:07 -06:00
Mike Black W9MDB 77aa5ddb55 Revert FT991 change 2024-01-20 22:29:41 -06:00
Mike Black W9MDB eff0c7b636 Add SY command validation
remove FT991 from vfo adjustment
2024-01-20 10:15:18 -06:00
Mikael Nousiainen 4b3a7514ca Merge upstream and fix conflicts 2024-01-20 13:08:29 +02:00
Mike Black W9MDB d391773622 Ensure transmit vfo is used for rig split 2024-01-19 16:44:04 -06:00
Mikael Nousiainen eb7634abfb Merge upstream changes and fix conflicts 2024-01-15 09:24:17 +02:00
Mikael Nousiainen 051e671bfa Merge upstream changes and fix conflicts. Use snprintf() in most sprintflst.c functions to avoid buffer overflows. 2024-01-04 10:43:15 +02:00
Mikael Nousiainen 2358cba6a4 Fix issues with Dummy rig VFOs. Fix Yaesu ST split command. 2024-01-04 10:13:43 +02:00
Mikael Nousiainen 1cc08d2f00 Merge upstream and fix conflicts 2023-12-19 18:03:12 +02:00
Mikael Nousiainen 3a414c3221 Allow split passband width changes without changing the mode 2023-12-19 10:16:27 +02:00
Mikael Nousiainen 93b61d2c5e Fix dummy rig bugs. Improve FTDX101/FTDX10 ST split command logic. 2023-12-19 00:08:35 +02:00
Mikael Nousiainen 0dea8ed8bb Print integer level range 2023-11-24 00:17:48 +02:00
Mikael Nousiainen 8185a3562b Merge branch 'master' into streamline-vfo-targeting-and-split-functionality 2023-11-22 18:52:37 +02:00
Mikael Nousiainen 00cb0eccdc Fix multicast publisher write commands to use a mutex lock to prevent corruption in (spectrum) data written with multiple write() calls. Remove unnecessary hl_usleep() calls in Icom backend, as the frame parser will correctly detect transceive messages. 2023-11-22 18:41:55 +02:00
Mikael Nousiainen 7b341a2ad6 Merge branch 'master' into streamline-vfo-targeting-and-split-functionality 2023-11-20 10:16:15 +02:00
Mikael Nousiainen 7d5f540b9c Fix bugs in dummy rig. Report errors (incl. timeouts) from icom_get_powerstat(), because the timeout reason is often something else than rig being powered off. Check for power status changes in rigctld/rigctl command loops. 2023-11-20 10:15:45 +02:00
Mikael Nousiainen b78fa43b56 Fix issues in VFO targeting. Allow IC-9700 to target Sub receiver (requires VFO swapping). 2023-11-14 23:00:37 +02:00
Mikael Nousiainen dd974a2536 Merge branch 'master' into streamline-vfo-targeting-and-split-functionality 2023-11-14 10:05:52 +02:00
Mikael Nousiainen e2e723ec60 Simplify/streamline split VFO handling, especially in the Icom backend. Detect reverse split automatically at startup for Icom rigs. 2023-11-14 10:05:17 +02:00
Mikael Nousiainen 4a926ec503 Fix issues found during testing 2023-11-10 20:32:59 +02:00
Mikael Nousiainen 82f2b10275 Merge branch 'hamlib-multicast-4' into streamline-vfo-targeting-and-split-functionality 2023-11-09 09:59:48 +02:00
Mikael Nousiainen c90c675add Unify and streamline Icom backend logic for freq/mode and split commands. Allow use of targeted freq/mode whenever possible. Move certain Icom-specific caps to the icom_priv_caps struct to remove rig-specific conditions in generic backend code. 2023-11-09 09:57:23 +02:00
Mikael Nousiainen 0ece468b49 Merge branch 'hamlib-multicast-4' into streamline-vfo-targeting-and-split-functionality 2023-11-09 09:54:16 +02:00
Mikael Nousiainen 4fa61a9a32 Merge branch 'master' into streamline-vfo-targeting-and-split-functionality 2023-11-07 15:59:49 +02:00
Mikael Nousiainen 89abbfeb3a Merge master and fix conflicts 2023-11-07 09:41:29 +02:00
Mikael Nousiainen f89e0f0388 Cleaning up and unifying the Icom backend 2023-10-31 22:38:43 +02:00
Mikael Nousiainen 8ab8aafe48 Streamline VFO targeting and split functionality. Rewrite Icom backend routines to always avoid VFO swapping is the rig supports the 'targetable' commands 0x25 and 0x26. Work in progress. 2023-10-29 10:28:36 +02:00
134 zmienionych plików z 3345 dodań i 3016 usunięć

10
NEWS
Wyświetl plik

@ -13,6 +13,15 @@ Version 5.x -- future
* Change FT1000MP Mark V model names to align with FT1000MP
Version 4.6
* Added Guohe Q900 entry
* Unify behavior of all rigctl split commands
* Make the set_split_* commands modify the state of the specified split VFO -- the current or targeted VFO do not have any effect
* Make the set_split_* commands enable split automatically if not enabled
* Make the get_split_* commands return frequency of 0 Hz, mode NONE and filter of 0 Hz if split is not enabled
* Allow all split commands to avoid VFO swapping if supported by the rig model
* Improve Icom backend to set/get frequency, mode and filter without VFO swapping if supported by the rig model
* Improve Yaesu newcat backend split handling
* Expose "Targetable features" (RIG_TARGETABLE_*) in dump_caps output to allow clients to determine which commands can be executed without VFO swapping
* Added RIG_FUNC_SYNC for FTDX101D/MP
* Added Barrett 4100
* Added DL2MAN (tr)uSDX -- needs refinement
@ -49,7 +58,6 @@ static int add_to_list(const struct rig_caps* rc, void*)
* Add saebrtrack rotor https://sites.google.com/site/marklhammond/saebrtrack
* Add offset_vfoa and offset_vfob applying to rig_set_freq
* Fix K4 to put it in K40 mode when requesting ID
* 2023-11-XX -- Planned for Nov 2023
* Fixes for M2 Rotors
* Add rigctlsync utility to synchronize frequency from a rig to SDR# (or others)
* Add SDR# rig for use with SDR#'s gpredict plugin -- can only get/set freq

Wyświetl plik

@ -92,14 +92,14 @@ typedef struct Amp {
AMPMETHOD1(set_powerstat, powerstat_t)
void set_conf(const char *name, const char *val) {
token_t tok = amp_token_lookup(self->amp, name);
hamlib_token_t tok = amp_token_lookup(self->amp, name);
if (tok == RIG_CONF_END)
self->error_status = -RIG_EINVAL;
else
self->error_status = amp_set_conf(self->amp, tok, val);
}
AMPMETHOD2(set_conf, token_t, const_char_string)
AMPMETHOD2(set_conf, hamlib_token_t, const_char_string)
/*
* declare wrapper method with one output argument besides AMP*
@ -110,14 +110,14 @@ typedef struct Amp {
/* get functions */
const char *get_conf(token_t tok) {
const char *get_conf(hamlib_token_t tok) {
static char s[128] = "";
self->error_status = amp_get_conf(self->amp, tok, s);
return s;
}
const char *get_conf(const char *name) {
token_t tok = amp_token_lookup(self->amp, name);
hamlib_token_t tok = amp_token_lookup(self->amp, name);
static char s[128] = "";
if (tok == RIG_CONF_END)
self->error_status = -RIG_EINVAL;

Wyświetl plik

@ -359,7 +359,7 @@ typedef channel_t * const_channel_t_p;
METHOD3(set_ts, shortfreq_t)
METHOD2(set_ant, ant_t, value_t)
METHOD2(set_func, setting_t, int)
METHOD2(set_ext_func, token_t, int)
METHOD2(set_ext_func, hamlib_token_t, int)
METHOD3(set_bank, int)
METHOD3(set_mem, int)
METHOD3(send_dtmf, const_char_string)
@ -371,7 +371,7 @@ typedef channel_t * const_channel_t_p;
METHODSUPERSET(level, int, i, RIG_LEVEL_IS_FLOAT(stg))
METHODSUPERSET(level, float, f, !RIG_LEVEL_IS_FLOAT(stg))
METHODSTRSET(level)
METHOD2(set_ext_level, token_t, value_t)
METHOD2(set_ext_level, hamlib_token_t, value_t)
METHODSIMPLEGET(level, int, i, RIG_LEVEL_IS_FLOAT(stg))
METHODSIMPLEGET(level, float, f, !RIG_LEVEL_IS_FLOAT(stg))
@ -403,8 +403,8 @@ typedef channel_t * const_channel_t_p;
METHOD1(ext_token_lookup, const_char_string) /* level & parm */
METHOD1(token_lookup, const_char_string) /* conf */
METHOD2(set_conf, token_t, const_char_string)
METHOD2(set_ext_parm, token_t, value_t)
METHOD2(set_conf, hamlib_token_t, const_char_string)
METHOD2(set_ext_parm, hamlib_token_t, value_t)
METHODSIMPLESET(parm, int, i, RIG_PARM_IS_FLOAT(stg))
METHODSIMPLESET(parm, float, f, !RIG_PARM_IS_FLOAT(stg))
@ -420,7 +420,7 @@ typedef channel_t * const_channel_t_p;
void set_conf(const char *name, const char *val) {
token_t tok = rig_token_lookup(self->rig, name);
hamlib_token_t tok = rig_token_lookup(self->rig, name);
if (tok == RIG_CONF_END)
self->error_status = -RIG_EINVAL;
else
@ -508,14 +508,14 @@ typedef channel_t * const_channel_t_p;
return chan;
}
void get_conf(token_t tok, char *returnstr) {
void get_conf(hamlib_token_t tok, char *returnstr) {
returnstr[0] = '\0';
self->error_status = rig_get_conf(self->rig, tok, returnstr);
}
void get_conf(const char *name, char *returnstr) {
returnstr[0] = '\0';
token_t tok = rig_token_lookup(self->rig, name);
hamlib_token_t tok = rig_token_lookup(self->rig, name);
if (tok == RIG_CONF_END)
self->error_status = -RIG_EINVAL;
else
@ -540,7 +540,7 @@ typedef channel_t * const_channel_t_p;
return status;
}
int get_ext_func(token_t func, vfo_t vfo = RIG_VFO_CURR) {
int get_ext_func(hamlib_token_t func, vfo_t vfo = RIG_VFO_CURR) {
int status;
self->error_status = rig_get_ext_func(self->rig, vfo, func, &status);
return status;
@ -554,7 +554,7 @@ typedef channel_t * const_channel_t_p;
/* TODO: dynamic casting */
}
void get_ext_level(token_t token, vfo_t vfo = RIG_VFO_CURR)
void get_ext_level(hamlib_token_t token, vfo_t vfo = RIG_VFO_CURR)
{ value_t val = {0}; self->error_status = rig_get_level(self->rig, vfo, token, &val);
//if (RIG_LEVEL_IS_FLOAT(level))
/* TODO: dynamic casting */
@ -566,7 +566,7 @@ typedef channel_t * const_channel_t_p;
/* TODO: dynamic casting */
}
void get_ext_parm(token_t parm)
void get_ext_parm(hamlib_token_t parm)
{ value_t val = {0}; self->error_status = rig_get_parm(self->rig, parm, &val);
//if (RIG_LEVEL_IS_FLOAT(parm))
/* TODO: dynamic casting */

Wyświetl plik

@ -88,23 +88,23 @@ typedef struct Rot {
ROTMETHOD1(token_lookup, const_char_string) /* conf */
void set_conf(const char *name, const char *val) {
token_t tok = rot_token_lookup(self->rot, name);
hamlib_token_t tok = rot_token_lookup(self->rot, name);
if (tok == RIG_CONF_END)
self->error_status = -RIG_EINVAL;
else
self->error_status = rot_set_conf(self->rot, tok, val);
}
ROTMETHOD2(set_conf, token_t, const_char_string)
ROTMETHOD2(set_conf, hamlib_token_t, const_char_string)
const char *get_conf(token_t tok) {
const char *get_conf(hamlib_token_t tok) {
static char s[128] = "";
self->error_status = rot_get_conf(self->rot, tok, s);
return s;
}
const char *get_conf(const char *name) {
token_t tok = rot_token_lookup(self->rot, name);
hamlib_token_t tok = rot_token_lookup(self->rot, name);
static char s[128] = "";
if (tok == RIG_CONF_END)
self->error_status = -RIG_EINVAL;

Wyświetl plik

@ -65,7 +65,7 @@ void Amplifier::close(void) {
CHECK_AMP( amp_close(theAmp) );
}
void Amplifier::setConf(token_t token, const char *val)
void Amplifier::setConf(hamlib_token_t token, const char *val)
{
CHECK_AMP( amp_set_conf(theAmp, token, val) );
}
@ -74,7 +74,7 @@ void Amplifier::setConf(const char *name, const char *val)
CHECK_AMP( amp_set_conf(theAmp, tokenLookup(name), val) );
}
void Amplifier::getConf(token_t token, char *val)
void Amplifier::getConf(hamlib_token_t token, char *val)
{
CHECK_AMP( amp_get_conf(theAmp, token, val) );
}
@ -83,7 +83,7 @@ void Amplifier::getConf(const char *name, char *val)
CHECK_AMP( amp_get_conf(theAmp, tokenLookup(name), val) );
}
token_t Amplifier::tokenLookup(const char *name)
hamlib_token_t Amplifier::tokenLookup(const char *name)
{
return amp_token_lookup(theAmp, name);
}

Wyświetl plik

@ -76,7 +76,7 @@ void Rig::close(void) {
CHECK_RIG( rig_close(theRig) );
}
void Rig::setConf(token_t token, const char *val)
void Rig::setConf(hamlib_token_t token, const char *val)
{
CHECK_RIG( rig_set_conf(theRig, token, val) );
}
@ -85,7 +85,7 @@ void Rig::setConf(const char *name, const char *val)
CHECK_RIG( rig_set_conf(theRig, tokenLookup(name), val) );
}
void Rig::getConf(token_t token, char *val)
void Rig::getConf(hamlib_token_t token, char *val)
{
CHECK_RIG( rig_get_conf(theRig, token, val) );
}
@ -94,7 +94,7 @@ void Rig::getConf(const char *name, char *val)
CHECK_RIG( rig_get_conf(theRig, tokenLookup(name), val) );
}
token_t Rig::tokenLookup(const char *name)
hamlib_token_t Rig::tokenLookup(const char *name)
{
return rig_token_lookup(theRig, name);
}

Wyświetl plik

@ -64,7 +64,7 @@ void Rotator::close(void) {
CHECK_ROT( rot_close(theRot) );
}
void Rotator::setConf(token_t token, const char *val)
void Rotator::setConf(hamlib_token_t token, const char *val)
{
CHECK_ROT( rot_set_conf(theRot, token, val) );
}
@ -73,7 +73,7 @@ void Rotator::setConf(const char *name, const char *val)
CHECK_ROT( rot_set_conf(theRot, tokenLookup(name), val) );
}
void Rotator::getConf(token_t token, char *val)
void Rotator::getConf(hamlib_token_t token, char *val)
{
CHECK_ROT( rot_get_conf(theRot, token, val) );
}
@ -82,7 +82,7 @@ void Rotator::getConf(const char *name, char *val)
CHECK_ROT( rot_get_conf(theRot, tokenLookup(name), val) );
}
token_t Rotator::tokenLookup(const char *name)
hamlib_token_t Rotator::tokenLookup(const char *name)
{
return rot_token_lookup(theRot, name);
}

Wyświetl plik

@ -160,7 +160,7 @@ int gr_init(RIG *rig)
/*
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int gnuradio_set_conf(RIG *rig, token_t token, const char *val)
int gnuradio_set_conf(RIG *rig, hamlib_token_t token, const char *val)
{
struct gnuradio_priv_data *priv;
struct rig_state *rs;
@ -184,7 +184,7 @@ int gnuradio_set_conf(RIG *rig, token_t token, const char *val)
* Assumes rig!=NULL, rig->state.priv!=NULL
* and val points to a buffer big enough to hold the conf value.
*/
int gnuradio_get_conf(RIG *rig, token_t token, char *val)
int gnuradio_get_conf(RIG *rig, hamlib_token_t token, char *val)
{
struct gnuradio_priv_data *priv;
struct rig_state *rs;

Wyświetl plik

@ -44,8 +44,8 @@ int gr_get_vfo(RIG *rig, vfo_t *vfo);
int gr_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
int gr_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
int gnuradio_set_conf(RIG *rig, token_t token, const char *val);
int gnuradio_get_conf(RIG *rig, token_t token, char *val);
int gnuradio_set_conf(RIG *rig, hamlib_token_t token, const char *val);
int gnuradio_get_conf(RIG *rig, hamlib_token_t token, char *val);
int gnuradio_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int gnuradio_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);

Wyświetl plik

@ -53,11 +53,11 @@ public:
// This method closes the communication port to the amp
void close(void);
void setConf(token_t token, const char *val);
void setConf(hamlib_token_t token, const char *val);
void setConf(const char *name, const char *val);
void getConf(token_t token, char *val);
void getConf(hamlib_token_t token, char *val);
void getConf(const char *name, char *val);
token_t tokenLookup(const char *name);
hamlib_token_t tokenLookup(const char *name);
void setFreq(freq_t freq);
freq_t getFreq();

Wyświetl plik

@ -233,9 +233,9 @@ struct amp_caps
int (*set_freq)(AMP *amp, freq_t val); /*!< Pointer to backend implementation of ::amp_set_freq(). */
int (*get_freq)(AMP *amp, freq_t *val); /*!< Pointer to backend implementation of ::amp_get_freq(). */
int (*set_conf)(AMP *amp, token_t token, const char *val); /*!< Pointer to backend implementation of ::amp_set_conf(). */
int (*get_conf2)(AMP *amp, token_t token, char *val, int val_len); /*!< Pointer to backend implementation of ::amp_get_conf(). */
int (*get_conf)(AMP *amp, token_t token, char *val); /*!< Pointer to backend implementation of ::amp_get_conf(). */
int (*set_conf)(AMP *amp, hamlib_token_t token, const char *val); /*!< Pointer to backend implementation of ::amp_set_conf(). */
int (*get_conf2)(AMP *amp, hamlib_token_t token, char *val, int val_len); /*!< Pointer to backend implementation of ::amp_get_conf(). */
int (*get_conf)(AMP *amp, hamlib_token_t token, char *val); /*!< Pointer to backend implementation of ::amp_get_conf(). */
/*
* General API commands, from most primitive to least.. :()
@ -245,8 +245,8 @@ struct amp_caps
int (*reset)(AMP *amp, amp_reset_t reset); /*!< Pointer to backend implementation of ::amp_reset(). */
int (*get_level)(AMP *amp, setting_t level, value_t *val); /*!< Pointer to backend implementation of ::amp_get_level(). */
int (*set_level)(AMP *amp, setting_t level, value_t val); /*!< Pointer to backend implementation of ::amp_get_level(). */
int (*get_ext_level)(AMP *amp, token_t level, value_t *val); /*!< Pointer to backend implementation of ::amp_get_ext_level(). */
int (*set_ext_level)(AMP *amp, token_t level, value_t val); /*!< Pointer to backend implementation of ::amp_set_ext_level(). */
int (*get_ext_level)(AMP *amp, hamlib_token_t level, value_t *val); /*!< Pointer to backend implementation of ::amp_get_ext_level(). */
int (*set_ext_level)(AMP *amp, hamlib_token_t level, value_t val); /*!< Pointer to backend implementation of ::amp_set_ext_level(). */
int (*set_powerstat)(AMP *amp, powerstat_t status); /*!< Pointer to backend implementation of ::amp_set_powerstat(). */
int (*get_powerstat)(AMP *amp, powerstat_t *status); /*!< Pointer to backend implementation of ::amp_get_powerstat(). */
@ -336,11 +336,11 @@ amp_cleanup HAMLIB_PARAMS((AMP *amp));
extern HAMLIB_EXPORT(int)
amp_set_conf HAMLIB_PARAMS((AMP *amp,
token_t token,
hamlib_token_t token,
const char *val));
extern HAMLIB_EXPORT(int)
amp_get_conf HAMLIB_PARAMS((AMP *amp,
token_t token,
hamlib_token_t token,
char *val));
extern HAMLIB_EXPORT(int)
amp_set_powerstat HAMLIB_PARAMS((AMP *amp,
@ -408,7 +408,7 @@ extern HAMLIB_EXPORT(const struct confparams *)
amp_confparam_lookup HAMLIB_PARAMS((AMP *amp,
const char *name));
extern HAMLIB_EXPORT(token_t)
extern HAMLIB_EXPORT(hamlib_token_t)
amp_token_lookup HAMLIB_PARAMS((AMP *amp,
const char *name));
@ -429,12 +429,12 @@ amp_ext_lookup HAMLIB_PARAMS((AMP *amp,
extern HAMLIB_EXPORT(int)
amp_get_ext_level HAMLIB_PARAMS((AMP *amp,
token_t token,
hamlib_token_t token,
value_t *val));
extern HAMLIB_EXPORT(int)
amp_set_ext_level HAMLIB_PARAMS((AMP *amp,
token_t token,
hamlib_token_t token,
value_t val));
extern HAMLIB_EXPORT(const char *) amp_strlevel(setting_t);

Wyświetl plik

@ -51,6 +51,14 @@
#include <arpa/inet.h>
#endif
// mingw64 still shows __TIMESIZE != 64
// need to do more testing
#if 0
#if __TIMESIZE != 64
#warning TIMESIZE != 64 -- Please report your OS system to hamlib-developer@lists.sourceforge.net
#endif
#endif
// For MSVC install the NUGet pthread package
#if defined(_MSC_VER)
#define HAVE_STRUCT_TIMESPEC
@ -433,7 +441,6 @@ typedef enum {
typedef enum {
RIG_SPLIT_OFF = 0, /*!< Split mode disabled */
RIG_SPLIT_ON, /*!< Split mode enabled */
RIG_SPLIT_SIMPLEX = 0x10, /*< Split mode simples for ID-5100 */
} split_t;
@ -839,7 +846,8 @@ typedef enum {
/**
* \brief configuration token
*/
typedef long token_t;
typedef long hamlib_token_t;
#define token_t hamlib_token_t
//! @cond Doxygen_Suppress
@ -880,7 +888,7 @@ enum rig_conf_e {
* \brief Configuration parameter structure.
*/
struct confparams {
token_t token; /*!< Conf param token ID */
hamlib_token_t token; /*!< Conf param token ID */
const char *name; /*!< Param name, no spaces allowed */
const char *label; /*!< Human readable label */
const char *tooltip; /*!< Hint on the parameter */
@ -1533,7 +1541,7 @@ struct filter_list {
*
*/
struct ext_list {
token_t token; /*!< Token ID */
hamlib_token_t token; /*!< Token ID */
value_t val; /*!< Value */
};
@ -2078,17 +2086,17 @@ struct rig_caps {
int (*set_parm)(RIG *rig, setting_t parm, value_t val);
int (*get_parm)(RIG *rig, setting_t parm, value_t *val);
int (*set_ext_level)(RIG *rig, vfo_t vfo, token_t token, value_t val);
int (*get_ext_level)(RIG *rig, vfo_t vfo, token_t token, value_t *val);
int (*set_ext_level)(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t val);
int (*get_ext_level)(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t *val);
int (*set_ext_func)(RIG *rig, vfo_t vfo, token_t token, int status);
int (*get_ext_func)(RIG *rig, vfo_t vfo, token_t token, int *status);
int (*set_ext_func)(RIG *rig, vfo_t vfo, hamlib_token_t token, int status);
int (*get_ext_func)(RIG *rig, vfo_t vfo, hamlib_token_t token, int *status);
int (*set_ext_parm)(RIG *rig, token_t token, value_t val);
int (*get_ext_parm)(RIG *rig, token_t token, value_t *val);
int (*set_ext_parm)(RIG *rig, hamlib_token_t token, value_t val);
int (*get_ext_parm)(RIG *rig, hamlib_token_t token, value_t *val);
int (*set_conf)(RIG *rig, token_t token, const char *val);
int (*get_conf)(RIG *rig, token_t token, char *val);
int (*set_conf)(RIG *rig, hamlib_token_t token, const char *val);
int (*get_conf)(RIG *rig, hamlib_token_t token, char *val);
int (*send_dtmf)(RIG *rig, vfo_t vfo, const char *digits);
int (*recv_dtmf)(RIG *rig, vfo_t vfo, char *digits, int *length);
@ -2159,7 +2167,7 @@ struct rig_caps {
const unsigned char *frame);
// this will be used to check rigcaps structure is compatible with client
char *hamlib_check_rig_caps; // a constant value we can check for hamlib integrity
int (*get_conf2)(RIG *rig, token_t token, char *val, int val_len);
int (*get_conf2)(RIG *rig, hamlib_token_t token, char *val, int val_len);
int (*password)(RIG *rig, const char *key1); /*< Send encrypted password if rigctld is secured with -A/--password */
int (*set_lock_mode)(RIG *rig, int mode);
int (*get_lock_mode)(RIG *rig, int *mode);
@ -3318,16 +3326,16 @@ rig_get_parm HAMLIB_PARAMS((RIG *rig,
extern HAMLIB_EXPORT(int)
rig_set_conf HAMLIB_PARAMS((RIG *rig,
token_t token,
hamlib_token_t token,
const char *val));
// deprecating rig_get_conf
extern HAMLIB_EXPORT(int)
rig_get_conf HAMLIB_PARAMS((RIG *rig,
token_t token,
hamlib_token_t token,
char *val));
extern HAMLIB_EXPORT(int)
rig_get_conf2 HAMLIB_PARAMS((RIG *rig,
token_t token,
hamlib_token_t token,
char *val,
int val_len));
@ -3345,32 +3353,32 @@ rig_reset HAMLIB_PARAMS((RIG *rig,
extern HAMLIB_EXPORT(int)
rig_set_ext_level HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
token_t token,
hamlib_token_t token,
value_t val));
extern HAMLIB_EXPORT(int)
rig_get_ext_level HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
token_t token,
hamlib_token_t token,
value_t *val));
extern HAMLIB_EXPORT(int)
rig_set_ext_func HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
token_t token,
hamlib_token_t token,
int status));
extern HAMLIB_EXPORT(int)
rig_get_ext_func HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
token_t token,
hamlib_token_t token,
int *status));
extern HAMLIB_EXPORT(int)
rig_set_ext_parm HAMLIB_PARAMS((RIG *rig,
token_t token,
hamlib_token_t token,
value_t val));
extern HAMLIB_EXPORT(int)
rig_get_ext_parm HAMLIB_PARAMS((RIG *rig,
token_t token,
hamlib_token_t token,
value_t *val));
extern HAMLIB_EXPORT(int)
@ -3398,8 +3406,8 @@ rig_ext_lookup HAMLIB_PARAMS((RIG *rig,
extern HAMLIB_EXPORT(const struct confparams *)
rig_ext_lookup_tok HAMLIB_PARAMS((RIG *rig,
token_t token));
extern HAMLIB_EXPORT(token_t)
hamlib_token_t token));
extern HAMLIB_EXPORT(hamlib_token_t)
rig_ext_token_lookup HAMLIB_PARAMS((RIG *rig,
const char *name));
@ -3413,7 +3421,7 @@ rig_token_foreach HAMLIB_PARAMS((RIG *rig,
extern HAMLIB_EXPORT(const struct confparams *)
rig_confparam_lookup HAMLIB_PARAMS((RIG *rig,
const char *name));
extern HAMLIB_EXPORT(token_t)
extern HAMLIB_EXPORT(hamlib_token_t)
rig_token_lookup HAMLIB_PARAMS((RIG *rig,
const char *name));

Wyświetl plik

@ -54,11 +54,11 @@ public:
// This method closes the communication port to the rig
void close(void);
void setConf(token_t token, const char *val);
void setConf(hamlib_token_t token, const char *val);
void setConf(const char *name, const char *val);
void getConf(token_t token, char *val);
void getConf(hamlib_token_t token, char *val);
void getConf(const char *name, char *val);
token_t tokenLookup(const char *name);
hamlib_token_t tokenLookup(const char *name);
void setFreq(freq_t freq, vfo_t vfo = RIG_VFO_CURR);
freq_t getFreq(vfo_t vfo = RIG_VFO_CURR);

Wyświetl plik

@ -142,6 +142,7 @@
#define RIG_MODEL_FT990UNI RIG_MAKE_MODEL(RIG_YAESU, 48)
#define RIG_MODEL_FT710 RIG_MAKE_MODEL(RIG_YAESU, 49)
#define RIG_MODEL_FT9000OLD RIG_MAKE_MODEL(RIG_YAESU, 50)
#define RIG_MODEL_Q900 RIG_MAKE_MODEL(RIG_YAESU, 51)
/*
* Kenwood

Wyświetl plik

@ -414,8 +414,8 @@ struct rot_caps {
int (*rot_open)(ROT *rot); /*!< Pointer to backend implementation of ::rot_open(). */
int (*rot_close)(ROT *rot); /*!< Pointer to backend implementation of ::rot_close(). */
int (*set_conf)(ROT *rot, token_t token, const char *val); /*!< Pointer to backend implementation of ::rot_set_conf(). */
int (*get_conf)(ROT *rot, token_t token, char *val); /*!< Pointer to backend implementation of ::rot_get_conf(). */
int (*set_conf)(ROT *rot, hamlib_token_t token, const char *val); /*!< Pointer to backend implementation of ::rot_set_conf(). */
int (*get_conf)(ROT *rot, hamlib_token_t token, char *val); /*!< Pointer to backend implementation of ::rot_get_conf(). */
/*
* General API commands, from most primitive to least.. :()
@ -442,19 +442,19 @@ struct rot_caps {
int (*set_parm)(ROT *rot, setting_t parm, value_t val); /*!< Pointer to backend implementation of ::rot_set_parm(). */
int (*get_parm)(ROT *rot, setting_t parm, value_t *val); /*!< Pointer to backend implementation of ::rot_get_parm(). */
int (*set_ext_level)(ROT *rot, token_t token, value_t val); /*!< Pointer to backend implementation of ::rot_set_ext_level(). */
int (*get_ext_level)(ROT *rot, token_t token, value_t *val); /*!< Pointer to backend implementation of ::rot_get_ext_level(). */
int (*set_ext_level)(ROT *rot, hamlib_token_t token, value_t val); /*!< Pointer to backend implementation of ::rot_set_ext_level(). */
int (*get_ext_level)(ROT *rot, hamlib_token_t token, value_t *val); /*!< Pointer to backend implementation of ::rot_get_ext_level(). */
int (*set_ext_func)(ROT *rot, token_t token, int status); /*!< Pointer to backend implementation of ::rot_set_ext_func(). */
int (*get_ext_func)(ROT *rot, token_t token, int *status); /*!< Pointer to backend implementation of ::rot_get_ext_func(). */
int (*set_ext_func)(ROT *rot, hamlib_token_t token, int status); /*!< Pointer to backend implementation of ::rot_set_ext_func(). */
int (*get_ext_func)(ROT *rot, hamlib_token_t token, int *status); /*!< Pointer to backend implementation of ::rot_get_ext_func(). */
int (*set_ext_parm)(ROT *rot, token_t token, value_t val); /*!< Pointer to backend implementation of ::rot_set_ext_parm(). */
int (*get_ext_parm)(ROT *rot, token_t token, value_t *val); /*!< Pointer to backend implementation of ::rot_get_ext_parm(). */
int (*set_ext_parm)(ROT *rot, hamlib_token_t token, value_t val); /*!< Pointer to backend implementation of ::rot_set_ext_parm(). */
int (*get_ext_parm)(ROT *rot, hamlib_token_t token, value_t *val); /*!< Pointer to backend implementation of ::rot_get_ext_parm(). */
int (*get_status)(ROT *rot, rot_status_t *status); /*!< Pointer to backend implementation of ::rot_get_status(). */
const char *macro_name; /*!< Rotator model macro name. */
int (*get_conf2)(ROT *rot, token_t token, char *val, int val_len); /*!< Pointer to backend implementation of ::rot_get_conf2(). */
int (*get_conf2)(ROT *rot, hamlib_token_t token, char *val, int val_len); /*!< Pointer to backend implementation of ::rot_get_conf2(). */
};
//! @cond Doxygen_Suppress
#define ROT_MODEL(arg) .rot_model=arg,.macro_name=#arg
@ -545,16 +545,16 @@ rot_cleanup HAMLIB_PARAMS((ROT *rot));
extern HAMLIB_EXPORT(int)
rot_set_conf HAMLIB_PARAMS((ROT *rot,
token_t token,
hamlib_token_t token,
const char *val));
extern HAMLIB_EXPORT(int)
rot_get_conf HAMLIB_PARAMS((ROT *rot,
token_t token,
hamlib_token_t token,
char *val));
extern HAMLIB_EXPORT(int)
rot_get_conf2 HAMLIB_PARAMS((ROT *rot,
token_t token,
hamlib_token_t token,
char *val,
int val_len));
@ -636,29 +636,29 @@ rot_get_parm HAMLIB_PARAMS((ROT *rig,
extern HAMLIB_EXPORT(int)
rot_set_ext_level HAMLIB_PARAMS((ROT *rig,
token_t token,
hamlib_token_t token,
value_t val));
extern HAMLIB_EXPORT(int)
rot_get_ext_level HAMLIB_PARAMS((ROT *rig,
token_t token,
hamlib_token_t token,
value_t *val));
extern HAMLIB_EXPORT(int)
rot_set_ext_func HAMLIB_PARAMS((ROT *rig,
token_t token,
hamlib_token_t token,
int status));
extern HAMLIB_EXPORT(int)
rot_get_ext_func HAMLIB_PARAMS((ROT *rig,
token_t token,
hamlib_token_t token,
int *status));
extern HAMLIB_EXPORT(int)
rot_set_ext_parm HAMLIB_PARAMS((ROT *rig,
token_t token,
hamlib_token_t token,
value_t val));
extern HAMLIB_EXPORT(int)
rot_get_ext_parm HAMLIB_PARAMS((ROT *rig,
token_t token,
hamlib_token_t token,
value_t *val));
extern HAMLIB_EXPORT(const char *)
@ -701,7 +701,7 @@ extern HAMLIB_EXPORT(const struct confparams *)
rot_confparam_lookup HAMLIB_PARAMS((ROT *rot,
const char *name));
extern HAMLIB_EXPORT(token_t)
extern HAMLIB_EXPORT(hamlib_token_t)
rot_token_lookup HAMLIB_PARAMS((ROT *rot,
const char *name));
@ -730,8 +730,8 @@ rot_ext_lookup HAMLIB_PARAMS((ROT *rot,
extern HAMLIB_EXPORT(const struct confparams *)
rot_ext_lookup_tok HAMLIB_PARAMS((ROT *rot,
token_t token));
extern HAMLIB_EXPORT(token_t)
hamlib_token_t token));
extern HAMLIB_EXPORT(hamlib_token_t)
rot_ext_token_lookup HAMLIB_PARAMS((ROT *rot,
const char *name));

Wyświetl plik

@ -51,11 +51,11 @@ public:
// This method closes the communication port to the rot
void close(void);
void setConf(token_t token, const char *val);
void setConf(hamlib_token_t token, const char *val);
void setConf(const char *name, const char *val);
void getConf(token_t token, char *val);
void getConf(hamlib_token_t token, char *val);
void getConf(const char *name, char *val);
token_t tokenLookup(const char *name);
hamlib_token_t tokenLookup(const char *name);
void setPosition(azimuth_t az, elevation_t el);
void getPosition(azimuth_t& az, elevation_t& el);

Wyświetl plik

@ -3254,7 +3254,7 @@ int adat_get_powerstat(RIG *pRig, powerstat_t *status)
// Function adat_set_conf
// ---------------------------------------------------------------------------
// Status: IN WORK
int adat_set_conf(RIG *pRig, token_t token, const char *val)
int adat_set_conf(RIG *pRig, hamlib_token_t token, const char *val)
{
int nRC = RIG_OK;
@ -3300,7 +3300,7 @@ int adat_set_conf(RIG *pRig, token_t token, const char *val)
// Function adat_get_conf
// ---------------------------------------------------------------------------
// Status: IN WORK
int adat_get_conf(RIG *pRig, token_t token, char *val)
int adat_get_conf(RIG *pRig, hamlib_token_t token, char *val)
{
int nRC = RIG_OK;

Wyświetl plik

@ -580,8 +580,8 @@ int adat_reset(RIG *, reset_t);
int adat_open(RIG *);
int adat_close(RIG *);
int adat_set_conf(RIG *, token_t, const char *val);
int adat_get_conf(RIG *, token_t, char *val);
int adat_set_conf(RIG *, hamlib_token_t, const char *val);
int adat_get_conf(RIG *, hamlib_token_t, char *val);
int adat_set_freq(RIG *, vfo_t, freq_t);
int adat_get_freq(RIG *, vfo_t, freq_t *);

Wyświetl plik

@ -228,7 +228,7 @@ static struct ext_list *alloc_init_ext(const struct confparams *cfp)
}
#if 0 /* unused; re-enabled as needed. */
static struct ext_list *find_ext(struct ext_list *elp, token_t token)
static struct ext_list *find_ext(struct ext_list *elp, hamlib_token_t token)
{
int i;

Wyświetl plik

@ -276,7 +276,7 @@ static int dummy_amp_get_powerstat(AMP *amp, powerstat_t *status)
}
#if 0 // not implemented yet
static int dummy_amp_get_ext_level(AMP *amp, token_t token, value_t *val)
static int dummy_amp_get_ext_level(AMP *amp, hamlib_token_t token, value_t *val)
{
struct dummy_amp_priv_data *priv = (struct dummy_amp_priv_data *)
amp->state.priv;

Wyświetl plik

@ -69,13 +69,11 @@ struct dummy_priv_data
channel_t *curr; /* points to vfo_a, vfo_b or mem[] */
// we're trying to emulate all sorts of vfo possibilities so this looks redundant
channel_t vfo_a;
channel_t vfo_b;
channel_t vfo_c;
channel_t vfo_maina;
channel_t vfo_mainb;
channel_t vfo_suba;
channel_t vfo_subb;
channel_t vfo_c;
channel_t mem[NB_CHAN];
struct ext_list *ext_funcs;
@ -257,41 +255,53 @@ static int dummy_init(RIG *rig)
}
}
priv->vfo_a.ext_levels = alloc_init_ext(dummy_ext_levels);
if (!priv->vfo_a.ext_levels)
priv->vfo_maina.ext_levels = alloc_init_ext(dummy_ext_levels);
if (!priv->vfo_maina.ext_levels)
{
RETURNFUNC(-RIG_ENOMEM);
}
priv->vfo_mainb.ext_levels = alloc_init_ext(dummy_ext_levels);
if (!priv->vfo_mainb.ext_levels)
{
RETURNFUNC(-RIG_ENOMEM);
}
priv->vfo_b.ext_levels = alloc_init_ext(dummy_ext_levels);
priv->vfo_suba.ext_levels = alloc_init_ext(dummy_ext_levels);
if (!priv->vfo_suba.ext_levels)
{
RETURNFUNC(-RIG_ENOMEM);
}
priv->vfo_subb.ext_levels = alloc_init_ext(dummy_ext_levels);
if (!priv->vfo_subb.ext_levels)
{
RETURNFUNC(-RIG_ENOMEM);
}
if (!priv->vfo_b.ext_levels)
priv->vfo_c.ext_levels = alloc_init_ext(dummy_ext_levels);
if (!priv->vfo_c.ext_levels)
{
RETURNFUNC(-RIG_ENOMEM);
}
priv->ext_funcs = alloc_init_ext(dummy_ext_funcs);
if (!priv->ext_funcs)
{
RETURNFUNC(-RIG_ENOMEM);
}
priv->ext_parms = alloc_init_ext(dummy_ext_parms);
if (!priv->ext_parms)
{
RETURNFUNC(-RIG_ENOMEM);
}
init_chan(rig, RIG_VFO_A, &priv->vfo_a);
init_chan(rig, RIG_VFO_B, &priv->vfo_b);
init_chan(rig, RIG_VFO_MAIN_A, &priv->vfo_maina);
init_chan(rig, RIG_VFO_MAIN_B, &priv->vfo_mainb);
init_chan(rig, RIG_VFO_SUB_A, &priv->vfo_suba);
init_chan(rig, RIG_VFO_SUB_B, &priv->vfo_subb);
priv->curr = &priv->vfo_a;
init_chan(rig, RIG_VFO_C, &priv->vfo_c);
priv->curr = &priv->vfo_maina;
if (rig->caps->rig_model == RIG_MODEL_DUMMY_NOVFO)
{
@ -319,8 +329,11 @@ static int dummy_cleanup(RIG *rig)
free(priv->mem[i].ext_levels);
}
free(priv->vfo_a.ext_levels);
free(priv->vfo_b.ext_levels);
free(priv->vfo_maina.ext_levels);
free(priv->vfo_mainb.ext_levels);
free(priv->vfo_suba.ext_levels);
free(priv->vfo_subb.ext_levels);
free(priv->vfo_c.ext_levels);
free(priv->ext_funcs);
free(priv->ext_parms);
free(priv->magic_conf);
@ -362,7 +375,7 @@ static int dummy_close(RIG *rig)
RETURNFUNC(RIG_OK);
}
static int dummy_set_conf(RIG *rig, token_t token, const char *val)
static int dummy_set_conf(RIG *rig, hamlib_token_t token, const char *val)
{
struct dummy_priv_data *priv;
@ -391,7 +404,7 @@ static int dummy_set_conf(RIG *rig, token_t token, const char *val)
RETURNFUNC(RIG_OK);
}
static int dummy_get_conf(RIG *rig, token_t token, char *val)
static int dummy_get_conf(RIG *rig, hamlib_token_t token, char *val)
{
struct dummy_priv_data *priv;
@ -448,14 +461,12 @@ static int dummy_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
switch (vfo)
{
case RIG_VFO_MAIN:
case RIG_VFO_A: priv->vfo_a.freq = freq; break;
case RIG_VFO_A:
case RIG_VFO_MAIN_A: priv->vfo_maina.freq = freq; break;
case RIG_VFO_MAIN_B: priv->vfo_mainb.freq = freq; break;
case RIG_VFO_SUB:
case RIG_VFO_B: priv->vfo_b.freq = freq; break;
case RIG_VFO_B:
case RIG_VFO_MAIN_B: priv->vfo_mainb.freq = freq; break;
case RIG_VFO_SUB_A: priv->vfo_suba.freq = freq; break;
@ -498,14 +509,12 @@ static int dummy_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
switch (vfo)
{
case RIG_VFO_MAIN:
case RIG_VFO_A: *freq = priv->vfo_a.freq; break;
case RIG_VFO_A:
case RIG_VFO_MAIN_A: *freq = priv->vfo_maina.freq; break;
case RIG_VFO_MAIN_B: *freq = priv->vfo_mainb.freq; break;
case RIG_VFO_SUB:
case RIG_VFO_B: *freq = priv->vfo_b.freq; break;
case RIG_VFO_B:
case RIG_VFO_MAIN_B: *freq = priv->vfo_mainb.freq; break;
case RIG_VFO_SUB_A: *freq = priv->vfo_suba.freq; break;
@ -535,15 +544,23 @@ static int dummy_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
vfo = vfo_fixup(rig, vfo, rig->state.cache.split);
if (vfo == RIG_VFO_CURR) { vfo = priv->curr_vfo; }
if (width == RIG_PASSBAND_NOCHANGE)
{
switch (vfo)
{
case RIG_VFO_MAIN:
case RIG_VFO_A: width = priv->vfo_a.width; break;
case RIG_VFO_A:
case RIG_VFO_MAIN_A: width = priv->vfo_maina.width; break;
case RIG_VFO_SUB:
case RIG_VFO_B: width = priv->vfo_b.width; break;
case RIG_VFO_B:
case RIG_VFO_MAIN_B: width = priv->vfo_mainb.width; break;
case RIG_VFO_SUB_A: width = priv->vfo_suba.width; break;
case RIG_VFO_SUB_B: width = priv->vfo_subb.width; break;
case RIG_VFO_C: width = priv->vfo_c.width; break;
}
@ -552,10 +569,16 @@ static int dummy_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
switch (vfo)
{
case RIG_VFO_MAIN:
case RIG_VFO_A: priv->vfo_a.mode = mode; priv->vfo_a.width = width; break;
case RIG_VFO_A:
case RIG_VFO_MAIN_A: priv->vfo_maina.mode = mode; priv->vfo_maina.width = width; break;
case RIG_VFO_SUB:
case RIG_VFO_B: priv->vfo_b.mode = mode; priv->vfo_b.width = width; break;
case RIG_VFO_B:
case RIG_VFO_MAIN_B: priv->vfo_mainb.mode = mode; priv->vfo_mainb.width = width; break;
case RIG_VFO_SUB_A: priv->vfo_suba.mode = mode; priv->vfo_suba.width = width; break;
case RIG_VFO_SUB_B: priv->vfo_subb.mode = mode; priv->vfo_subb.width = width; break;
case RIG_VFO_C: priv->vfo_c.mode = mode; priv->vfo_c.width = width; break;
@ -575,9 +598,17 @@ static int dummy_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
switch (vfo)
{
case RIG_VFO_A: priv->vfo_a.width = width; break;
case RIG_VFO_MAIN:
case RIG_VFO_A:
case RIG_VFO_MAIN_A: priv->vfo_maina.width = width; break;
case RIG_VFO_B: priv->vfo_b.width = width; break;
case RIG_VFO_SUB:
case RIG_VFO_B:
case RIG_VFO_MAIN_B: priv->vfo_mainb.width = width; break;
case RIG_VFO_SUB_A: priv->vfo_suba.width = width; break;
case RIG_VFO_SUB_B: priv->vfo_subb.width = width; break;
case RIG_VFO_C: priv->vfo_c.width = width; break;
}
@ -594,17 +625,33 @@ static int dummy_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
usleep(CMDSLEEP);
rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rig_strvfo(vfo));
if (vfo == RIG_VFO_CURR) { vfo = rig->state.current_vfo; }
if (vfo == RIG_VFO_CURR) { vfo = priv->curr_vfo; }
switch (vfo)
{
case RIG_VFO_MAIN:
case RIG_VFO_A: *mode = priv->vfo_a.mode; *width = priv->vfo_a.width; break;
case RIG_VFO_A:
case RIG_VFO_MAIN_A:
*mode = priv->vfo_maina.mode; *width = priv->vfo_maina.width;
break;
case RIG_VFO_SUB:
case RIG_VFO_B: *mode = priv->vfo_b.mode; *width = priv->vfo_b.width; break;
case RIG_VFO_B:
case RIG_VFO_MAIN_B:
*mode = priv->vfo_mainb.mode; *width = priv->vfo_mainb.width;
break;
case RIG_VFO_C: *mode = priv->vfo_c.mode; *width = priv->vfo_c.width; break;
case RIG_VFO_SUB_A:
*mode = priv->vfo_suba.mode; *width = priv->vfo_suba.width;
break;
case RIG_VFO_SUB_B:
*mode = priv->vfo_subb.mode; *width = priv->vfo_subb.width;
break;
case RIG_VFO_C:
*mode = priv->vfo_c.mode; *width = priv->vfo_c.width;
break;
}
RETURNFUNC(RIG_OK);
@ -620,32 +667,25 @@ static int dummy_set_vfo(RIG *rig, vfo_t vfo)
usleep(CMDSLEEP);
rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rig_strvfo(vfo));
if (vfo == RIG_VFO_CURR) { vfo = rig->state.current_vfo; }
priv->last_vfo = priv->curr_vfo;
priv->curr_vfo = vfo;
if (vfo == RIG_VFO_CURR) { vfo = priv->curr_vfo; }
switch (vfo)
{
case RIG_VFO_VFO: /* FIXME */
case RIG_VFO_RX:
case RIG_VFO_MAIN: priv->curr = &priv->vfo_a; break;
case RIG_VFO_MAIN:
case RIG_VFO_A:
case RIG_VFO_MAIN_A: priv->curr = &priv->vfo_maina; break;
case RIG_VFO_SUB:
case RIG_VFO_B:
case RIG_VFO_MAIN_B: priv->curr = &priv->vfo_mainb; break;
case RIG_VFO_A: priv->curr = &priv->vfo_a; break;
case RIG_VFO_SUB: priv->curr = &priv->vfo_b; break;
case RIG_VFO_SUB_A: priv->curr = &priv->vfo_suba; break;
case RIG_VFO_SUB_B: priv->curr = &priv->vfo_subb; break;
case RIG_VFO_B: priv->curr = &priv->vfo_b; break;
case RIG_VFO_C: priv->curr = &priv->vfo_c; break;
case RIG_VFO_MEM:
@ -656,10 +696,10 @@ static int dummy_set_vfo(RIG *rig, vfo_t vfo)
}
case RIG_VFO_TX:
if (priv->tx_vfo == RIG_VFO_A) { priv->curr = &priv->vfo_a; }
else if (priv->tx_vfo == RIG_VFO_B) { priv->curr = &priv->vfo_b; }
if (priv->tx_vfo == RIG_VFO_A) { priv->curr = &priv->vfo_maina; }
else if (priv->tx_vfo == RIG_VFO_B) { priv->curr = &priv->vfo_mainb; }
else if (priv->tx_vfo == RIG_VFO_MEM) { priv->curr = &priv->mem[curr->channel_num]; }
else { priv->curr = &priv->vfo_a; }
else { priv->curr = &priv->vfo_maina; }
break;
@ -669,6 +709,8 @@ static int dummy_set_vfo(RIG *rig, vfo_t vfo)
RETURNFUNC(-RIG_EINVAL);
}
priv->last_vfo = priv->curr_vfo;
priv->curr_vfo = vfo;
rig->state.current_vfo = vfo;
RETURNFUNC(RIG_OK);
@ -943,11 +985,17 @@ static int dummy_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
int retval;
ENTERFUNC;
rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s freq=%.0f\n", __func__, rig_strvfo(vfo), tx_freq);
retval = dummy_set_freq(rig, vfo, tx_freq);
if (priv->split == RIG_SPLIT_OFF || priv->tx_vfo == RIG_VFO_NONE || priv->tx_vfo == RIG_VFO_CURR)
{
rig_debug(RIG_DEBUG_WARN, "%s: split not enabled, but set_split_freq() called? ignorning\n", __func__);
RETURNFUNC(RIG_OK);
}
retval = dummy_set_freq(rig, priv->tx_vfo, tx_freq);
priv->curr->tx_freq = tx_freq;
rig_debug(RIG_DEBUG_VERBOSE, "%s: priv->curr->tx_freq = %.0f\n", __func__,
priv->curr->tx_freq);
rig_debug(RIG_DEBUG_VERBOSE, "%s: freq=%.0f\n", __func__, tx_freq);
RETURNFUNC(retval);
}
@ -956,14 +1004,21 @@ static int dummy_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
static int dummy_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
{
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
int retval;
ENTERFUNC;
rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s\n", __func__, rig_strvfo(vfo));
*tx_freq = priv->curr->tx_freq;
rig_debug(RIG_DEBUG_VERBOSE, "%s: priv->curr->tx_freq = %.0f\n", __func__,
priv->curr->tx_freq);
if (priv->split == RIG_SPLIT_OFF || priv->tx_vfo == RIG_VFO_NONE || priv->tx_vfo == RIG_VFO_CURR)
{
rig_debug(RIG_DEBUG_WARN, "%s: split not enabled, but get_split_freq() called? ignorning\n", __func__);
RETURNFUNC(RIG_OK);
}
RETURNFUNC(RIG_OK);
retval = dummy_get_freq(rig, priv->tx_vfo, tx_freq);
rig_debug(RIG_DEBUG_VERBOSE, "%s: freq=%.0f\n", __func__, *tx_freq);
RETURNFUNC(retval);
}
static int dummy_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
@ -971,41 +1026,67 @@ static int dummy_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
{
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
channel_t *curr = priv->curr;
int retval;
ENTERFUNC;
rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s tx_mode=%s tx_width=%ld\n",
__func__, rig_strvfo(vfo), rig_strrmode(tx_mode), tx_width);
if (priv->split == RIG_SPLIT_OFF || priv->tx_vfo == RIG_VFO_NONE || priv->tx_vfo == RIG_VFO_CURR)
{
rig_debug(RIG_DEBUG_WARN, "%s: split not enabled, but set_split_mode() called? ignorning\n", __func__);
RETURNFUNC(RIG_OK);
}
retval = dummy_set_mode(rig, priv->tx_vfo, tx_mode, tx_width);
curr->tx_mode = tx_mode;
if (RIG_PASSBAND_NOCHANGE == tx_width) { RETURNFUNC(RIG_OK); }
if (RIG_PASSBAND_NOCHANGE == tx_width)
{
RETURNFUNC(retval);
}
curr->tx_width = tx_width;
RETURNFUNC(RIG_OK);
RETURNFUNC(retval);
}
static int dummy_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode,
pbwidth_t *tx_width)
{
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
const channel_t *curr = priv->curr;
int retval;
ENTERFUNC;
rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s\n", __func__, rig_strvfo(vfo));
*tx_mode = curr->tx_mode;
*tx_width = curr->tx_width;
if (priv->split == RIG_SPLIT_OFF || priv->tx_vfo == RIG_VFO_NONE || priv->tx_vfo == RIG_VFO_CURR)
{
rig_debug(RIG_DEBUG_WARN, "%s: split not enabled, but get_split_mode() called? ignorning\n", __func__);
RETURNFUNC(RIG_OK);
}
RETURNFUNC(RIG_OK);
retval = dummy_get_mode(rig, priv->tx_vfo, tx_mode, tx_width);
rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s tx_mode=%s tx_width=%ld\n",
__func__, rig_strvfo(vfo), rig_strrmode(*tx_mode), *tx_width);
RETURNFUNC(retval);
}
static int dummy_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
{
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
channel_t *curr = priv->curr;
ENTERFUNC;
rig_debug(RIG_DEBUG_VERBOSE, "%s: split=%d, vfo=%s, tx_vfo=%s\n",
__func__, split, rig_strvfo(vfo), rig_strvfo(tx_vfo));
curr->split = split;
if (tx_vfo == RIG_VFO_NONE || tx_vfo == RIG_VFO_CURR) { tx_vfo = priv->curr_vfo; }
if (tx_vfo == RIG_VFO_CURR || tx_vfo == RIG_VFO_TX) { tx_vfo = vfo_fixup(rig, vfo, rig->state.cache.split); }
priv->split = split;
priv->tx_vfo = tx_vfo;
RETURNFUNC(RIG_OK);
@ -1016,10 +1097,14 @@ static int dummy_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split,
vfo_t *tx_vfo)
{
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
const channel_t *curr = priv->curr;
ENTERFUNC;
*split = curr->split;
*split = priv->split;
*tx_vfo = priv->tx_vfo;
rig_debug(RIG_DEBUG_VERBOSE, "%s: split=%d, vfo=%s, tx_vfo=%s\n",
__func__, *split, rig_strvfo(vfo), rig_strvfo(*tx_vfo));
RETURNFUNC(RIG_OK);
}
@ -1289,7 +1374,7 @@ static int dummy_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
RETURNFUNC(RIG_OK);
}
static int dummy_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val)
static int dummy_set_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t val)
{
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
channel_t *curr = priv->curr;
@ -1359,7 +1444,7 @@ static int dummy_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val)
RETURNFUNC(RIG_OK);
}
static int dummy_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val)
static int dummy_get_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t *val)
{
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
channel_t *curr = priv->curr;
@ -1403,7 +1488,7 @@ static int dummy_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val)
}
static int dummy_set_ext_func(RIG *rig, vfo_t vfo, token_t token, int status)
static int dummy_set_ext_func(RIG *rig, vfo_t vfo, hamlib_token_t token, int status)
{
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
const struct confparams *cfp;
@ -1455,7 +1540,7 @@ static int dummy_set_ext_func(RIG *rig, vfo_t vfo, token_t token, int status)
}
static int dummy_get_ext_func(RIG *rig, vfo_t vfo, token_t token, int *status)
static int dummy_get_ext_func(RIG *rig, vfo_t vfo, hamlib_token_t token, int *status)
{
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
const struct confparams *cfp;
@ -1573,7 +1658,7 @@ static int dummy_get_parm(RIG *rig, setting_t parm, value_t *val)
RETURNFUNC(RIG_OK);
}
static int dummy_set_ext_parm(RIG *rig, token_t token, value_t val)
static int dummy_set_ext_parm(RIG *rig, hamlib_token_t token, value_t val)
{
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
char lstr[64];
@ -1640,7 +1725,7 @@ static int dummy_set_ext_parm(RIG *rig, token_t token, value_t val)
RETURNFUNC(RIG_OK);
}
static int dummy_get_ext_parm(RIG *rig, token_t token, value_t *val)
static int dummy_get_ext_parm(RIG *rig, hamlib_token_t token, value_t *val)
{
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
const struct confparams *cfp;
@ -1832,7 +1917,7 @@ static int dummy_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
{
int ch = curr->channel_num;
copy_chan(curr, priv->last_vfo == RIG_VFO_A ?
&priv->vfo_a : &priv->vfo_b);
&priv->vfo_maina : &priv->vfo_mainb);
curr->channel_num = ch;
curr->channel_desc[0] = '\0';
curr->vfo = RIG_VFO_MEM;
@ -1852,7 +1937,7 @@ static int dummy_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
if (priv->curr_vfo == RIG_VFO_MEM)
{
channel_t *vfo_chan = (priv->last_vfo == RIG_VFO_A) ?
&priv->vfo_a : &priv->vfo_b;
&priv->vfo_maina : &priv->vfo_mainb;
copy_chan(vfo_chan, curr);
chan_vfo(vfo_chan, priv->last_vfo);
}
@ -1867,14 +1952,14 @@ static int dummy_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
case RIG_OP_CPY: /* VFO A = VFO B or VFO B = VFO A */
if (priv->curr_vfo == RIG_VFO_A)
{
copy_chan(&priv->vfo_b, &priv->vfo_a);
chan_vfo(&priv->vfo_b, RIG_VFO_B);
copy_chan(&priv->vfo_mainb, &priv->vfo_maina);
chan_vfo(&priv->vfo_mainb, RIG_VFO_B);
break;
}
else if (priv->curr_vfo == RIG_VFO_B)
{
copy_chan(&priv->vfo_a, &priv->vfo_b);
chan_vfo(&priv->vfo_a, RIG_VFO_A);
copy_chan(&priv->vfo_maina, &priv->vfo_mainb);
chan_vfo(&priv->vfo_maina, RIG_VFO_A);
break;
}
@ -1891,11 +1976,11 @@ static int dummy_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
RETURNFUNC(-RIG_ENOMEM);
}
copy_chan(&chan, &priv->vfo_b);
copy_chan(&priv->vfo_b, &priv->vfo_a);
copy_chan(&priv->vfo_a, &chan);
chan_vfo(&priv->vfo_a, RIG_VFO_A);
chan_vfo(&priv->vfo_b, RIG_VFO_B);
copy_chan(&chan, &priv->vfo_mainb);
copy_chan(&priv->vfo_mainb, &priv->vfo_maina);
copy_chan(&priv->vfo_maina, &chan);
chan_vfo(&priv->vfo_maina, RIG_VFO_A);
chan_vfo(&priv->vfo_mainb, RIG_VFO_B);
free(chan.ext_levels);
break;
}
@ -2017,11 +2102,11 @@ static int dummy_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
break;
case RIG_VFO_A:
copy_chan(&priv->vfo_a, chan);
copy_chan(&priv->vfo_maina, chan);
break;
case RIG_VFO_B:
copy_chan(&priv->vfo_b, chan);
copy_chan(&priv->vfo_mainb, chan);
break;
case RIG_VFO_CURR:
@ -2068,11 +2153,11 @@ static int dummy_get_channel(RIG *rig, vfo_t vfo, channel_t *chan,
break;
case RIG_VFO_A:
copy_chan(chan, &priv->vfo_a);
copy_chan(chan, &priv->vfo_maina);
break;
case RIG_VFO_B:
copy_chan(chan, &priv->vfo_b);
copy_chan(chan, &priv->vfo_mainb);
break;
case RIG_VFO_CURR:
@ -2314,6 +2399,13 @@ struct rig_caps dummy_caps =
[LVL_SPECTRUM_REF] = {.min = {.f = -30.0f}, .max = {.f = 10.0f}, .step = {.f = 0.5f}},
[LVL_SPECTRUM_AVG] = {.min = {.i = 0}, .max = {.i = 3}, .step = {.i = 1}},
},
.parm_gran = {
[PARM_BACKLIGHT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.f = 1.0f / 255.0f}},
[PARM_BANDSELECT] = {.step = {.s = "BANDUNUSED,BAND70CM,BAND33CM,BAND23CM"}},
[PARM_BEEP] = {.min = {.i = 0}, .max = {.i = 1}},
[PARM_SCREENSAVER] = {.min = {.i = 0}, .max = {.i = 3}, .step = {.i = 1}},
[PARM_KEYERTYPE] = {.step = {.s = "STRAIGHT,BUG,PADDLE"}},
},
.ctcss_list = common_ctcss_list,
.dcs_list = full_dcs_list,
.chan_list = {

Wyświetl plik

@ -30,6 +30,11 @@ struct ext_list *alloc_init_ext(const struct confparams *cfp)
struct ext_list *elp;
int i, nb_ext;
if (cfp == NULL)
{
return NULL;
}
for (nb_ext = 0; !RIG_IS_EXT_END(cfp[nb_ext]); nb_ext++)
;
@ -51,10 +56,15 @@ struct ext_list *alloc_init_ext(const struct confparams *cfp)
return elp;
}
struct ext_list *find_ext(struct ext_list *elp, token_t token)
struct ext_list *find_ext(struct ext_list *elp, hamlib_token_t token)
{
int i;
if (elp == NULL)
{
return NULL;
}
for (i = 0; elp[i].token != 0; i++)
{
if (elp[i].token == token)

Wyświetl plik

@ -25,6 +25,6 @@
#include "hamlib/rig.h"
struct ext_list *alloc_init_ext(const struct confparams *cfp);
struct ext_list *find_ext(struct ext_list *elp, token_t token);
struct ext_list *find_ext(struct ext_list *elp, hamlib_token_t token);
#endif /* _DUMMY_H */

Wyświetl plik

@ -87,8 +87,8 @@ static int flrig_get_split_freq_mode(RIG *rig, vfo_t vfo, freq_t *freq,
static int flrig_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
static int flrig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
static int flrig_set_ext_parm(RIG *rig, token_t token, value_t val);
static int flrig_get_ext_parm(RIG *rig, token_t token, value_t *val);
static int flrig_set_ext_parm(RIG *rig, hamlib_token_t token, value_t val);
static int flrig_get_ext_parm(RIG *rig, hamlib_token_t token, value_t *val);
static const char *flrig_get_info(RIG *rig);
static int flrig_power2mW(RIG *rig, unsigned int *mwpower, float power,
@ -2397,7 +2397,7 @@ static int flrig_mW2power(RIG *rig, float *power, unsigned int mwpower,
}
static int flrig_set_ext_parm(RIG *rig, token_t token, value_t val)
static int flrig_set_ext_parm(RIG *rig, hamlib_token_t token, value_t val)
{
struct flrig_priv_data *priv = (struct flrig_priv_data *)rig->state.priv;
char lstr[64];
@ -2474,7 +2474,7 @@ static int flrig_set_ext_parm(RIG *rig, token_t token, value_t val)
RETURNFUNC(RIG_OK);
}
static int flrig_get_ext_parm(RIG *rig, token_t token, value_t *val)
static int flrig_get_ext_parm(RIG *rig, hamlib_token_t token, value_t *val)
{
struct flrig_priv_data *priv = (struct flrig_priv_data *)rig->state.priv;
const struct confparams *cfp;

Wyświetl plik

@ -201,7 +201,7 @@ static int dummy_rot_close(ROT *rot)
return RIG_OK;
}
static int dummy_set_conf(ROT *rot, token_t token, const char *val)
static int dummy_set_conf(ROT *rot, hamlib_token_t token, const char *val)
{
struct dummy_rot_priv_data *priv;
@ -226,7 +226,7 @@ static int dummy_set_conf(ROT *rot, token_t token, const char *val)
}
static int dummy_get_conf2(ROT *rot, token_t token, char *val, int val_len)
static int dummy_get_conf2(ROT *rot, hamlib_token_t token, char *val, int val_len)
{
struct dummy_rot_priv_data *priv;
@ -245,7 +245,7 @@ static int dummy_get_conf2(ROT *rot, token_t token, char *val, int val_len)
return RIG_OK;
}
static int dummy_get_conf(ROT *rot, token_t token, char *val)
static int dummy_get_conf(ROT *rot, hamlib_token_t token, char *val)
{
return dummy_get_conf2(rot, token, val, 128);
}
@ -538,7 +538,7 @@ static int dummy_get_level(ROT *rot, setting_t level, value_t *val)
return RIG_OK;
}
static int dummy_set_ext_level(ROT *rot, token_t token, value_t val)
static int dummy_set_ext_level(ROT *rot, hamlib_token_t token, value_t val)
{
struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)
rot->state.priv;
@ -607,7 +607,7 @@ static int dummy_set_ext_level(ROT *rot, token_t token, value_t val)
return RIG_OK;
}
static int dummy_get_ext_level(ROT *rot, token_t token, value_t *val)
static int dummy_get_ext_level(ROT *rot, hamlib_token_t token, value_t *val)
{
struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)
rot->state.priv;
@ -650,7 +650,7 @@ static int dummy_get_ext_level(ROT *rot, token_t token, value_t *val)
}
static int dummy_set_ext_func(ROT *rot, token_t token, int status)
static int dummy_set_ext_func(ROT *rot, hamlib_token_t token, int status)
{
struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)
rot->state.priv;
@ -702,7 +702,7 @@ static int dummy_set_ext_func(ROT *rot, token_t token, int status)
}
static int dummy_get_ext_func(ROT *rot, token_t token, int *status)
static int dummy_get_ext_func(ROT *rot, hamlib_token_t token, int *status)
{
struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)
rot->state.priv;
@ -795,7 +795,7 @@ static int dummy_get_parm(ROT *rot, setting_t parm, value_t *val)
return RIG_OK;
}
static int dummy_set_ext_parm(ROT *rot, token_t token, value_t val)
static int dummy_set_ext_parm(ROT *rot, hamlib_token_t token, value_t val)
{
struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)
rot->state.priv;
@ -861,7 +861,7 @@ static int dummy_set_ext_parm(ROT *rot, token_t token, value_t val)
return RIG_OK;
}
static int dummy_get_ext_parm(ROT *rot, token_t token, value_t *val)
static int dummy_get_ext_parm(ROT *rot, hamlib_token_t token, value_t *val)
{
struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)
rot->state.priv;

Wyświetl plik

@ -85,8 +85,8 @@ static int tci1x_get_split_freq_mode(RIG *rig, vfo_t vfo, freq_t *freq,
static int tci1x_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
static int tci1x_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
static int tci1x_set_ext_parm(RIG *rig, token_t token, value_t val);
static int tci1x_get_ext_parm(RIG *rig, token_t token, value_t *val);
static int tci1x_set_ext_parm(RIG *rig, hamlib_token_t token, value_t val);
static int tci1x_get_ext_parm(RIG *rig, hamlib_token_t token, value_t *val);
#endif
static const char *tci1x_get_info(RIG *rig);
@ -1944,7 +1944,7 @@ static int tci1x_mW2power(RIG *rig, float *power, unsigned int mwpower,
}
#ifdef XXNOTIMPLEMENTED
static int tci1x_set_ext_parm(RIG *rig, token_t token, value_t val)
static int tci1x_set_ext_parm(RIG *rig, hamlib_token_t token, value_t val)
{
struct tci1x_priv_data *priv = (struct tci1x_priv_data *)rig->state.priv;
char lstr[64];
@ -2021,7 +2021,7 @@ static int tci1x_set_ext_parm(RIG *rig, token_t token, value_t val)
RETURNFUNC(RIG_OK);
}
static int tci1x_get_ext_parm(RIG *rig, token_t token, value_t *val)
static int tci1x_get_ext_parm(RIG *rig, hamlib_token_t token, value_t *val)
{
struct tci1x_priv_data *priv = (struct tci1x_priv_data *)rig->state.priv;
const struct confparams *cfp;

Wyświetl plik

@ -3583,7 +3583,7 @@ int elad_set_channel(RIG *rig, const channel_t *chan)
return elad_transaction(rig, buf, NULL, 0);
}
int elad_set_ext_parm(RIG *rig, token_t token, value_t val)
int elad_set_ext_parm(RIG *rig, hamlib_token_t token, value_t val)
{
char buf[4];
@ -3610,7 +3610,7 @@ int elad_set_ext_parm(RIG *rig, token_t token, value_t val)
return -RIG_EINVAL;
}
int elad_get_ext_parm(RIG *rig, token_t token, value_t *val)
int elad_get_ext_parm(RIG *rig, hamlib_token_t token, value_t *val)
{
int err;
struct elad_priv_data *priv = rig->state.priv;

Wyświetl plik

@ -129,8 +129,8 @@ int elad_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int elad_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
int elad_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
int elad_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
int elad_set_ext_parm(RIG *rig, token_t token, value_t val);
int elad_get_ext_parm(RIG *rig, token_t token, value_t *val);
int elad_set_ext_parm(RIG *rig, hamlib_token_t token, value_t val);
int elad_get_ext_parm(RIG *rig, hamlib_token_t token, value_t *val);
int elad_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone);
int elad_set_ctcss_tone_tn(RIG *rig, vfo_t vfo, tone_t tone);
int elad_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone);

Wyświetl plik

@ -81,8 +81,8 @@ static int dttsp_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
static int dttsp_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
static int dttsp_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
static int dttsp_set_conf(RIG *rig, token_t token, const char *val);
static int dttsp_get_conf(RIG *rig, token_t token, char *val);
static int dttsp_set_conf(RIG *rig, hamlib_token_t token, const char *val);
static int dttsp_get_conf(RIG *rig, hamlib_token_t token, char *val);
static int dttsp_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
static int dttsp_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
static int dttsp_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
@ -400,7 +400,7 @@ static int fetch_meter(RIG *rig, int *label, float *data, int npts)
/*
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int dttsp_set_conf(RIG *rig, token_t token, const char *val)
int dttsp_set_conf(RIG *rig, hamlib_token_t token, const char *val)
{
struct dttsp_priv_data *priv;
struct rig_state *rs;
@ -439,7 +439,7 @@ int dttsp_set_conf(RIG *rig, token_t token, const char *val)
* Assumes rig!=NULL, rig->state.priv!=NULL
* and val points to a buffer big enough to hold the conf value.
*/
int dttsp_get_conf2(RIG *rig, token_t token, char *val, int val_len)
int dttsp_get_conf2(RIG *rig, hamlib_token_t token, char *val, int val_len)
{
struct dttsp_priv_data *priv;
struct rig_state *rs;
@ -473,7 +473,7 @@ int dttsp_get_conf2(RIG *rig, token_t token, char *val, int val_len)
return RIG_OK;
}
int dttsp_get_conf(RIG *rig, token_t token, char *val)
int dttsp_get_conf(RIG *rig, hamlib_token_t token, char *val)
{
return dttsp_get_conf2(rig, token, val, 128);
}

Wyświetl plik

@ -71,7 +71,7 @@ struct gs100_priv_data
/* Imported Functions --------------------------------------------------------*/
struct ext_list *alloc_init_ext(const struct confparams *cfp);
struct ext_list *find_ext(struct ext_list *elp, token_t token);
struct ext_list *find_ext(struct ext_list *elp, hamlib_token_t token);
/* Private function prototypes -----------------------------------------------*/
@ -166,7 +166,7 @@ static int gs100_close(RIG *rig)
/* GS100 transceiver set configuration */
static int gs100_set_conf(RIG *rig, token_t token, const char *val)
static int gs100_set_conf(RIG *rig, hamlib_token_t token, const char *val)
{
__attribute__((unused)) struct gs100_priv_data *priv = (struct gs100_priv_data
*)rig->state.priv;
@ -192,7 +192,7 @@ static int gs100_set_conf(RIG *rig, token_t token, const char *val)
/* GS100 transceiver get configuration */
static int gs100_get_conf(RIG *rig, token_t token, char *val)
static int gs100_get_conf(RIG *rig, hamlib_token_t token, char *val)
{
__attribute__((unused)) struct gs100_priv_data *priv = (struct gs100_priv_data
*)rig->state.priv;

Wyświetl plik

@ -327,7 +327,7 @@ int icm710_cleanup(RIG *rig)
return RIG_OK;
}
int icm710_set_conf(RIG *rig, token_t token, const char *val)
int icm710_set_conf(RIG *rig, hamlib_token_t token, const char *val)
{
struct icm710_priv_data *priv;
@ -346,7 +346,7 @@ int icm710_set_conf(RIG *rig, token_t token, const char *val)
return RIG_OK;
}
int icm710_get_conf2(RIG *rig, token_t token, char *val, int val_len)
int icm710_get_conf2(RIG *rig, hamlib_token_t token, char *val, int val_len)
{
struct icm710_priv_data *priv;
@ -365,7 +365,7 @@ int icm710_get_conf2(RIG *rig, token_t token, char *val, int val_len)
return RIG_OK;
}
int icm710_get_conf(RIG *rig, token_t token, char *val)
int icm710_get_conf(RIG *rig, hamlib_token_t token, char *val)
{
return icm710_get_conf2(rig, token, val, 128);
}

Wyświetl plik

@ -71,9 +71,9 @@ int icm710_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
int icm710_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
int icm710_set_parm(RIG *rig, setting_t parm, value_t val);
int icm710_get_parm(RIG *rig, setting_t parm, value_t *val);
int icm710_set_conf(RIG *rig, token_t token, const char *val);
int icm710_get_conf(RIG *rig, token_t token, char *val);
int icm710_get_conf2(RIG *rig, token_t token, char *val, int val_len);
int icm710_set_conf(RIG *rig, hamlib_token_t token, const char *val);
int icm710_get_conf(RIG *rig, hamlib_token_t token, char *val);
int icm710_get_conf2(RIG *rig, hamlib_token_t token, char *val, int val_len);
extern struct rig_caps icm700pro_caps;
extern struct rig_caps icm710_caps;

Wyświetl plik

@ -183,7 +183,7 @@ int icmarine_open(RIG *rig)
#endif
int icmarine_set_conf(RIG *rig, token_t token, const char *val)
int icmarine_set_conf(RIG *rig, hamlib_token_t token, const char *val)
{
struct icmarine_priv_data *priv;
@ -202,7 +202,7 @@ int icmarine_set_conf(RIG *rig, token_t token, const char *val)
return RIG_OK;
}
int icmarine_get_conf2(RIG *rig, token_t token, char *val, int val_len)
int icmarine_get_conf2(RIG *rig, hamlib_token_t token, char *val, int val_len)
{
struct icmarine_priv_data *priv;
@ -221,7 +221,7 @@ int icmarine_get_conf2(RIG *rig, token_t token, char *val, int val_len)
return RIG_OK;
}
int icmarine_get_conf(RIG *rig, token_t token, char *val)
int icmarine_get_conf(RIG *rig, hamlib_token_t token, char *val)
{
return icmarine_get_conf2(rig, token, val, 128);
}

Wyświetl plik

@ -61,9 +61,9 @@ int icmarine_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
int icmarine_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
int icmarine_set_parm(RIG *rig, setting_t parm, value_t val);
int icmarine_get_parm(RIG *rig, setting_t parm, value_t *val);
int icmarine_set_conf(RIG *rig, token_t token, const char *val);
int icmarine_get_conf(RIG *rig, token_t token, char *val);
int icmarine_get_conf2(RIG *rig, token_t token, char *val, int val_len);
int icmarine_set_conf(RIG *rig, hamlib_token_t token, const char *val);
int icmarine_get_conf(RIG *rig, hamlib_token_t token, char *val);
int icmarine_get_conf2(RIG *rig, hamlib_token_t token, char *val, int val_len);
extern struct rig_caps icm700pro_caps;
extern struct rig_caps icm710_caps;

Wyświetl plik

@ -200,7 +200,14 @@ static const struct icom_priv_caps ic7100_priv_caps =
},
.extcmds = ic7100_extcmds,
.antack_len = 2,
.ant_count = 2
.ant_count = 2,
.x25x26_always = 0,
.x25x26_possibly = 1,
.x1cx03_always = 0,
.x1cx03_possibly = 1,
.x1ax03_supported = 1,
.mode_with_filter = 1,
.data_mode_supported = 1
};
// if hour < 0 then only date will be set
@ -373,7 +380,7 @@ struct rig_caps ic7100_caps =
.max_ifshift = Hz(0),
.agc_level_count = 3,
.agc_levels = { RIG_AGC_FAST, RIG_AGC_MEDIUM, RIG_AGC_SLOW },
.targetable_vfo = 0,
.targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE,
.vfo_ops = IC7100_VFO_OPS,
.scan_ops = IC7100_SCAN_OPS,
.transceive = RIG_TRN_RIG,
@ -480,8 +487,8 @@ struct rig_caps ic7100_caps =
.get_freq = icom_get_freq,
.set_freq = icom_set_freq,
.get_mode = icom_get_mode_with_data,
.set_mode = icom_set_mode_with_data,
.get_mode = icom_get_mode,
.set_mode = icom_set_mode,
// .get_vfo = icom_get_vfo,
.set_vfo = icom_set_vfo,

Wyświetl plik

@ -116,6 +116,13 @@ static const struct icom_priv_caps IC7200_priv_caps =
{ .level = RIG_AGC_SLOW, .icom_level = 2 },
{ .level = RIG_AGC_LAST, .icom_level = -1 },
},
.x25x26_always = 0,
.x25x26_possibly = 0,
.x1cx03_always = 0,
.x1cx03_possibly = 0,
.x1ax03_supported = 1,
.mode_with_filter = 1,
.data_mode_supported = 1
};
struct rig_caps ic7200_caps =
@ -244,8 +251,8 @@ struct rig_caps ic7200_caps =
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode_with_data,
.get_mode = icom_get_mode_with_data,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
// .get_vfo = icom_get_vfo,
.set_ant = NULL, /*automatically set by rig depending band */

Wyświetl plik

@ -409,7 +409,13 @@ static const struct icom_priv_caps IC7300_priv_caps =
},
},
.extcmds = ic7300_extcmds, /* Custom op parameters */
.x25_always = 1
.x25x26_always = 1,
.x25x26_possibly = 1,
.x1cx03_always = 1,
.x1cx03_possibly = 1,
.x1ax03_supported = 1,
.mode_with_filter = 1,
.data_mode_supported = 1
};
static const struct icom_priv_caps IC9700_priv_caps =
@ -458,7 +464,13 @@ static const struct icom_priv_caps IC9700_priv_caps =
},
},
.extcmds = ic9700_extcmds, /* Custom op parameters */
// .x25_always = 1 // except when in satellite mode so can't do this
.x25x26_always = 1,
.x25x26_possibly = 1,
.x1cx03_always = 1,
.x1cx03_possibly = 1,
.x1ax03_supported = 1,
.mode_with_filter = 1,
.data_mode_supported = 1
};
static const struct icom_priv_caps IC705_priv_caps =
@ -582,6 +594,13 @@ static const struct icom_priv_caps IC705_priv_caps =
},
},
.extcmds = ic705_extcmds, /* Custom parameters */
.x25x26_always = 1,
.x25x26_possibly = 1,
.x1cx03_always = 1,
.x1cx03_possibly = 1,
.x1ax03_supported = 1,
.mode_with_filter = 1,
.data_mode_supported = 1
};
static const struct icom_priv_caps IC905_priv_caps =
@ -704,6 +723,13 @@ static const struct icom_priv_caps IC905_priv_caps =
},
},
.extcmds = ic705_extcmds, /* Custom parameters */
.x25x26_always = 1,
.x25x26_possibly = 1,
.x1cx03_always = 1,
.x1cx03_possibly = 1,
.x1ax03_supported = 1,
.mode_with_filter = 1,
.data_mode_supported = 1
};
struct rig_caps ic7300_caps =
@ -750,7 +776,7 @@ struct rig_caps ic7300_caps =
[PARM_BEEP] = {.min = {.i = 0}, .max = {.i = 1}, .step = {.i = 1}},
[PARM_SCREENSAVER] = {.min = {.i = 0}, .max = {.i = 3}, .step = {.i = 1}},
[PARM_TIME] = {.min = {.i = 0}, .max = {.i = 86399}, .step = {.i = 1}},
[PARM_KEYERTYPE] = {.step = {.s = "STRAIGHT, BUG, PADDLE"}},
[PARM_KEYERTYPE] = {.step = {.s = "STRAIGHT,BUG,PADDLE"}},
},
.ext_tokens = ic7300_ext_tokens,
@ -894,8 +920,8 @@ struct rig_caps ic7300_caps =
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode_with_data,
.get_mode = icom_get_mode_with_data,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
// .get_vfo = icom_get_vfo,
.set_vfo = icom_set_vfo,
.set_ant = NULL,
@ -993,7 +1019,7 @@ struct rig_caps ic9700_caps =
[PARM_BANDSELECT] = {.step = {.s = "BANDUNUSED,BAND70CM,BAND33CM,BAND23CM"}},
[PARM_BEEP] = {.min = {.i = 0}, .max = {.i = 1}},
[PARM_SCREENSAVER] = {.min = {.i = 0}, .max = {.i = 3}, .step = {.i = 1}},
[PARM_KEYERTYPE] = {.step = {.s = "STRAIGHT, BUG, PADDLE"}},
[PARM_KEYERTYPE] = {.step = {.s = "STRAIGHT,BUG,PADDLE"}},
},
.ext_tokens = ic9700_ext_tokens,
.extlevels = icom_ext_levels,
@ -1219,8 +1245,9 @@ struct rig_caps ic9700_caps =
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode_with_data,
.get_mode = icom_get_mode_with_data,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
// IC-9700 can indicate Main/Sub band selection, but not VFO A/B, so leave get_vfo not implemented
// .get_vfo = icom_get_vfo,
.set_vfo = ic9700_set_vfo,
.set_ant = NULL,
@ -1491,8 +1518,8 @@ struct rig_caps ic705_caps =
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode_with_data,
.get_mode = icom_get_mode_with_data,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
// .get_vfo = icom_get_vfo,
.set_vfo = icom_set_vfo,
.set_ant = NULL,
@ -1588,7 +1615,7 @@ struct rig_caps ic905_caps =
[PARM_BANDSELECT] = {.step = {.s = "BANDUNUSED,BAND70CM,BAND33CM,BAND23CM,BAND23CM,BAND13CM,BAND3CM"}},
[PARM_BEEP] = {.min = {.i = 0}, .max = {.i = 1}},
[PARM_SCREENSAVER] = {.min = {.i = 0}, .max = {.i = 3}, .step = {.i = 1}},
[PARM_KEYERTYPE] = {.step = {.s = "STRAIGHT, BUG, PADDLE"}},
[PARM_KEYERTYPE] = {.step = {.s = "STRAIGHT,BUG,PADDLE"}},
},
.ext_tokens = ic705_ext_tokens,
.extlevels = icom_ext_levels,
@ -1761,8 +1788,8 @@ struct rig_caps ic905_caps =
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode_with_data,
.get_mode = icom_get_mode_with_data,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
// .get_vfo = icom_get_vfo,
.set_vfo = icom_set_vfo,
.set_ant = NULL,
@ -2187,48 +2214,38 @@ int ic9700_get_clock(RIG *rig, int *year, int *month, int *day, int *hour,
int ic9700_set_vfo(RIG *rig, vfo_t vfo)
{
ENTERFUNC;
unsigned char ackbuf[MAXFRAMELEN];
int ack_len = sizeof(ackbuf), retval = -RIG_EINTERNAL;
int ack_len = sizeof(ackbuf);
int retval;
int vfo_is_main_or_sub = (vfo == RIG_VFO_MAIN) || (vfo == RIG_VFO_SUB);
ENTERFUNC;
rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s\n", __func__, rig_strvfo(vfo));
if (rig->state.cache.satmode)
if (rig->state.cache.satmode && !vfo_is_main_or_sub)
{
if (vfo == RIG_VFO_A) { vfo = RIG_VFO_MAIN; }
else if (vfo == RIG_VFO_B) { vfo = RIG_VFO_SUB; }
// Translate VFO A/B to Main/Sub in satellite mode
if (vfo == RIG_VFO_A)
{
vfo = RIG_VFO_MAIN;
}
else if (vfo == RIG_VFO_B)
{
vfo = RIG_VFO_SUB;
}
else
{
rig_debug(RIG_DEBUG_ERR, "%s: unknown vfo %s\n", __func__, rig_strvfo(vfo));
rig_debug(RIG_DEBUG_ERR, "%s: Invalid VFO %s in satellite mode\n", __func__, rig_strvfo(vfo));
return -RIG_EINVAL;
}
}
if (vfo == RIG_VFO_A)
{
retval = icom_transaction(rig, 0x07, 0x00, NULL, 0, ackbuf, &ack_len);
retval = icom_transaction(rig, C_SET_VFO, S_VFOA, NULL, 0, ackbuf, &ack_len);
}
else if (vfo == RIG_VFO_B)
{
retval = icom_transaction(rig, 0x07, 0x01, NULL, 0, ackbuf, &ack_len);
}
else if (vfo == RIG_VFO_MAIN || vfo == RIG_VFO_MAIN_A || vfo == RIG_VFO_MAIN_B)
{
retval = icom_transaction(rig, 0x07, 0xd0, NULL, 0, ackbuf, &ack_len);
if (retval != RIG_OK)
{
rig_debug(RIG_DEBUG_ERR, "%s: %s\n", __func__, rigerror(retval));
return -retval;
}
if (vfo == RIG_VFO_MAIN_A || vfo == RIG_VFO_MAIN_B)
{
int subcmd = vfo == RIG_VFO_MAIN_A ? 0x00 : 0x01;
retval = icom_transaction(rig, 0x07, subcmd, NULL, 0, ackbuf, &ack_len);
}
}
else if (vfo == RIG_VFO_SUB || vfo == RIG_VFO_SUB_A || vfo == RIG_VFO_SUB_B)
{
if (rig->state.cache.satmode)
{
@ -2238,31 +2255,69 @@ int ic9700_set_vfo(RIG *rig, vfo_t vfo)
return RIG_OK;
}
// first switch to sub
retval = icom_transaction(rig, 0x07, 0xd1, NULL, 0, ackbuf, &ack_len);
retval = icom_transaction(rig, C_SET_VFO, S_VFOB, NULL, 0, ackbuf, &ack_len);
}
else if (vfo == RIG_VFO_MAIN || vfo == RIG_VFO_MAIN_A || vfo == RIG_VFO_MAIN_B)
{
// First switch to Main receiver
retval = icom_transaction(rig, C_SET_VFO, S_MAIN, NULL, 0, ackbuf, &ack_len);
if (retval != RIG_OK)
{
rig_debug(RIG_DEBUG_ERR, "%s: %s\n", __func__, rigerror(retval));
return -retval;
return retval;
}
if (rig->state.cache.satmode && vfo == RIG_VFO_MAIN_B)
{
rig_debug(RIG_DEBUG_WARN, "%s: cannot switch to VFOB when in satmode\n", __func__);
// we return RIG_OK anyways as this should just be a bad request
return RIG_OK;
}
if (vfo == RIG_VFO_MAIN_A || vfo == RIG_VFO_MAIN_B)
{
int subcmd = vfo == RIG_VFO_MAIN_A ? S_VFOA : S_VFOB;
retval = icom_transaction(rig, C_SET_VFO, subcmd, NULL, 0, ackbuf, &ack_len);
}
}
else if (vfo == RIG_VFO_SUB || vfo == RIG_VFO_SUB_A || vfo == RIG_VFO_SUB_B)
{
// First switch to Sub receiver
retval = icom_transaction(rig, C_SET_VFO, S_SUB, NULL, 0, ackbuf, &ack_len);
if (retval != RIG_OK)
{
rig_debug(RIG_DEBUG_ERR, "%s: %s\n", __func__, rigerror(retval));
return retval;
}
if (rig->state.cache.satmode && vfo == RIG_VFO_SUB_B)
{
rig_debug(RIG_DEBUG_WARN, "%s: cannot switch to VFOB when in satmode\n", __func__);
// we return RIG_OK anyways as this should just be a bad request
return RIG_OK;
}
if (vfo == RIG_VFO_SUB_A || vfo == RIG_VFO_SUB_B)
{
HAMLIB_TRACE;
int subcmd = vfo == RIG_VFO_SUB_A ? 0x00 : 0x01;
retval = icom_transaction(rig, 0x07, subcmd, NULL, 0, ackbuf, &ack_len);
int subcmd = vfo == RIG_VFO_SUB_A ? S_VFOA : S_VFOB;
retval = icom_transaction(rig, C_SET_VFO, subcmd, NULL, 0, ackbuf, &ack_len);
}
}
else if (vfo == RIG_VFO_MEM)
{
return icom_set_vfo(rig, vfo);
}
else
{
// Unsupported VFO
RETURNFUNC(-RIG_EINVAL);
}
if (retval != RIG_OK)
{
rig_debug(RIG_DEBUG_ERR, "%s: %s\n", __func__, rigerror(retval));
return -retval;
return retval;
}
RETURNFUNC(retval);

Wyświetl plik

@ -115,6 +115,7 @@ static const struct icom_priv_caps ic7410_priv_caps =
{ .level = RIG_AGC_FAST, .icom_level = 3 },
{ .level = RIG_AGC_LAST, .icom_level = -1 },
},
.data_mode_supported = 1,
};
@ -155,7 +156,7 @@ struct rig_caps ic7410_caps =
.parm_gran = {
[PARM_BACKLIGHT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.f = 1.0f / 255.0f}},
[PARM_ANN] = {.min = {.i = 0}, .max = {.i = 2}, .step = {.i = 1}},
[PARM_KEYERTYPE] = {.step = {.s = "STRAIGHT, BUG, PADDLE"}},
[PARM_KEYERTYPE] = {.step = {.s = "STRAIGHT,BUG,PADDLE"}},
},
.ctcss_list = common_ctcss_list,
@ -249,8 +250,8 @@ struct rig_caps ic7410_caps =
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode_with_data,
.get_mode = icom_get_mode_with_data,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
// .get_vfo = icom_get_vfo,
.set_ant = icom_set_ant,

Wyświetl plik

@ -151,8 +151,8 @@ static int ic746_get_parm(RIG *rig, setting_t parm, value_t *val);
static int ic746pro_get_channel(RIG *rig, vfo_t vfo, channel_t *chan,
int read_only);
static int ic746pro_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan);
static int ic746pro_set_ext_parm(RIG *rig, token_t token, value_t val);
static int ic746pro_get_ext_parm(RIG *rig, token_t token, value_t *val);
static int ic746pro_set_ext_parm(RIG *rig, hamlib_token_t token, value_t val);
static int ic746pro_get_ext_parm(RIG *rig, hamlib_token_t token, value_t *val);
/*
@ -556,8 +556,8 @@ struct rig_caps ic746pro_caps =
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode_with_data,
.get_mode = icom_get_mode_with_data,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
// .get_vfo = icom_get_vfo,
.set_ant = icom_set_ant,
@ -603,7 +603,7 @@ struct rig_caps ic746pro_caps =
/*
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
static int ic746pro_set_ext_parm(RIG *rig, token_t token, value_t val)
static int ic746pro_set_ext_parm(RIG *rig, hamlib_token_t token, value_t val)
{
unsigned char epbuf[MAXFRAMELEN], ackbuf[MAXFRAMELEN];
int ack_len, ep_len, val_len;
@ -667,7 +667,7 @@ static int ic746pro_set_ext_parm(RIG *rig, token_t token, value_t val)
* Assumes rig!=NULL, rig->state.priv!=NULL
* and val points to a buffer big enough to hold the conf value.
*/
static int ic746pro_get_ext_parm(RIG *rig, token_t token, value_t *val)
static int ic746pro_get_ext_parm(RIG *rig, hamlib_token_t token, value_t *val)
{
const struct confparams *cfp;

Wyświetl plik

@ -471,6 +471,7 @@ static const struct icom_priv_caps ic756pro2_priv_caps =
{ .level = RIG_AGC_LAST, .icom_level = -1 },
},
.extcmds = ic756pro_cmdparms, /* Custom op parameters */
.data_mode_supported = 1
};
/*
@ -527,8 +528,8 @@ static const struct confparams ic756pro2_ext_parms[] =
#define S_MEM_RTTY_TWNPK 0x562 /* rtty twin peak filter off/on */
static int ic756pro2_set_ext_parm(RIG *rig, token_t token, value_t val);
static int ic756pro2_get_ext_parm(RIG *rig, token_t token, value_t *val);
static int ic756pro2_set_ext_parm(RIG *rig, hamlib_token_t token, value_t val);
static int ic756pro2_get_ext_parm(RIG *rig, hamlib_token_t token, value_t *val);
#define IC756PROII_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_FM)
#define IC756PROII_1HZ_TS_MODES IC756PROII_ALL_RX_MODES
@ -651,8 +652,8 @@ struct rig_caps ic756pro2_caps =
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode_with_data,
.get_mode = icom_get_mode_with_data,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
// .get_vfo = icom_get_vfo,
.set_ant = icom_set_ant,
@ -698,7 +699,7 @@ struct rig_caps ic756pro2_caps =
/*
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
static int ic756pro2_set_ext_parm(RIG *rig, token_t token, value_t val)
static int ic756pro2_set_ext_parm(RIG *rig, hamlib_token_t token, value_t val)
{
unsigned char epbuf[MAXFRAMELEN], ackbuf[MAXFRAMELEN];
int ack_len, ep_len, val_len;
@ -779,7 +780,7 @@ static int ic756pro2_set_ext_parm(RIG *rig, token_t token, value_t val)
* Assumes rig!=NULL, rig->state.priv!=NULL
* and val points to a buffer big enough to hold the conf value.
*/
static int ic756pro2_get_ext_parm(RIG *rig, token_t token, value_t *val)
static int ic756pro2_get_ext_parm(RIG *rig, hamlib_token_t token, value_t *val)
{
const struct confparams *cfp;
@ -902,6 +903,7 @@ static const struct icom_priv_caps ic756pro3_priv_caps =
{ .level = RIG_AGC_LAST, .icom_level = -1 },
},
.extcmds = ic756pro_cmdparms, /* Custom op parameters */
.data_mode_supported = 1
};
@ -1102,8 +1104,8 @@ struct rig_caps ic756pro3_caps =
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode_with_data,
.get_mode = icom_get_mode_with_data,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
// .get_vfo = icom_get_vfo,
.set_ant = icom_set_ant,

Wyświetl plik

@ -161,6 +161,13 @@ static const struct icom_priv_caps ic7600_priv_caps =
{ .level = RIG_AGC_LAST, .icom_level = -1 },
},
.extcmds = ic7600_extcmds, /* Custom op parameters */
.x25x26_always = 0,
.x25x26_possibly = 1,
.x1cx03_always = 0,
.x1cx03_possibly = 1,
.x1ax03_supported = 1,
.mode_with_filter = 1,
.data_mode_supported = 1
};
@ -317,7 +324,7 @@ struct rig_caps ic7600_caps =
[PARM_TIME] = {.min = {.i = 0}, .max = {.i = 86399}, .step = {.i = 1}},
[PARM_ANN] = {.min = {.i = 0}, .max = {.i = 2}, .step = {.i = 1}},
[PARM_APO] = { .min = { .i = 1 }, .max = { .i = 1439} },
[PARM_KEYERTYPE] = {.step = {.s = "STRAIGHT, BUG, PADDLE"}},
[PARM_KEYERTYPE] = {.step = {.s = "STRAIGHT,BUG,PADDLE"}},
},
.ext_tokens = ic7600_ext_tokens,
@ -333,7 +340,7 @@ struct rig_caps ic7600_caps =
.max_ifshift = Hz(0),
.agc_level_count = 3,
.agc_levels = { RIG_AGC_FAST, RIG_AGC_MEDIUM, RIG_AGC_SLOW },
.targetable_vfo = 0,
.targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE,
.vfo_ops = IC7600_VFO_OPS,
.scan_ops = IC7600_SCAN_OPS,
.transceive = RIG_TRN_RIG,
@ -424,10 +431,10 @@ struct rig_caps ic7600_caps =
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode_with_data,
.get_mode = icom_get_mode_with_data,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
// .get_vfo = icom_get_vfo,
.get_vfo = icom_get_vfo,
.set_ant = icom_set_ant,
.get_ant = icom_get_ant,

Wyświetl plik

@ -242,7 +242,13 @@ static const struct icom_priv_caps ic7610_priv_caps =
},
},
.extcmds = ic7610_extcmds,
.x25_always = 1,
.x25x26_always = 1,
.x25x26_possibly = 1,
.x1cx03_always = 1,
.x1cx03_possibly = 1,
.x1ax03_supported = 1,
.mode_with_filter = 1,
.data_mode_supported = 1
};
@ -402,7 +408,7 @@ struct rig_caps ic7610_caps =
[PARM_BEEP] = {.min = {.i = 0}, .max = {.i = 1}, .step = {.i = 1}},
[PARM_TIME] = {.min = {.i = 0}, .max = {.i = 86399}, .step = {.i = 1}},
[PARM_ANN] = {.min = {.i = 0}, .max = {.i = 2}, .step = {.i = 1}},
[PARM_KEYERTYPE] = {.step = {.s = "STRAIGHT, BUG, PADDLE"}},
[PARM_KEYERTYPE] = {.step = {.s = "STRAIGHT,BUG,PADDLE"}},
},
.ext_tokens = ic7610_ext_tokens,
@ -565,10 +571,10 @@ struct rig_caps ic7610_caps =
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode_with_data,
.get_mode = icom_get_mode_with_data,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
// .get_vfo = icom_get_vfo,
.get_vfo = icom_get_vfo,
.set_ant = icom_set_ant,
.get_ant = icom_get_ant,

Wyświetl plik

@ -143,6 +143,13 @@ static const struct icom_priv_caps ic7700_priv_caps =
{ .level = RIG_AGC_LAST, .icom_level = -1 },
},
.extcmds = ic7700_extcmds,
.x25x26_always = 0,
.x25x26_possibly = 1,
.x1cx03_always = 0,
.x1cx03_possibly = 1,
.x1ax03_supported = 1,
.mode_with_filter = 1,
.data_mode_supported = 1
};
// if hour < 0 then only date will be set
@ -316,7 +323,7 @@ struct rig_caps ic7700_caps =
.agc_level_count = 4,
.agc_levels = { RIG_AGC_OFF, RIG_AGC_FAST, RIG_AGC_MEDIUM, RIG_AGC_SLOW },
// 7700 can have a different mode on VFOB but requires VFO swap
.targetable_vfo = RIG_TARGETABLE_MODE,
.targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE,
.vfo_ops = IC7700_VFO_OPS,
.scan_ops = IC7700_SCAN_OPS,
.transceive = RIG_TRN_RIG,
@ -407,8 +414,8 @@ struct rig_caps ic7700_caps =
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode_with_data,
.get_mode = icom_get_mode_with_data,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
// .get_vfo = icom_get_vfo,
.set_ant = icom_set_ant,

Wyświetl plik

@ -153,6 +153,13 @@ static const struct icom_priv_caps ic7800_priv_caps =
{ .level = RIG_AGC_LAST, .icom_level = -1 },
},
.extcmds = ic7800_extcmds,
.x25x26_always = 0,
.x25x26_possibly = 1,
.x1cx03_always = 0,
.x1cx03_possibly = 1,
.x1ax03_supported = 1,
.mode_with_filter = 1,
.data_mode_supported = 1
};
struct rig_caps ic7800_caps =
@ -296,10 +303,10 @@ struct rig_caps ic7800_caps =
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode_with_data,
.get_mode = icom_get_mode_with_data,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
// .get_vfo = icom_get_vfo,
.get_vfo = icom_get_vfo,
.set_ant = icom_set_ant,
.get_ant = icom_get_ant,

Wyświetl plik

@ -235,7 +235,13 @@ static struct icom_priv_caps ic785x_priv_caps =
},
},
.extcmds = ic785x_extcmds,
.x25_always = 1,
.x25x26_always = 1,
.x25x26_possibly = 1,
.x1cx03_always = 1,
.x1cx03_possibly = 1,
.x1ax03_supported = 1,
.mode_with_filter = 1,
.data_mode_supported = 1
};
struct rig_caps ic785x_caps =
@ -282,7 +288,7 @@ struct rig_caps ic785x_caps =
[PARM_BEEP] = {.min = {.i = 0}, .max = {.i = 1}, .step = {.i = 1}},
[PARM_TIME] = {.min = {.i = 0}, .max = {.i = 86399}, .step = {.i = 1}},
[PARM_ANN] = {.min = {.i = 0}, .max = {.i = 2}, .step = {.i = 1}},
[PARM_KEYERTYPE] = {.step = {.s = "STRAIGHT, BUG, PADDLE"}},
[PARM_KEYERTYPE] = {.step = {.s = "STRAIGHT,BUG,PADDLE"}},
},
.ext_tokens = ic785x_ext_tokens,
@ -443,10 +449,10 @@ struct rig_caps ic785x_caps =
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode_with_data,
.get_mode = icom_get_mode_with_data,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
// .get_vfo = icom_get_vfo,
.get_vfo = icom_get_vfo,
.set_ant = icom_set_ant,
.get_ant = icom_get_ant,

Wyświetl plik

@ -56,7 +56,6 @@ static const struct icom_priv_caps ic821h_priv_caps =
// If Main/Sub we assume we're doing satmode
int ic821h_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
{
struct icom_priv_data *priv = (struct icom_priv_data *) rig->state.priv;
int retval = -RIG_EINTERNAL;
ENTERFUNC;
@ -69,14 +68,14 @@ int ic821h_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
split; // we emulate satmode of other rigs since we apparently can't query
rig_debug(RIG_DEBUG_TRACE, "%s: tx_vfo==MAIN so assuming sat mode=%d\n",
__func__, rig->state.cache.satmode);
priv->tx_vfo = split == RIG_SPLIT_ON ? RIG_VFO_SUB : RIG_VFO_MAIN;
rig->state.tx_vfo = split == RIG_SPLIT_ON ? RIG_VFO_SUB : RIG_VFO_MAIN;
// the IC821 seems to be backwards in satmode -- setting Main select Sub and vice versa
retval = rig_set_vfo(rig, RIG_VFO_SUB);
}
else if (tx_vfo == RIG_VFO_A)
{
retval = rig_set_vfo(rig, RIG_VFO_A);
priv->tx_vfo = split == RIG_SPLIT_ON ? RIG_VFO_B : RIG_VFO_A;
rig->state.tx_vfo = split == RIG_SPLIT_ON ? RIG_VFO_B : RIG_VFO_A;
}
else
{

Wyświetl plik

@ -102,6 +102,13 @@ static const struct icom_priv_caps ic9100_priv_caps =
.antack_len = 2,
.ant_count = 2,
.extcmds = ic9100_extcmds,
.x25x26_always = 0,
.x25x26_possibly = 0,
.x1cx03_always = 0,
.x1cx03_possibly = 0,
.x1ax03_supported = 1,
.mode_with_filter = 1,
.data_mode_supported = 1
};
struct rig_caps ic9100_caps =
@ -140,7 +147,7 @@ struct rig_caps ic9100_caps =
[PARM_BACKLIGHT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.f = 1.0f / 255.0f}},
[PARM_BANDSELECT] = {.step = {.s = "BANDUNUSED,BAND160M,BAND80M,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BANDGEN"}},
[PARM_ANN] = {.min = {.i = 0}, .max = {.i = 2}, .step = {.i = 1}},
[PARM_KEYERTYPE] = {.step = {.s = "STRAIGHT, BUG, PADDLE"}},
[PARM_KEYERTYPE] = {.step = {.s = "STRAIGHT,BUG,PADDLE"}},
},
.ctcss_list = common_ctcss_list,
@ -241,8 +248,8 @@ struct rig_caps ic9100_caps =
.get_freq = icom_get_freq,
.set_freq = icom_set_freq,
.get_mode = icom_get_mode_with_data,
.set_mode = icom_set_mode_with_data,
.get_mode = icom_get_mode,
.set_mode = icom_set_mode,
.set_vfo = icom_set_vfo,
// .get_vfo = icom_get_vfo,

Plik diff jest za duży Load Diff

Wyświetl plik

@ -55,7 +55,7 @@
* parameters and levels.
*/
#define STR_CAL_LENGTH 16
#define STR_CAL_S0 -54
#define STR_CAL_S0 (-54)
#define MULTIB_SUBCMD
/*
@ -139,7 +139,7 @@ struct cmdparams
union
{
setting_t s; /*!< Level or parm */
token_t t; /*!< TOKEN_BACKEND */
hamlib_token_t t; /*!< TOKEN_BACKEND */
} id;
cmd_param_t cmdparamtype; /*!< CMD_PARAM_TYPE_LEVEL or CMD_PARAM_TYPE_PARM */
int command; /*!< CI-V command */
@ -244,7 +244,13 @@ struct icom_priv_caps
struct icom_spectrum_edge_frequency_range spectrum_edge_frequency_ranges[ICOM_MAX_SPECTRUM_FREQ_RANGES]; /*!< Icom spectrum scope edge frequencies, if supported by the rig. Last entry should have zeros in all fields. */
struct cmdparams *extcmds; /*!< Pointer to extended operations array */
int dualwatch_split; /*!< Rig supports dual watch for split ops -- e.g. ID-5100 */
int x25_always; /*!< Means the rig should use 0x25 and 0x26 commands always */
int x25x26_always; /*!< Rig should use 0x25 and 0x26 commands always */
int x25x26_possibly; /*!< Rig might support 0x25 and 0x26 commands if the firmware is upgraded */
int x1cx03_always; /*!< Rig should use 0x1C 0x03 command for getting TX frequency */
int x1cx03_possibly; /*!< Rig might support 0x1C 0x03 command if the firmware is upgraded TODO: is this added by FW upgrade ever? */
int x1ax03_supported; /*!< Rig supports setting/getting filter width */
int mode_with_filter; /*!< Rig mode commands include filter selection */
int data_mode_supported; /*!< Rig supports data mode flag */
};
struct icom_priv_data
@ -252,23 +258,29 @@ struct icom_priv_data
unsigned char re_civ_addr; /*!< The remote equipment's CI-V address */
int civ_731_mode; /*!< Off: freqs on 10 digits, On: freqs on 8 digits */
int no_xchg; /*!< Off: use VFO XCHG to set other VFO, On: use set VFO to set other VFO */
int no_1a_03_cmd; /*!< Rig doesn't tell IF widths */
int split_on; /*!< Record split state */
int no_1a_03_cmd; /*!< Rig does not support setting/getting filter width */
int split_on_deprecated; /*!< @deprecated Use rig_cache.split - Record split state */
pltstate_t *pltstate; /*!< Only on optoscan */
int serial_USB_echo_off; /*!< USB is not set to echo */
/* we track vfos internally for use with different functions like split */
/* this allows queries using CURR_VFO and Main/Sub to behave */
vfo_t rx_vfo;
vfo_t tx_vfo;
freq_t curr_freq; /*!< Our current freq depending on which vfo is selected */
freq_t main_freq; /*!< Track last setting of main -- not being used yet */
freq_t sub_freq; /*!< Track last setting of sub -- not being used yet */
freq_t maina_freq;
freq_t mainb_freq;
freq_t suba_freq;
freq_t subb_freq;
freq_t vfoa_freq; /*!< Track last setting of vfoa -- used to return last freq when ptt is asserted */
freq_t vfob_freq; /*!< Track last setting of vfob -- used to return last freq when ptt is asserted */
/**
* Icom backends track VFOs internally for use with different functions like split.
* This allows queries using CURR_VFO and Main/Sub to work correctly.
*
* The fields in this struct are no longer used, because rig_state and rig_cache structs provide
* the same functionality for all rigs globally.
*/
vfo_t rx_vfo_deprecated; /*!< @deprecated Use rig_state.rx_vfo */
vfo_t tx_vfo_deprecated; /*!< @deprecated Use rig_state.tx_vfo */
freq_t curr_freq_deprecated; /*!< @deprecated Use rig_cache.freqCurr - Our current freq depending on which vfo is selected */
freq_t main_freq_deprecated; /*!< @deprecated Use rig_cache.freqMainA - Track last setting of main -- not being used yet */
freq_t sub_freq_deprecated; /*!< @deprecated Use rig_cache.freqSubA - Track last setting of sub -- not being used yet */
freq_t maina_freq_deprecated; /*!< @deprecated Use rig_cache.freqMainA */
freq_t mainb_freq_deprecated; /*!< @deprecated Use rig_cache.freqMainB */
freq_t suba_freq_deprecated; /*!< @deprecated Use rig_cache.freqSubA */
freq_t subb_freq_deprecated; /*!< @deprecated Use rig_cache.freqSubB */
freq_t vfoa_freq_deprecated; /*!< @deprecated Use rig_cache.freqMainA - Track last setting of vfoa -- used to return last freq when ptt is asserted */
freq_t vfob_freq_deprecated; /*!< @deprecated Use rig_cache.freqMainB - Track last setting of vfob -- used to return last freq when ptt is asserted */
int x25cmdfails; /*!< This will get set if the 0x25 command fails so we try just once */
int x26cmdfails; /*!< This will get set if the 0x26 command fails so we try just once */
int x1cx03cmdfails; /*!< This will get set if the 0x1c 0x03 command fails so we try just once */
@ -277,7 +289,7 @@ struct icom_priv_data
unsigned char datamode; /*!< Current datamode */
int spectrum_scope_count; /*!< Number of spectrum scopes, calculated from caps */
struct icom_spectrum_scope_cache spectrum_scope_cache[HAMLIB_MAX_SPECTRUM_SCOPES]; /*!< Cached Icom spectrum scope data used during reception of the data. The array index must match the scope ID. */
freq_t other_freq; /*!< Our other freq depending on which vfo is selected */
freq_t other_freq_deprecated; /*!< @deprecated Use rig_cache.freqOther - Our other freq depending on which vfo is selected */
int vfo_flag; // used to skip vfo check when frequencies are equal
int dual_watch_main_sub; // 0=main, 1=sub
};
@ -316,16 +328,9 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
int icom_get_rit_new(RIG *rig, vfo_t vfo, shortfreq_t *ts);
int icom_set_rit_new(RIG *rig, vfo_t vfo, shortfreq_t ts);
int icom_set_xit_new(RIG *rig, vfo_t vfo, shortfreq_t ts);
int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
int icom_get_mode_with_data(RIG *rig, vfo_t vfo, rmode_t *mode,
pbwidth_t *width);
int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
#if 1 // see icom_get_vfo in icom.c
int icom_get_vfo(RIG *rig, vfo_t *vfo);
#else
#define icom_get_vfo NULL
#endif
int icom_set_vfo(RIG *rig, vfo_t vfo);
int icom_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift);
int icom_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift);
@ -341,8 +346,8 @@ int icom_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t tx_freq,
rmode_t tx_mode, pbwidth_t tx_width);
int icom_get_split_freq_mode(RIG *rig, vfo_t vfo, freq_t *tx_freq,
rmode_t *tx_mode, pbwidth_t *tx_width);
int icom_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
int icom_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
int icom_set_split_vfo(RIG *rig, vfo_t rx_vfo, split_t split, vfo_t tx_vfo);
int icom_get_split_vfo(RIG *rig, vfo_t rx_vfo, split_t *split, vfo_t *tx_vfo);
int icom_mem_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
int icom_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts);
int icom_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts);
@ -363,20 +368,20 @@ int icom_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
int icom_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch);
int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
int icom_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val);
int icom_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val);
int icom_set_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t val);
int icom_get_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t *val);
int icom_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
int icom_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
int icom_set_ext_func(RIG *rig, vfo_t vfo, token_t token, int status);
int icom_get_ext_func(RIG *rig, vfo_t vfo, token_t token, int *status);
int icom_set_ext_func(RIG *rig, vfo_t vfo, hamlib_token_t token, int status);
int icom_get_ext_func(RIG *rig, vfo_t vfo, hamlib_token_t token, int *status);
int icom_set_parm(RIG *rig, setting_t parm, value_t val);
int icom_get_parm(RIG *rig, setting_t parm, value_t *val);
int icom_set_ext_parm(RIG *rig, token_t token, value_t val);
int icom_get_ext_parm(RIG *rig, token_t token, value_t *val);
int icom_set_ext_cmd(RIG *rig, vfo_t vfo, token_t token, value_t val);
int icom_get_ext_cmd(RIG *rig, vfo_t vfo, token_t token, value_t *val);
int icom_set_conf(RIG *rig, token_t token, const char *val);
int icom_get_conf(RIG *rig, token_t token, char *val);
int icom_set_ext_parm(RIG *rig, hamlib_token_t token, value_t val);
int icom_get_ext_parm(RIG *rig, hamlib_token_t token, value_t *val);
int icom_set_ext_cmd(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t val);
int icom_get_ext_cmd(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t *val);
int icom_set_conf(RIG *rig, hamlib_token_t token, const char *val);
int icom_get_conf(RIG *rig, hamlib_token_t token, char *val);
int icom_set_powerstat(RIG *rig, powerstat_t status);
int icom_get_powerstat(RIG *rig, powerstat_t *status);
int icom_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option);
@ -594,5 +599,4 @@ extern struct rig_caps icr30_caps;
#define RIG_IS_X5105 (rig->state.rig_model == RIG_MODEL_X5105)
#define RIG_IS_X6100 (rig->state.rig_model == RIG_MODEL_X6100)
#endif /* _ICOM_H */

Wyświetl plik

@ -98,6 +98,7 @@
#define C_CTL_RIT 0x21 /* RIT/XIT control */
#define C_CTL_DSD 0x22 /* D-STAR Data */
#define C_SEND_SEL_FREQ 0x25 /* Send/Recv sel/unsel VFO frequency */
#define C_SEND_SEL_MODE 0x26 /* Send/Recv sel/unsel VFO mode & filter */
#define C_CTL_SCP 0x27 /* Scope control & data */
#define C_SND_VOICE 0x28 /* Transmit Voice Memory Contents */
#define C_CTL_MTEXT 0x70 /* Microtelecom Extension */
@ -160,7 +161,7 @@
#define S_DUAL 0xc2 /* Dual watch (0 = off, 1 = on) */
#define S_MAIN 0xd0 /* Select MAIN band */
#define S_SUB 0xd1 /* Select SUB band */
#define S_SUB_SEL 0xd2 /* Read/Set Main/Sub selection */
#define S_BAND_SEL 0xd2 /* Read/Set Main/Sub band selection */
#define S_FRONTWIN 0xe0 /* Select front window */
/*
@ -361,8 +362,9 @@
/*
* Transmit control (C_CTL_PTT) subcommands
*/
#define S_PTT 0x00
#define S_ANT_TUN 0x01 /* Auto tuner 0=OFF, 1 = ON, 2=Start Tuning */
#define S_PTT 0x00
#define S_ANT_TUN 0x01 /* Auto tuner 0=OFF, 1 = ON, 2=Start Tuning */
#define S_RD_TX_FREQ 0x03 /* Read transmit frequency */
/*
* Band Edge control (C_CTL_EDGE) subcommands

Wyświetl plik

@ -294,7 +294,7 @@ int optoscan_recv_dtmf(RIG *rig, vfo_t vfo, char *digits, int *length)
/*
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int optoscan_set_ext_parm(RIG *rig, token_t token, value_t val)
int optoscan_set_ext_parm(RIG *rig, hamlib_token_t token, value_t val)
{
unsigned char epbuf[MAXFRAMELEN], ackbuf[MAXFRAMELEN];
int ack_len;
@ -367,7 +367,7 @@ int optoscan_set_ext_parm(RIG *rig, token_t token, value_t val)
* Assumes rig!=NULL, rig->state.priv!=NULL
* and val points to a buffer big enough to hold the conf value.
*/
int optoscan_get_ext_parm(RIG *rig, token_t token, value_t *val)
int optoscan_get_ext_parm(RIG *rig, hamlib_token_t token, value_t *val)
{
struct optostat status_block;
int retval;

Wyświetl plik

@ -43,8 +43,8 @@ const char* optoscan_get_info(RIG *rig);
int optoscan_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone);
int optoscan_get_dcs_code(RIG * rig, vfo_t vfo, tone_t *code);
int optoscan_recv_dtmf(RIG *rig, vfo_t vfo, char *digits, int *length);
int optoscan_set_ext_parm(RIG *rig, token_t token, value_t val);
int optoscan_get_ext_parm(RIG *rig, token_t token, value_t *val);
int optoscan_set_ext_parm(RIG *rig, hamlib_token_t token, value_t val);
int optoscan_get_ext_parm(RIG *rig, hamlib_token_t token, value_t *val);
int optoscan_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int optoscan_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
int optoscan_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch);

Wyświetl plik

@ -141,7 +141,7 @@ static struct icom_priv_caps x108g_priv_caps =
0x70, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic7200_ts_sc_list
ic7200_ts_sc_list,
};
@ -321,6 +321,21 @@ struct rig_caps x108g_caps =
.hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS
};
static struct icom_priv_caps x6100_priv_caps =
{
0x70, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic7200_ts_sc_list,
.x25x26_always = 0,
.x25x26_possibly = 0,
.x1cx03_always = 0,
.x1cx03_possibly = 0,
.x1ax03_supported = 0,
.mode_with_filter = 1,
.data_mode_supported = 1
};
struct rig_caps x6100_caps =
{
RIG_MODEL(RIG_MODEL_X6100),
@ -445,7 +460,7 @@ struct rig_caps x6100_caps =
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& x108g_priv_caps,
.priv = (void *) &x6100_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = icom_rig_open,
@ -453,8 +468,8 @@ struct rig_caps x6100_caps =
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode_with_data,
.get_mode = icom_get_mode_with_data,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.set_ant = NULL, /*automatically set by rig depending band */
.get_ant = NULL,
@ -909,7 +924,6 @@ int x108g_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
*/
static int x108g_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
{
struct icom_priv_data *priv = (struct icom_priv_data *)rig->state.priv;
unsigned char ackbuf[MAXFRAMELEN];
int ack_len = sizeof(ackbuf), rc;
int split_sc;
@ -925,7 +939,7 @@ static int x108g_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
case RIG_SPLIT_ON:
split_sc = S_SPLT_ON;
if (!priv->split_on)
if (rig->state.cache.split == RIG_SPLIT_OFF)
{
/* ensure VFO A is Rx and VFO B is Tx as we assume that elsewhere */
if ((rig->state.vfo_list & (RIG_VFO_A | RIG_VFO_B)) == (RIG_VFO_A | RIG_VFO_B))
@ -952,7 +966,7 @@ static int x108g_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
return -RIG_ERJCTED;
}
priv->split_on = RIG_SPLIT_ON == split;
rig->state.cache.split = split;
return RIG_OK;
}
@ -991,13 +1005,17 @@ static int x108g_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
current VFO is VFO A and the split Tx VFO is always VFO B. These
assumptions allow us to deal with the lack of VFO and split
queries */
/* broken if user changes split on rig :( */
if ((rig->state.vfo_list & (RIG_VFO_A | RIG_VFO_B)) == (RIG_VFO_A | RIG_VFO_B)
&& priv->split_on) /* broken if user changes split on rig :( */
&& rig->state.cache.split != RIG_SPLIT_OFF)
{
/* VFO A/B style rigs swap VFO on split Tx so we need to disable
split for certainty */
if (RIG_OK != (rc = icom_transaction(rig, C_CTL_SPLT, S_SPLT_OFF, NULL, 0,
ackbuf, &ack_len))) { return rc; }
rc = icom_transaction(rig, C_CTL_SPLT, S_SPLT_OFF, NULL, 0, ackbuf, &ack_len);
if (rc != RIG_OK)
{
return rc;
}
if (ack_len != 2 || ackbuf[0] != 0x0f)
{
@ -1016,11 +1034,14 @@ static int x108g_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
if (RIG_OK != (rc = icom_set_vfo(rig, rx_vfo))) { return rc; }
if ((rig->state.vfo_list & (RIG_VFO_A | RIG_VFO_B)) == (RIG_VFO_A | RIG_VFO_B)
&& priv->split_on)
&& rig->state.cache.split != RIG_SPLIT_OFF)
{
/* Re-enable split */
if (RIG_OK != (rc = icom_transaction(rig, C_CTL_SPLT, S_SPLT_ON, NULL, 0,
ackbuf, &ack_len))) { return rc; }
rc = icom_transaction(rig, C_CTL_SPLT, S_SPLT_ON, NULL, 0, ackbuf, &ack_len);
if (rc != RIG_OK)
{
return rc;
}
}
return rc;
@ -1061,13 +1082,17 @@ static int x108g_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
current VFO is VFO A and the split Tx VFO is always VFO B. These
assumptions allow us to deal with the lack of VFO and split
queries */
/* broken if user changes split on rig :( */
if ((rig->state.vfo_list & (RIG_VFO_A | RIG_VFO_B)) == (RIG_VFO_A | RIG_VFO_B)
&& priv->split_on) /* broken if user changes split on rig :( */
&& rig->state.cache.split != RIG_SPLIT_OFF)
{
/* VFO A/B style rigs swap VFO on split Tx so we need to disable
split for certainty */
if (RIG_OK != (rc = icom_transaction(rig, C_CTL_SPLT, S_SPLT_OFF, NULL, 0,
ackbuf, &ack_len))) { return rc; }
rc = icom_transaction(rig, C_CTL_SPLT, S_SPLT_OFF, NULL, 0, ackbuf, &ack_len);
if (rc != RIG_OK)
{
return rc;
}
if (ack_len != 2 || ackbuf[0] != 0x0f)
{
@ -1087,13 +1112,15 @@ static int x108g_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
if (RIG_OK != (rc = icom_set_vfo(rig, rx_vfo))) { return rc; }
if ((rig->state.vfo_list & (RIG_VFO_A | RIG_VFO_B)) == (RIG_VFO_A | RIG_VFO_B)
&& priv->split_on)
&& rig->state.cache.split != RIG_SPLIT_OFF)
{
/* Re-enable split */
if (RIG_OK != (rc = icom_transaction(rig, C_CTL_SPLT, S_SPLT_ON, NULL, 0,
ackbuf, &ack_len))) { return rc; }
rc = icom_transaction(rig, C_CTL_SPLT, S_SPLT_ON, NULL, 0, ackbuf, &ack_len);
if (rc != RIG_OK)
{
return rc;
}
}
return rc;
}

Wyświetl plik

@ -98,7 +98,7 @@ struct k2_filt_lst_s k2_fwmd_rtty;
int k2_open(RIG *rig);
int k2_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
int k2_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
int k2_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val);
int k2_get_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t *val);
/* Private function declarations */
int k2_probe_mdfw(RIG *rig, struct kenwood_priv_data *priv);
@ -489,7 +489,7 @@ int k2_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
* STRING: val.cs for set, val.s for get
* CHECKBUTTON: val.i 0/1
*/
int k2_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val)
int k2_get_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t *val)
{
char buf[KENWOOD_MAX_BUF_LEN];
int err;

Wyświetl plik

@ -147,8 +147,8 @@ int k3_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
int k3_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
int k3_get_vfo(RIG *rig, vfo_t *vfo);
int k3_set_vfo(RIG *rig, vfo_t vfo);
int k3_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val);
int k3_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val);
int k3_set_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t val);
int k3_get_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t *val);
int k3_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit);
int k3_set_xit(RIG *rig, vfo_t vfo, shortfreq_t rit);
int k3_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode, pbwidth_t tx_width);
@ -1386,7 +1386,7 @@ int k3_get_vfo(RIG *rig, vfo_t *vfo)
* See Private Elecraft extra levels definitions in elecraft.c and
* private token #define in elecraft.h
*/
int k3_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val)
int k3_set_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t val)
{
char buf[10];
@ -1435,7 +1435,7 @@ int k3_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val)
* STRING: val.cs for set, val.s for get
* CHECKBUTTON: val.i 0/1
*/
int k3_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val)
int k3_get_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t *val)
{
char buf[KENWOOD_MAX_BUF_LEN];
int err;

Wyświetl plik

@ -181,6 +181,18 @@ tone_t kenwood42_ctcss_list[] =
0,
};
/*
* 51 CTCSS sub-audible tones
*/
tone_t kenwood51_ctcss_list[] =
{
670 , 693, 719, 744, 770, 797, 825, 854, 885, 915, /* 0- 9 */
948 , 974, 1000, 1035, 1072, 1109, 1148, 1188, 1230, 1273, /* 10-19 */
1318, 1365, 1413, 1462, 1514, 1567, 1598, 1622, 1655, 1679, /* 20-29 */
1713, 1738, 1773, 1799, 1835, 1862, 1899, 1928, 1966, 1995, /* 30-39 */
2035, 2065, 2107, 2181, 2257, 2291, 2336, 2418, 2503, 2541, /* 40-49 */
17500, 0 /* 50-99 */
};
/* Token definitions for .cfgparams in rig_caps
*
@ -4410,7 +4422,7 @@ int kenwood_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
}
/* TODO: replace menu no 57 by a define */
SNPRINTF(tonebuf, sizeof(tonebuf), "EX%03d%04d", 57, i + 1);
SNPRINTF(tonebuf, sizeof(tonebuf), "EX%03d%04d", 57, i + kenwood_caps(rig)->tone_table_base);
RETURNFUNC(kenwood_transaction(rig, tonebuf, NULL, 0));
}
@ -4461,11 +4473,11 @@ int kenwood_set_ctcss_tone_tn(RIG *rig, vfo_t vfo, tone_t tone)
RETURNFUNC(-RIG_EINVAL);
}
SNPRINTF(buf, sizeof(buf), "TN%c%02d", c, i + 1);
SNPRINTF(buf, sizeof(buf), "TN%c%02d", c, i + kenwood_caps(rig)->tone_table_base);
}
else
{
SNPRINTF(buf, sizeof(buf), "TN%02d", i + 1);
SNPRINTF(buf, sizeof(buf), "TN%02d", i + kenwood_caps(rig)->tone_table_base);
}
RETURNFUNC(kenwood_transaction(rig, buf, NULL, 0));
@ -4492,7 +4504,14 @@ int kenwood_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone)
caps = rig->caps;
if (RIG_IS_TS990S)
if (RIG_IS_TS890S)
{
char buf[5];
retval = kenwood_safe_transaction(rig, "TN", buf, sizeof(buf), 4);
memcpy(tonebuf, buf + 2, 2);
}
else if (RIG_IS_TS990S)
{
char cmd[4];
char buf[6];
@ -4535,7 +4554,7 @@ int kenwood_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone)
tonebuf[2] = '\0';
tone_idx = atoi(tonebuf);
if (tone_idx == 0)
if (tone_idx < kenwood_caps(rig)->tone_table_base)
{
rig_debug(RIG_DEBUG_ERR, "%s: CTCSS tone is zero (%s)\n",
__func__, tonebuf);
@ -4553,7 +4572,7 @@ int kenwood_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone)
}
}
*tone = caps->ctcss_list[tone_idx - 1];
*tone = caps->ctcss_list[tone_idx] - kenwood_caps(rig)->tone_table_base;
RETURNFUNC(RIG_OK);
}
@ -4604,11 +4623,11 @@ int kenwood_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone)
RETURNFUNC(-RIG_EINVAL);
}
SNPRINTF(buf, sizeof(buf), "CN%c%02d", c, i + 1);
SNPRINTF(buf, sizeof(buf), "CN%c%02d", c, i + kenwood_caps(rig)->tone_table_base);
}
else
{
SNPRINTF(buf, sizeof(buf), "CN%02d", i + 1);
SNPRINTF(buf, sizeof(buf), "CN%02d", i + kenwood_caps(rig)->tone_table_base);
}
RETURNFUNC(kenwood_transaction(rig, buf, NULL, 0));
@ -4673,7 +4692,7 @@ int kenwood_get_ctcss_sql(RIG *rig, vfo_t vfo, tone_t *tone)
tone_idx = atoi(tonebuf + offs);
if (tone_idx == 0)
if (tone_idx < kenwood_caps(rig)->tone_table_base)
{
rig_debug(RIG_DEBUG_ERR, "%s: CTCSS is zero (%s)\n",
__func__, tonebuf);
@ -4691,7 +4710,7 @@ int kenwood_get_ctcss_sql(RIG *rig, vfo_t vfo, tone_t *tone)
}
}
*tone = caps->ctcss_list[tone_idx - 1];
*tone = caps->ctcss_list[tone_idx] - kenwood_caps(rig)->tone_table_base;
RETURNFUNC(RIG_OK);
}
@ -5851,7 +5870,7 @@ int kenwood_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
RETURNFUNC(kenwood_transaction(rig, buf, NULL, 0));
}
int kenwood_set_ext_parm(RIG *rig, token_t token, value_t val)
int kenwood_set_ext_parm(RIG *rig, hamlib_token_t token, value_t val)
{
struct kenwood_priv_data *priv = rig->state.priv;
char buf[4];
@ -5883,7 +5902,7 @@ int kenwood_set_ext_parm(RIG *rig, token_t token, value_t val)
RETURNFUNC(-RIG_EINVAL);
}
int kenwood_get_ext_parm(RIG *rig, token_t token, value_t *val)
int kenwood_get_ext_parm(RIG *rig, hamlib_token_t token, value_t *val)
{
int err;
struct kenwood_priv_data *priv = rig->state.priv;

Wyświetl plik

@ -137,6 +137,7 @@ struct kenwood_priv_caps
struct kenwood_slope_filter *slope_filter_high; /* Last entry should have value == -1 and frequency_hz == -1 */
struct kenwood_slope_filter *slope_filter_low; /* Last entry should have value == -1 and frequency_hz == -1 */
double swr;
int tone_table_base; /* Offset of first value in rigs tone tables, default=0 */
};
struct kenwood_priv_data
@ -191,6 +192,7 @@ extern rmode_t kenwood_mode_table[KENWOOD_MODE_TABLE_MAX];
extern tone_t kenwood38_ctcss_list[];
extern tone_t kenwood42_ctcss_list[];
extern tone_t kenwood51_ctcss_list[];
int kenwood_transaction(RIG *rig, const char *cmdstr, char *data, size_t datasize);
int kenwood_safe_transaction(RIG *rig, const char *cmd, char *buf,
@ -227,8 +229,8 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
int kenwood_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
int kenwood_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
int kenwood_set_ext_parm(RIG *rig, token_t token, value_t val);
int kenwood_get_ext_parm(RIG *rig, token_t token, value_t *val);
int kenwood_set_ext_parm(RIG *rig, hamlib_token_t token, value_t val);
int kenwood_get_ext_parm(RIG *rig, hamlib_token_t token, value_t *val);
int kenwood_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone);
int kenwood_set_ctcss_tone_tn(RIG *rig, vfo_t vfo, tone_t tone);
int kenwood_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone);

Wyświetl plik

@ -68,6 +68,7 @@ static int pihspdr_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan);
static struct kenwood_priv_caps ts2000_priv_caps =
{
.cmdtrm = EOM_KEN,
.tone_table_base = 1,
};
/* memory capabilities */

Wyświetl plik

@ -46,6 +46,7 @@ static struct kenwood_priv_caps r5000_priv_caps =
{
.cmdtrm = EOM_KEN,
.if_len = 32,
.tone_table_base = 1,
};
/*

Wyświetl plik

@ -87,9 +87,9 @@ static int tmd710_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
static int tmd710_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
static int tmd710_get_parm(RIG *rig, setting_t parm, value_t *val);
static int tmd710_set_parm(RIG *rig, setting_t parm, value_t val);
static int tmd710_get_ext_level(RIG *rig, vfo_t vfo, token_t token,
static int tmd710_get_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token,
value_t *val);
static int tmd710_set_ext_level(RIG *rig, vfo_t vfo, token_t token,
static int tmd710_set_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token,
value_t val);
#define TMD710_MODES (RIG_MODE_FM|RIG_MODE_FMN|RIG_MODE_AM)
@ -2907,7 +2907,7 @@ int tmd710_set_parm(RIG *rig, setting_t parm, value_t val)
* Assumes rig!=NULL, rig->state.priv!=NULL, val!=NULL
*
*/
int tmd710_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val)
int tmd710_get_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t *val)
{
int retval;
tmd710_mu mu_struct;
@ -2941,7 +2941,7 @@ int tmd710_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val)
* Assumes rig!=NULL, rig->state.priv!=NULL
*
*/
int tmd710_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val)
int tmd710_set_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t val)
{
int retval;
tmd710_mu mu_struct;

Wyświetl plik

@ -18,6 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <stdio.h>
#include <stdlib.h>
@ -232,6 +233,7 @@ static struct kenwood_priv_caps ts2000_priv_caps =
.filter_width = ts2000_filter_width,
.slope_filter_high = ts2000_slope_filter_high,
.slope_filter_low = ts2000_slope_filter_low,
.tone_table_base = 1,
};
/* memory capabilities */
@ -1026,7 +1028,7 @@ static int ts2000_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
RETURNFUNC(RIG_OK);
}
static int ts2000_set_ext_func(RIG *rig, vfo_t vfo, token_t token, int status)
static int ts2000_set_ext_func(RIG *rig, vfo_t vfo, hamlib_token_t token, int status)
{
char cmdbuf[20];
int retval;
@ -1052,7 +1054,7 @@ static int ts2000_set_ext_func(RIG *rig, vfo_t vfo, token_t token, int status)
RETURNFUNC(retval);
}
static int ts2000_get_ext_func(RIG *rig, vfo_t vfo, token_t token, int *status)
static int ts2000_get_ext_func(RIG *rig, vfo_t vfo, hamlib_token_t token, int *status)
{
int retval;
@ -1085,7 +1087,7 @@ static int ts2000_get_ext_func(RIG *rig, vfo_t vfo, token_t token, int *status)
RETURNFUNC(retval);
}
static int ts2000_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val)
static int ts2000_set_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t val)
{
int retval;
@ -1145,7 +1147,7 @@ static int ts2000_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val)
RETURNFUNC(retval);
}
static int ts2000_get_ext_level(RIG *rig, vfo_t vfo, token_t token,
static int ts2000_get_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token,
value_t *val)
{
int retval;

Wyświetl plik

@ -43,6 +43,7 @@ static struct kenwood_priv_caps ts440_priv_caps =
{
.cmdtrm = EOM_KEN,
.if_len = 37,
.tone_table_base = 1,
};
/*

Wyświetl plik

@ -847,7 +847,7 @@ static int ts480_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
RETURNFUNC(RIG_OK);
}
static int ts480_set_ext_func(RIG *rig, vfo_t vfo, token_t token, int status)
static int ts480_set_ext_func(RIG *rig, vfo_t vfo, hamlib_token_t token, int status)
{
char cmdbuf[20];
int retval;
@ -900,7 +900,7 @@ static int ts480_set_ext_func(RIG *rig, vfo_t vfo, token_t token, int status)
RETURNFUNC(retval);
}
static int ts480_get_ext_func(RIG *rig, vfo_t vfo, token_t token, int *status)
static int ts480_get_ext_func(RIG *rig, vfo_t vfo, hamlib_token_t token, int *status)
{
int retval;
@ -945,7 +945,7 @@ static int ts480_get_ext_func(RIG *rig, vfo_t vfo, token_t token, int *status)
RETURNFUNC(retval);
}
static int ts480_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val)
static int ts480_set_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t val)
{
int retval;
char cmdbuf[20];
@ -1035,7 +1035,7 @@ static int ts480_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val)
RETURNFUNC(retval);
}
static int ts480_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val)
static int ts480_get_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t *val)
{
int retval;
int value;

Wyświetl plik

@ -39,6 +39,7 @@
static struct kenwood_priv_caps ts50_priv_caps =
{
.cmdtrm = EOM_KEN,
.tone_table_base = 1,
};
/*

Wyświetl plik

@ -18,6 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <stdio.h>
#include <stdlib.h>
@ -43,6 +44,7 @@
static struct kenwood_priv_caps ts570_priv_caps =
{
.cmdtrm = EOM_KEN,
.tone_table_base = 1,
};
static int ts570_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)

Wyświetl plik

@ -1157,7 +1157,7 @@ static int ts590_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
RETURNFUNC(RIG_OK);
}
static int ts590_set_ext_func(RIG *rig, vfo_t vfo, token_t token, int status)
static int ts590_set_ext_func(RIG *rig, vfo_t vfo, hamlib_token_t token, int status)
{
char cmdbuf[20];
int retval;
@ -1183,7 +1183,7 @@ static int ts590_set_ext_func(RIG *rig, vfo_t vfo, token_t token, int status)
RETURNFUNC(retval);
}
static int ts590_get_ext_func(RIG *rig, vfo_t vfo, token_t token, int *status)
static int ts590_get_ext_func(RIG *rig, vfo_t vfo, hamlib_token_t token, int *status)
{
int retval;
@ -1216,7 +1216,7 @@ static int ts590_get_ext_func(RIG *rig, vfo_t vfo, token_t token, int *status)
RETURNFUNC(retval);
}
static int ts590_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val)
static int ts590_set_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t val)
{
int retval;
@ -1435,7 +1435,7 @@ static int ts590_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val)
RETURNFUNC(retval);
}
static int ts590_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val)
static int ts590_get_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t *val)
{
int retval;
int value;
@ -1683,6 +1683,7 @@ static struct kenwood_priv_caps ts590_priv_caps =
.filter_width = ts590_filter_width,
.slope_filter_high = ts590_slope_filter_high,
.slope_filter_low = ts590_slope_filter_low,
.tone_table_base = 0,
};
/**

Wyświetl plik

@ -52,6 +52,7 @@
static struct kenwood_priv_caps ts711_priv_caps =
{
.cmdtrm = EOM_KEN,
.tone_table_base = 1,
};
/*

Wyświetl plik

@ -53,6 +53,7 @@
static struct kenwood_priv_caps ts790_priv_caps =
{
.cmdtrm = EOM_KEN,
.tone_table_base = 1,
};
/*

Wyświetl plik

@ -38,6 +38,7 @@
static struct kenwood_priv_caps ts811_priv_caps =
{
.cmdtrm = EOM_KEN,
.tone_table_base = 1,
};
/*

Wyświetl plik

@ -62,6 +62,7 @@
static struct kenwood_priv_caps ts850_priv_caps =
{
.cmdtrm = EOM_KEN,
.tone_table_base = 1,
};
/* forward definitions */

Wyświetl plik

@ -18,6 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <stdlib.h>
#include <stdio.h>
@ -53,6 +54,7 @@
static struct kenwood_priv_caps ts870s_priv_caps =
{
.cmdtrm = EOM_KEN,
.tone_table_base = 1,
};
/* only the ts870s and ts2000 support get_vfo with the 'FR;' command

Wyświetl plik

@ -37,7 +37,7 @@
#define TS890_LEVEL_SET (RIG_LEVEL_RFPOWER|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_AGC|RIG_LEVEL_KEYSPD|RIG_LEVEL_CWPITCH|RIG_LEVEL_ATT|RIG_LEVEL_USB_AF|RIG_LEVEL_USB_AF_INPUT)
#define TS890_LEVEL_GET (RIG_LEVEL_RFPOWER|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_AGC|RIG_LEVEL_KEYSPD|RIG_LEVEL_ALC|RIG_LEVEL_SWR|RIG_LEVEL_COMP_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_TEMP_METER|RIG_LEVEL_CWPITCH|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_ATT|RIG_LEVEL_USB_AF|RIG_LEVEL_USB_AF_INPUT)
#define TS890_FUNC_ALL (RIG_FUNC_NB|RIG_FUNC_NB2|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_NR|RIG_FUNC_BC|RIG_FUNC_BC2|RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_TUNER|RIG_FUNC_SEND_MORSE)
#define TS890_FUNC_ALL (RIG_FUNC_NB|RIG_FUNC_NB2|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_NR|RIG_FUNC_BC|RIG_FUNC_BC2|RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_TUNER|RIG_FUNC_SEND_MORSE|RIG_FUNC_TONE|RIG_FUNC_TSQL)
#define TS890_VFO_OPS (RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|RIG_OP_CPY|RIG_OP_TUNE)
@ -370,9 +370,64 @@ int kenwood_ts890_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
return -RIG_EINTERNAL;
}
int ts890_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
{
int mask, retval;
char current[4];
switch (func)
{
case RIG_FUNC_TONE:
mask = 1;
break;
case RIG_FUNC_TSQL:
mask = 2;
break;
default:
return (kenwood_set_func(rig, vfo, func, status));
}
retval = kenwood_safe_transaction(rig, "TO", current, sizeof(current), 3);
if (retval != RIG_OK)
{
return (retval);
}
current[2] &= ~mask;
current[2] |= status == 0 ? 0 : mask;
return kenwood_transaction(rig, current, NULL, 0);
}
int ts890_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
{
int mask, retval;
char current[4];
switch (func)
{
case RIG_FUNC_TONE:
mask = 1;
break;
case RIG_FUNC_TSQL:
mask = 2;
break;
default:
return (kenwood_get_func(rig, vfo, func, status));
}
retval = kenwood_safe_transaction(rig, "TO", current, sizeof(current), 3);
if (retval != RIG_OK)
{
return retval;
}
*status = current[2] & mask ? 1 : 0;
return RIG_OK;
}
static struct kenwood_priv_caps ts890s_priv_caps =
{
.cmdtrm = EOM_KEN,
.tone_table_base = 0,
};
/* SWR meter calibration table */
@ -510,6 +565,7 @@ struct rig_caps ts890s_caps =
RIG_FLT_END,
},
.vfo_ops = TS890_VFO_OPS,
.ctcss_list = kenwood51_ctcss_list,
.swr_cal = TS890_SWR_CAL,
@ -529,6 +585,10 @@ struct rig_caps ts890s_caps =
.get_vfo = kenwood_get_vfo_if,
.set_split_vfo = kenwood_set_split_vfo,
.get_split_vfo = kenwood_get_split_vfo_if,
.set_ctcss_tone = kenwood_set_ctcss_tone_tn,
.get_ctcss_tone = kenwood_get_ctcss_tone,
.set_ctcss_sql = kenwood_set_ctcss_sql,
.get_ctcss_sql = kenwood_get_ctcss_sql,
.get_ptt = kenwood_get_ptt,
.set_ptt = kenwood_set_ptt,
.get_dcd = kenwood_get_dcd,
@ -559,7 +619,7 @@ struct rig_caps ts890s_caps =
},
.has_get_func = TS890_FUNC_ALL,
.has_set_func = TS890_FUNC_ALL,
.set_func = kenwood_set_func,
.get_func = kenwood_get_func,
.set_func = ts890_set_func,
.get_func = ts890_get_func,
.hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS
};

Wyświetl plik

@ -63,7 +63,8 @@ static rmode_t ts940_mode_table[KENWOOD_MODE_TABLE_MAX] =
static struct kenwood_priv_caps ts940_priv_caps =
{
.cmdtrm = EOM_KEN,
.mode_table = ts940_mode_table
.mode_table = ts940_mode_table,
.tone_table_base = 1,
};
/*

Wyświetl plik

@ -18,6 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Edited by Martin Ewing AA6E, March, 2012
@ -52,6 +53,7 @@
static struct kenwood_priv_caps ts950_priv_caps =
{
.cmdtrm = EOM_KEN,
.tone_table_base = 1,
};
/*

Wyświetl plik

@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <stdlib.h>
#include <string.h>
@ -120,6 +121,7 @@ static struct kenwood_priv_caps ts990s_priv_caps =
{
.cmdtrm = EOM_KEN,
.mode_table = ts990s_mode_table,
.tone_table_base = 0,
};

Wyświetl plik

@ -94,6 +94,7 @@ tone_t tx500_dcs_list[] =
static struct kenwood_priv_caps tx500_priv_caps =
{
.cmdtrm = EOM_KEN,
.tone_table_base = 1, /* TS-2000 compatible ??? */
};
/* memory capabilities */

Wyświetl plik

@ -80,8 +80,8 @@ static int dds60_init(RIG *rig);
static int dds60_cleanup(RIG *rig);
static int dds60_open(RIG *rig);
static int dds60_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
static int dds60_set_conf(RIG *rig, token_t token, const char *val);
static int dds60_get_conf(RIG *rig, token_t token, char *val);
static int dds60_set_conf(RIG *rig, hamlib_token_t token, const char *val);
static int dds60_get_conf(RIG *rig, hamlib_token_t token, char *val);
/*
* The DDS-60 kit exists with a AD9851 chip (60 MHz),
@ -208,7 +208,7 @@ int dds60_cleanup(RIG *rig)
/*
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int dds60_set_conf(RIG *rig, token_t token, const char *val)
int dds60_set_conf(RIG *rig, hamlib_token_t token, const char *val)
{
struct dds60_priv_data *priv;
float phase;
@ -246,7 +246,7 @@ int dds60_set_conf(RIG *rig, token_t token, const char *val)
* Assumes rig!=NULL, rig->state.priv!=NULL
* and val points to a buffer big enough to hold the conf value.
*/
int dds60_get_conf2(RIG *rig, token_t token, char *val, int val_len)
int dds60_get_conf2(RIG *rig, hamlib_token_t token, char *val, int val_len)
{
struct dds60_priv_data *priv;
@ -277,7 +277,7 @@ int dds60_get_conf2(RIG *rig, token_t token, char *val, int val_len)
return RIG_OK;
}
int dds60_get_conf(RIG *rig, token_t token, char *val)
int dds60_get_conf(RIG *rig, hamlib_token_t token, char *val)
{
return dds60_get_conf2(rig, token, val, 128);
}

Wyświetl plik

@ -79,8 +79,8 @@ static const struct confparams drt1_cfg_params[] =
static int drt1_init(RIG *rig);
static int drt1_cleanup(RIG *rig);
static int drt1_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
static int drt1_set_conf(RIG *rig, token_t token, const char *val);
static int drt1_get_conf(RIG *rig, token_t token, char *val);
static int drt1_set_conf(RIG *rig, hamlib_token_t token, const char *val);
static int drt1_get_conf(RIG *rig, hamlib_token_t token, char *val);
/*
* SAT-Service Schneider DRM tuner.
@ -208,7 +208,7 @@ int drt1_cleanup(RIG *rig)
/*
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int drt1_set_conf(RIG *rig, token_t token, const char *val)
int drt1_set_conf(RIG *rig, hamlib_token_t token, const char *val)
{
struct drt1_priv_data *priv;
@ -244,7 +244,7 @@ int drt1_set_conf(RIG *rig, token_t token, const char *val)
* Assumes rig!=NULL, rig->state.priv!=NULL
* and val points to a buffer big enough to hold the conf value.
*/
int drt1_get_conf2(RIG *rig, token_t token, char *val, int val_len)
int drt1_get_conf2(RIG *rig, hamlib_token_t token, char *val, int val_len)
{
struct drt1_priv_data *priv;
@ -275,7 +275,7 @@ int drt1_get_conf2(RIG *rig, token_t token, char *val, int val_len)
return RIG_OK;
}
int drt1_get_conf(RIG *rig, token_t token, char *val)
int drt1_get_conf(RIG *rig, hamlib_token_t token, char *val)
{
return drt1_get_conf2(rig, token, val, 128);
}

Wyświetl plik

@ -65,8 +65,8 @@ static const struct confparams elektor304_cfg_params[] =
static int elektor304_init(RIG *rig);
static int elektor304_cleanup(RIG *rig);
static int elektor304_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
static int elektor304_set_conf(RIG *rig, token_t token, const char *val);
static int elektor304_get_conf(RIG *rig, token_t token, char *val);
static int elektor304_set_conf(RIG *rig, hamlib_token_t token, const char *val);
static int elektor304_get_conf(RIG *rig, hamlib_token_t token, char *val);
/*
* The Elektor DRM Receiver 3/04 COM interface is based on the Visual Basic
@ -198,7 +198,7 @@ int elektor304_cleanup(RIG *rig)
/*
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int elektor304_set_conf(RIG *rig, token_t token, const char *val)
int elektor304_set_conf(RIG *rig, hamlib_token_t token, const char *val)
{
struct elektor304_priv_data *priv;
@ -226,7 +226,7 @@ int elektor304_set_conf(RIG *rig, token_t token, const char *val)
* Assumes rig!=NULL, rig->state.priv!=NULL
* and val points to a buffer big enough to hold the conf value.
*/
int elektor304_get_conf2(RIG *rig, token_t token, char *val, int val_len)
int elektor304_get_conf2(RIG *rig, hamlib_token_t token, char *val, int val_len)
{
struct elektor304_priv_data *priv;
@ -249,7 +249,7 @@ int elektor304_get_conf2(RIG *rig, token_t token, char *val, int val_len)
return RIG_OK;
}
int elektor304_get_conf(RIG *rig, token_t token, char *val)
int elektor304_get_conf(RIG *rig, hamlib_token_t token, char *val)
{
return elektor304_get_conf2(rig, token, val, 128);
}

Wyświetl plik

@ -52,8 +52,8 @@ static int elektor507_get_level(RIG *rig, vfo_t vfo, setting_t level,
static int elektor507_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option);
static int elektor507_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option,
ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx);
static int elektor507_set_conf(RIG *rig, token_t token, const char *val);
static int elektor507_get_conf(RIG *rig, token_t token, char *val);
static int elektor507_set_conf(RIG *rig, hamlib_token_t token, const char *val);
static int elektor507_get_conf(RIG *rig, hamlib_token_t token, char *val);
static const char *elektor507_get_info(RIG *rig);
@ -641,7 +641,7 @@ struct rig_caps elektor507_caps =
};
int elektor507_set_conf(RIG *rig, token_t token, const char *val)
int elektor507_set_conf(RIG *rig, hamlib_token_t token, const char *val)
{
struct elektor507_priv_data *priv;
freq_t freq;
@ -666,7 +666,7 @@ int elektor507_set_conf(RIG *rig, token_t token, const char *val)
return RIG_OK;
}
int elektor507_get_conf2(RIG *rig, token_t token, char *val, int val_len)
int elektor507_get_conf2(RIG *rig, hamlib_token_t token, char *val, int val_len)
{
struct elektor507_priv_data *priv;
@ -689,7 +689,7 @@ int elektor507_get_conf2(RIG *rig, token_t token, char *val, int val_len)
return RIG_OK;
}
int elektor507_get_conf(RIG *rig, token_t token, char *val)
int elektor507_get_conf(RIG *rig, hamlib_token_t token, char *val)
{
return elektor507_get_conf2(rig, token, val, 128);
}

Wyświetl plik

@ -92,7 +92,7 @@ static int fifisdr_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode,
static int fifisdr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
static int fifisdr_get_level(RIG *rig, vfo_t vfo, setting_t level,
value_t *val);
static int fifisdr_get_ext_level(RIG *rig, vfo_t vfo, token_t token,
static int fifisdr_get_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token,
value_t *val);
@ -807,7 +807,7 @@ static int fifisdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
static int fifisdr_get_ext_level(RIG *rig, vfo_t vfo, token_t token,
static int fifisdr_get_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token,
value_t *val)
{
int ret = RIG_OK;

Wyświetl plik

@ -60,8 +60,8 @@ static int hiqsdr_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
static int hiqsdr_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
static int hiqsdr_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option);
static int hiqsdr_set_conf(RIG *rig, token_t token, const char *val);
static int hiqsdr_get_conf(RIG *rig, token_t token, char *val);
static int hiqsdr_set_conf(RIG *rig, hamlib_token_t token, const char *val);
static int hiqsdr_get_conf(RIG *rig, hamlib_token_t token, char *val);
static int hiqsdr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
static int hiqsdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
@ -225,7 +225,7 @@ static unsigned compute_sample_rate(const struct hiqsdr_priv_data *priv)
/*
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int hiqsdr_set_conf(RIG *rig, token_t token, const char *val)
int hiqsdr_set_conf(RIG *rig, hamlib_token_t token, const char *val)
{
struct hiqsdr_priv_data *priv;
struct rig_state *rs;
@ -257,7 +257,7 @@ int hiqsdr_set_conf(RIG *rig, token_t token, const char *val)
* Assumes rig!=NULL, rig->state.priv!=NULL
* and val points to a buffer big enough to hold the conf value.
*/
int hiqsdr_get_conf2(RIG *rig, token_t token, char *val, int val_len)
int hiqsdr_get_conf2(RIG *rig, hamlib_token_t token, char *val, int val_len)
{
struct hiqsdr_priv_data *priv;
struct rig_state *rs;
@ -282,7 +282,7 @@ int hiqsdr_get_conf2(RIG *rig, token_t token, char *val, int val_len)
return RIG_OK;
}
int hiqsdr_get_conf(RIG *rig, token_t token, char *val)
int hiqsdr_get_conf(RIG *rig, hamlib_token_t token, char *val)
{
return hiqsdr_get_conf2(rig, token, val, 128);
}

Wyświetl plik

@ -64,8 +64,8 @@ static int si570xxxusb_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
static int si570xxxusb_set_freq_by_value(RIG *rig, vfo_t vfo, freq_t freq);
static int si570xxxusb_get_freq_by_value(RIG *rig, vfo_t vfo, freq_t *freq);
static int si570xxxusb_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
static int si570xxxusb_set_conf(RIG *rig, token_t token, const char *val);
static int si570xxxusb_get_conf(RIG *rig, token_t token, char *val);
static int si570xxxusb_set_conf(RIG *rig, hamlib_token_t token, const char *val);
static int si570xxxusb_get_conf(RIG *rig, hamlib_token_t token, char *val);
static const char *si570xxxusb_get_info(RIG *rig);
@ -862,7 +862,7 @@ int si570xxxusb_cleanup(RIG *rig)
return RIG_OK;
}
int si570xxxusb_set_conf(RIG *rig, token_t token, const char *val)
int si570xxxusb_set_conf(RIG *rig, hamlib_token_t token, const char *val)
{
struct si570xxxusb_priv_data *priv;
freq_t freq;
@ -925,7 +925,7 @@ int si570xxxusb_set_conf(RIG *rig, token_t token, const char *val)
return RIG_OK;
}
int si570xxxusb_get_conf2(RIG *rig, token_t token, char *val, int val_len)
int si570xxxusb_get_conf2(RIG *rig, hamlib_token_t token, char *val, int val_len)
{
struct si570xxxusb_priv_data *priv;
priv = (struct si570xxxusb_priv_data *)rig->state.priv;
@ -955,7 +955,7 @@ int si570xxxusb_get_conf2(RIG *rig, token_t token, char *val, int val_len)
return RIG_OK;
}
int si570xxxusb_get_conf(RIG *rig, token_t token, char *val)
int si570xxxusb_get_conf(RIG *rig, hamlib_token_t token, char *val)
{
return si570xxxusb_get_conf2(rig, token, val, 128);
}

Wyświetl plik

@ -99,7 +99,7 @@ int usrp_close(RIG *rig)
/*
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int usrp_set_conf(RIG *rig, token_t token, const char *val)
int usrp_set_conf(RIG *rig, hamlib_token_t token, const char *val)
{
struct usrp_priv_data *priv = static_cast<struct usrp_priv_data*>rig->state.priv;
@ -124,7 +124,7 @@ int usrp_set_conf(RIG *rig, token_t token, const char *val)
* Assumes rig!=NULL, rig->state.priv!=NULL
* and val points to a buffer big enough to hold the conf value.
*/
int usrp_get_conf(RIG *rig, token_t token, char *val)
int usrp_get_conf(RIG *rig, hamlib_token_t token, char *val)
{
const struct usrp_priv_data *priv = static_cast<struct usrp_priv_data*>rig->state.priv;

Wyświetl plik

@ -36,8 +36,8 @@ int usrp_open(RIG *rig);
int usrp_close(RIG *rig);
int usrp_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
int usrp_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
int usrp_set_conf(RIG *rig, token_t token, const char *val);
int usrp_get_conf(RIG *rig, token_t token, char *val);
int usrp_set_conf(RIG *rig, hamlib_token_t token, const char *val);
int usrp_get_conf(RIG *rig, hamlib_token_t token, char *val);
const char * usrp_get_info(RIG *rig);

Wyświetl plik

@ -1354,7 +1354,7 @@ pcr_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
int
pcr_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val)
pcr_set_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t val)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: tok = %s\n", __func__, rig_strlevel(token));

Wyświetl plik

@ -104,7 +104,7 @@ int pcr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
int pcr_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
int pcr_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
int pcr_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val);
int pcr_set_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t val);
int pcr_get_ctcss_sql(RIG *rig, vfo_t vfo, tone_t *tone);
int pcr_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone);

Wyświetl plik

@ -253,7 +253,7 @@ int ra37xx_cleanup(RIG *rig)
/*
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int ra37xx_set_conf2(RIG *rig, token_t token, const char *val, int val_len)
int ra37xx_set_conf2(RIG *rig, hamlib_token_t token, const char *val, int val_len)
{
struct ra37xx_priv_data *priv = (struct ra37xx_priv_data *)rig->state.priv;
int receiver_id;
@ -278,7 +278,7 @@ int ra37xx_set_conf2(RIG *rig, token_t token, const char *val, int val_len)
return RIG_OK;
}
int ra37xx_set_conf(RIG *rig, token_t token, const char *val)
int ra37xx_set_conf(RIG *rig, hamlib_token_t token, const char *val)
{
return ra37xx_set_conf2(rig, token, val, 128);
}
@ -288,7 +288,7 @@ int ra37xx_set_conf(RIG *rig, token_t token, const char *val)
* Assumes rig!=NULL, rig->state.priv!=NULL
* and val points to a buffer big enough to hold the conf value.
*/
int ra37xx_get_conf2(RIG *rig, token_t token, char *val, int val_len)
int ra37xx_get_conf2(RIG *rig, hamlib_token_t token, char *val, int val_len)
{
const struct ra37xx_priv_data *priv = (struct ra37xx_priv_data *)
rig->state.priv;
@ -306,7 +306,7 @@ int ra37xx_get_conf2(RIG *rig, token_t token, char *val, int val_len)
return RIG_OK;
}
int ra37xx_get_conf(RIG *rig, token_t token, char *val)
int ra37xx_get_conf(RIG *rig, hamlib_token_t token, char *val)
{
return ra37xx_get_conf2(rig, token, val, 128);
}

Wyświetl plik

@ -64,8 +64,8 @@ struct ra37xx_priv_data {
int receiver_id;
};
int ra37xx_set_conf(RIG *rig, token_t token, const char *val);
int ra37xx_get_conf(RIG *rig, token_t token, char *val);
int ra37xx_set_conf(RIG *rig, hamlib_token_t token, const char *val);
int ra37xx_get_conf(RIG *rig, hamlib_token_t token, char *val);
int ra37xx_init(RIG *rig);
int ra37xx_cleanup(RIG *rig);
int ra37xx_open(RIG *rig);

Wyświetl plik

@ -162,7 +162,7 @@ int racal_cleanup(RIG *rig)
/*
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int racal_set_conf(RIG *rig, token_t token, const char *val)
int racal_set_conf(RIG *rig, hamlib_token_t token, const char *val)
{
struct racal_priv_data *priv = (struct racal_priv_data *)rig->state.priv;
@ -184,7 +184,7 @@ int racal_set_conf(RIG *rig, token_t token, const char *val)
* Assumes rig!=NULL, rig->state.priv!=NULL
* and val points to a buffer big enough to hold the conf value.
*/
int racal_get_conf2(RIG *rig, token_t token, char *val, int val_len)
int racal_get_conf2(RIG *rig, hamlib_token_t token, char *val, int val_len)
{
const struct racal_priv_data *priv = (struct racal_priv_data *)rig->state.priv;
@ -201,7 +201,7 @@ int racal_get_conf2(RIG *rig, token_t token, char *val, int val_len)
return RIG_OK;
}
int racal_get_conf(RIG *rig, token_t token, char *val)
int racal_get_conf(RIG *rig, hamlib_token_t token, char *val)
{
return racal_get_conf2(rig, token, val, 128);
}

Wyświetl plik

@ -37,8 +37,8 @@ struct racal_priv_data {
float threshold; /* attenuation */
};
int racal_set_conf(RIG *rig, token_t token, const char *val);
int racal_get_conf(RIG *rig, token_t token, char *val);
int racal_set_conf(RIG *rig, hamlib_token_t token, const char *val);
int racal_get_conf(RIG *rig, hamlib_token_t token, char *val);
int racal_init(RIG *rig);
int racal_cleanup(RIG *rig);
int racal_open(RIG *rig);

Wyświetl plik

@ -67,8 +67,8 @@ static const struct confparams rx331_cfg_params[] =
static int rx331_init(RIG *rig);
static int rx331_cleanup(RIG *rig);
static int rx331_set_conf(RIG *rig, token_t token, const char *val);
static int rx331_get_conf(RIG *rig, token_t token, char *val);
static int rx331_set_conf(RIG *rig, hamlib_token_t token, const char *val);
static int rx331_get_conf(RIG *rig, hamlib_token_t token, char *val);
static int rx331_open(RIG *rig);
static int rx331_close(RIG *rig);
static int rx331_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
@ -323,7 +323,7 @@ int rx331_cleanup(RIG *rig)
return RIG_OK;
}
int rx331_set_conf(RIG *rig, token_t token, const char *val)
int rx331_set_conf(RIG *rig, hamlib_token_t token, const char *val)
{
struct rx331_priv_data *priv = (struct rx331_priv_data *)rig->state.priv;
@ -340,7 +340,7 @@ int rx331_set_conf(RIG *rig, token_t token, const char *val)
return RIG_OK;
}
int rx331_get_conf2(RIG *rig, token_t token, char *val, int val_len)
int rx331_get_conf2(RIG *rig, hamlib_token_t token, char *val, int val_len)
{
const struct rx331_priv_data *priv = (struct rx331_priv_data *)rig->state.priv;
@ -357,7 +357,7 @@ int rx331_get_conf2(RIG *rig, token_t token, char *val, int val_len)
return RIG_OK;
}
int rx331_get_conf(RIG *rig, token_t token, char *val)
int rx331_get_conf(RIG *rig, hamlib_token_t token, char *val)
{
return rx331_get_conf2(rig, token, val, 128);
}

Wyświetl plik

@ -542,7 +542,7 @@ static const char *g313_get_info(RIG *rig)
return info.SerNum;
}
int g313_set_conf(RIG *rig, token_t token, const char *val)
int g313_set_conf(RIG *rig, hamlib_token_t token, const char *val)
{
struct g313_priv_data *priv = (struct g313_priv_data *)rig->state.priv;
@ -593,7 +593,7 @@ int g313_set_conf(RIG *rig, token_t token, const char *val)
return RIG_OK;
}
int g313_get_conf(RIG *rig, token_t token, char *val)
int g313_get_conf(RIG *rig, hamlib_token_t token, char *val)
{
struct g313_priv_data *priv = (struct g313_priv_data *)rig->state.priv;

Wyświetl plik

@ -70,8 +70,8 @@ static int g313_get_powerstat(RIG *rig, powerstat_t *status);
static int g313_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
static int g313_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
static const char *g313_get_info(RIG *rig);
int g313_set_conf(RIG *rig, token_t token, const char *val);
int g313_get_conf(RIG *rig, token_t token, char *val);
int g313_set_conf(RIG *rig, hamlib_token_t token, const char *val);
int g313_get_conf(RIG *rig, hamlib_token_t token, char *val);
/* #pragma pack(1) // set byte packing */
typedef struct
@ -640,7 +640,7 @@ static const char *g313_get_info(RIG *rig)
}
int g313_set_conf(RIG *rig, token_t token, const char *val)
int g313_set_conf(RIG *rig, hamlib_token_t token, const char *val)
{
struct g313_priv_data *priv = (struct g313_priv_data *)rig->state.priv;
int id;
@ -695,7 +695,7 @@ int g313_set_conf(RIG *rig, token_t token, const char *val)
return RIG_OK;
}
int g313_get_conf2(RIG *rig, token_t token, char *val, int val_len)
int g313_get_conf2(RIG *rig, hamlib_token_t token, char *val, int val_len)
{
const struct g313_priv_data *priv = (struct g313_priv_data *)rig->state.priv;
@ -712,7 +712,7 @@ int g313_get_conf2(RIG *rig, token_t token, char *val, int val_len)
return RIG_OK;
}
int g313_get_conf(RIG *rig, token_t token, char *val)
int g313_get_conf(RIG *rig, hamlib_token_t token, char *val)
{
return g313_get_conf2(rig, token, val, 128);
}

Wyświetl plik

@ -253,7 +253,7 @@ int wj_cleanup(RIG *rig)
/*
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int wj_set_conf(RIG *rig, token_t token, const char *val)
int wj_set_conf(RIG *rig, hamlib_token_t token, const char *val)
{
struct wj_priv_data *priv = (struct wj_priv_data *)rig->state.priv;
@ -275,7 +275,7 @@ int wj_set_conf(RIG *rig, token_t token, const char *val)
* Assumes rig!=NULL, rig->state.priv!=NULL
* and val points to a buffer big enough to hold the conf value.
*/
int wj_get_conf2(RIG *rig, token_t token, char *val, int val_len)
int wj_get_conf2(RIG *rig, hamlib_token_t token, char *val, int val_len)
{
const struct wj_priv_data *priv = (struct wj_priv_data *)rig->state.priv;
@ -292,7 +292,7 @@ int wj_get_conf2(RIG *rig, token_t token, char *val, int val_len)
return RIG_OK;
}
int wj_get_conf(RIG *rig, token_t token, char *val)
int wj_get_conf(RIG *rig, hamlib_token_t token, char *val)
{
return wj_get_conf2(rig, token, val, 128);
}

Wyświetl plik

@ -42,8 +42,8 @@ struct wj_priv_data {
value_t rawstr;
};
int wj_set_conf(RIG *rig, token_t token, const char *val);
int wj_get_conf(RIG *rig, token_t token, char *val);
int wj_set_conf(RIG *rig, hamlib_token_t token, const char *val);
int wj_get_conf(RIG *rig, hamlib_token_t token, char *val);
int wj_init(RIG *rig);
int wj_cleanup(RIG *rig);
int wj_set_freq(RIG *rig, vfo_t vfo, freq_t freq);

Wyświetl plik

@ -51,8 +51,8 @@ static int ft757_init(RIG *rig);
static int ft757_cleanup(RIG *rig);
static int ft757_open(RIG *rig);
static int ft757gx_get_conf(RIG *rig, token_t token, char *val);
static int ft757gx_set_conf(RIG *rig, token_t token, const char *val);
static int ft757gx_get_conf(RIG *rig, hamlib_token_t token, char *val);
static int ft757gx_set_conf(RIG *rig, hamlib_token_t token, const char *val);
static int ft757_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
static int ft757_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
@ -898,7 +898,7 @@ static int rig2mode(RIG *rig, int md, rmode_t *mode, pbwidth_t *width)
/*
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
static int ft757gx_get_conf2(RIG *rig, token_t token, char *val, int val_len)
static int ft757gx_get_conf2(RIG *rig, hamlib_token_t token, char *val, int val_len)
{
struct ft757_priv_data *priv;
struct rig_state *rs;
@ -924,7 +924,7 @@ static int ft757gx_get_conf2(RIG *rig, token_t token, char *val, int val_len)
return RIG_OK;
}
static int ft757gx_get_conf(RIG *rig, token_t token, char *val)
static int ft757gx_get_conf(RIG *rig, hamlib_token_t token, char *val)
{
return ft757gx_get_conf2(rig, token, val, 128);
}
@ -932,7 +932,7 @@ static int ft757gx_get_conf(RIG *rig, token_t token, char *val)
/*
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
static int ft757gx_set_conf(RIG *rig, token_t token, const char *val)
static int ft757gx_set_conf(RIG *rig, hamlib_token_t token, const char *val)
{
struct ft757_priv_data *priv;
struct rig_state *rs;

Wyświetl plik

@ -439,6 +439,156 @@ struct rig_caps ft817_caps =
.hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS
};
struct rig_caps q900_caps =
{
RIG_MODEL(RIG_MODEL_Q900),
.model_name = "Q900",
.mfg_name = "Guohe",
.version = "20240122.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_RIG,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 4800,
.serial_rate_max = 38400,
.serial_data_bits = 8,
.serial_stop_bits = 2,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = FT817_WRITE_DELAY,
.post_write_delay = FT817_POST_WRITE_DELAY,
.timeout = FT817_TIMEOUT,
.retry = 5,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = RIG_FUNC_LOCK | RIG_FUNC_TONE | RIG_FUNC_TSQL | RIG_FUNC_CSQL | RIG_FUNC_RIT,
.has_get_level =
RIG_LEVEL_STRENGTH | RIG_LEVEL_RAWSTR | RIG_LEVEL_RFPOWER |
RIG_LEVEL_ALC | RIG_LEVEL_SWR,
.has_set_level = RIG_LEVEL_BAND_SELECT,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran =
{
#include "level_gran_yaesu.h"
},
.parm_gran = {},
.ctcss_list = common_ctcss_list,
.dcs_list = common_dcs_list, /* only 104 out of 106 supported */
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(9990),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.vfo_ops = RIG_OP_TOGGLE,
.targetable_vfo = 0,
.transceive = RIG_TRN_OFF,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = { RIG_CHAN_END, },
.rx_range_list1 = {
{kHz(100), MHz(56), FT817_ALL_RX_MODES, -1, -1, FT817_VFO_ALL, FT817_ANTS},
{MHz(76), MHz(108), RIG_MODE_WFM, -1, -1, FT817_VFO_ALL, FT817_ANTS},
{MHz(118), MHz(164), FT817_ALL_RX_MODES, -1, -1, FT817_VFO_ALL, FT817_ANTS},
{MHz(420), MHz(470), FT817_ALL_RX_MODES, -1, -1, FT817_VFO_ALL, FT817_ANTS},
RIG_FRNG_END,
},
.tx_range_list1 = {
FRQ_RNG_HF(1, FT817_OTHER_TX_MODES, W(0.5), W(5), FT817_VFO_ALL, FT817_ANTS),
FRQ_RNG_HF(1, FT817_AM_TX_MODES, W(0.5), W(1.5), FT817_VFO_ALL, FT817_ANTS),
FRQ_RNG_6m(1, FT817_OTHER_TX_MODES, W(0.5), W(5), FT817_VFO_ALL, FT817_ANTS),
FRQ_RNG_6m(1, FT817_AM_TX_MODES, W(0.5), W(1.5), FT817_VFO_ALL, FT817_ANTS),
FRQ_RNG_2m(1, FT817_OTHER_TX_MODES, W(0.5), W(5), FT817_VFO_ALL, FT817_ANTS),
FRQ_RNG_2m(1, FT817_AM_TX_MODES, W(0.5), W(1.5), FT817_VFO_ALL, FT817_ANTS),
FRQ_RNG_70cm(1, FT817_OTHER_TX_MODES, W(0.5), W(5), FT817_VFO_ALL, FT817_ANTS),
FRQ_RNG_70cm(1, FT817_AM_TX_MODES, W(0.5), W(1.5), FT817_VFO_ALL, FT817_ANTS),
RIG_FRNG_END,
},
.rx_range_list2 = {
{kHz(100), MHz(56), FT817_ALL_RX_MODES, -1, -1, FT817_VFO_ALL, FT817_ANTS},
{MHz(76), MHz(108), RIG_MODE_WFM, -1, -1, FT817_VFO_ALL, FT817_ANTS},
{MHz(118), MHz(164), FT817_ALL_RX_MODES, -1, -1, FT817_VFO_ALL, FT817_ANTS},
{MHz(420), MHz(470), FT817_ALL_RX_MODES, -1, -1, FT817_VFO_ALL, FT817_ANTS},
RIG_FRNG_END,
},
.tx_range_list2 = {
FRQ_RNG_HF(2, FT817_OTHER_TX_MODES, W(0.5), W(5), FT817_VFO_ALL, FT817_ANTS),
FRQ_RNG_HF(2, FT817_AM_TX_MODES, W(0.5), W(1.5), FT817_VFO_ALL, FT817_ANTS),
/* FIXME: 60 meters in US version */
FRQ_RNG_6m(2, FT817_OTHER_TX_MODES, W(0.5), W(5), FT817_VFO_ALL, FT817_ANTS),
FRQ_RNG_6m(2, FT817_AM_TX_MODES, W(0.5), W(1.5), FT817_VFO_ALL, FT817_ANTS),
FRQ_RNG_2m(2, FT817_OTHER_TX_MODES, W(0.5), W(5), FT817_VFO_ALL, FT817_ANTS),
FRQ_RNG_2m(2, FT817_AM_TX_MODES, W(0.5), W(1.5), FT817_VFO_ALL, FT817_ANTS),
FRQ_RNG_70cm(2, FT817_OTHER_TX_MODES, W(0.5), W(5), FT817_VFO_ALL, FT817_ANTS),
FRQ_RNG_70cm(2, FT817_AM_TX_MODES, W(0.5), W(1.5), FT817_VFO_ALL, FT817_ANTS),
RIG_FRNG_END,
},
.tuning_steps = {
{FT817_SSB_CW_RX_MODES, Hz(10)},
{FT817_AM_FM_RX_MODES | RIG_MODE_WFM, Hz(100)},
RIG_TS_END,
},
.filters = {
{FT817_SSB_CW_RX_MODES, kHz(2.2)}, /* normal passband */
{FT817_CWN_RX_MODES, 500}, /* CW and RTTY narrow */
{RIG_MODE_AM, kHz(6)}, /* AM normal */
{RIG_MODE_FM | RIG_MODE_PKTFM, kHz(9)},
{RIG_MODE_WFM, kHz(15)},
RIG_FLT_END,
},
.str_cal = FT817_STR_CAL,
.swr_cal = FT817_SWR_CAL,
.alc_cal = FT817_ALC_CAL,
.rfpower_meter_cal = FT817_PWR_CAL,
.rig_init = ft817_init,
.rig_cleanup = ft817_cleanup,
.rig_open = ft817_open,
.rig_close = ft817_close,
.get_vfo = ft817_get_vfo,
.set_vfo = ft817_set_vfo,
.set_freq = ft817_set_freq,
.get_freq = ft817_get_freq,
.set_mode = ft817_set_mode,
.get_mode = ft817_get_mode,
.set_ptt = ft817_set_ptt,
.get_ptt = ft817_get_ptt,
.get_dcd = ft817_get_dcd,
.set_rptr_shift = ft817_set_rptr_shift,
.set_rptr_offs = ft817_set_rptr_offs,
.set_split_vfo = ft817_set_split_vfo,
.get_split_vfo = ft817_get_split_vfo,
.set_rit = ft817_set_rit,
.set_dcs_code = ft817_set_dcs_code,
.set_ctcss_tone = ft817_set_ctcss_tone,
.set_dcs_sql = ft817_set_dcs_sql,
.set_ctcss_sql = ft817_set_ctcss_sql,
.power2mW = ft817_power2mW,
.mW2power = ft817_mW2power,
.set_powerstat = ft817_set_powerstat,
.get_ant = ft817_get_ant,
.get_level = ft817_get_level,
.set_func = ft817_set_func,
.vfo_op = ft817_vfo_op,
.hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS
};
struct rig_caps ft818_caps =
{
RIG_MODEL(RIG_MODEL_FT818),

Wyświetl plik

@ -345,7 +345,7 @@ static const yaesu_newcat_commands_t valid_commands[] =
{"SS", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE },
// ST command has two meanings Step or Split Status
// If new rig is added that has ST ensure it means Split
// Otherwise modify newcat_get_tx_vfo
// Otherwise modify newcat_(set|get)_split
{"ST", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE },
{"SV", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
{"SY", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE},
@ -387,6 +387,8 @@ const struct confparams newcat_cfg_params[] =
/* NewCAT Internal Functions */
static ncboolean newcat_is_rig(RIG *rig, rig_model_t model);
static int newcat_set_split(RIG *rig, split_t split, vfo_t *rx_vfo, vfo_t *tx_vfo);
static int newcat_get_split(RIG *rig, split_t *split, vfo_t *tx_vfo);
static int newcat_set_vfo_from_alias(RIG *rig, vfo_t *vfo);
static int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode,
pbwidth_t *width);
@ -397,7 +399,7 @@ static int newcat_get_narrow(RIG *rig, vfo_t vfo, ncboolean *narrow);
static int newcat_set_faststep(RIG *rig, ncboolean fast_step);
static int newcat_get_faststep(RIG *rig, ncboolean *fast_step);
static int newcat_get_rigid(RIG *rig);
static int newcat_get_vfo_mode(RIG *rig, vfo_t vfo, rmode_t *vfo_mode);
static int newcat_get_vfo_mode(RIG *rig, vfo_t vfo, vfo_t *vfo_mode);
static int newcat_vfomem_toggle(RIG *rig);
static int set_roofing_filter(RIG *rig, vfo_t vfo, int index);
static int set_roofing_filter_for_width(RIG *rig, vfo_t vfo, int width);
@ -741,7 +743,7 @@ int newcat_close(RIG *rig)
* Set Configuration Token for Yaesu Radios
*/
int newcat_set_conf(RIG *rig, token_t token, const char *val)
int newcat_set_conf(RIG *rig, hamlib_token_t token, const char *val)
{
int ret = RIG_OK;
struct newcat_priv_data *priv;
@ -794,7 +796,7 @@ int newcat_set_conf(RIG *rig, token_t token, const char *val)
* Get Configuration Token for Yaesu Radios
*/
int newcat_get_conf2(RIG *rig, token_t token, char *val, int val_len)
int newcat_get_conf2(RIG *rig, hamlib_token_t token, char *val, int val_len)
{
int ret = RIG_OK;
struct newcat_priv_data *priv;
@ -835,8 +837,7 @@ int newcat_60m_exception(RIG *rig, freq_t freq, mode_t mode)
int err;
int channel = -1;
int i;
rmode_t tmode;
pbwidth_t twidth;
vfo_t vfo_mode;
if (!(freq > 5.2 && freq < 5.5)) // we're not on 60M
{
@ -876,9 +877,9 @@ int newcat_60m_exception(RIG *rig, freq_t freq, mode_t mode)
rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n",
__func__);
rig_get_mode(rig, RIG_VFO_A, &tmode, &twidth);
newcat_get_vfo_mode(rig, RIG_VFO_A, &vfo_mode);
if (tmode != RIG_VFO_MEM)
if (vfo_mode != RIG_VFO_MEM)
{
err = newcat_vfomem_toggle(rig);
@ -934,8 +935,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
struct rig_caps *caps;
struct newcat_priv_data *priv;
int special_60m = 0;
rmode_t tmode;
pbwidth_t twidth;
vfo_t vfo_mode;
ENTERFUNC;
@ -964,9 +964,9 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
priv = (struct newcat_priv_data *)rig->state.priv;
caps = rig->caps;
rig_get_mode(rig, RIG_VFO_A, &tmode, &twidth);
newcat_get_vfo_mode(rig, RIG_VFO_A, &vfo_mode);
if (tmode == RIG_VFO_MEM)
if (vfo_mode == RIG_VFO_MEM)
{
// then we need to toggle back to VFO mode
newcat_vfomem_toggle(rig);
@ -1106,7 +1106,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
// Call this after open to set width_frequency for later use
if (priv->width_frequency == 0)
{
rmode_t vfo_mode;
vfo_t vfo_mode;
newcat_get_vfo_mode(rig, vfo, &vfo_mode);
}
@ -1664,7 +1664,7 @@ int newcat_set_vfo(RIG *rig, vfo_t vfo)
struct rig_state *state;
char c;
int err, mem;
rmode_t vfo_mode;
vfo_t vfo_mode;
char command[] = "VS";
priv = (struct newcat_priv_data *)rig->state.priv;
@ -1820,7 +1820,7 @@ int newcat_get_vfo(RIG *rig, vfo_t *vfo)
struct rig_state *state = &rig->state;
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
int err;
rmode_t vfo_mode;
vfo_t vfo_mode;
char const *command = "VS";
ENTERFUNC;
@ -2720,7 +2720,6 @@ int newcat_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
int err;
vfo_t rx_vfo = RIG_VFO_NONE;
//ENTERFUNC;
rig_debug(RIG_DEBUG_TRACE, "%s: entered, rxvfo=%s, txvfo=%s, split=%d\n",
__func__, rig_strvfo(vfo), rig_strvfo(tx_vfo), split);
@ -2739,14 +2738,22 @@ int newcat_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
if (is_ft991)
{
// FT-991(A) doesn't have a concept of an active VFO, so VFO B needs to be the split VFO
vfo = RIG_VFO_A;
tx_vfo = RIG_SPLIT_ON == split ? RIG_VFO_B : RIG_VFO_A;
}
else if (is_ftdx101d || is_ftdx101mp)
{
// FTDX101(D/MP) always use Sub VFO for transmit when in split mode
vfo = RIG_VFO_MAIN;
tx_vfo = RIG_SPLIT_ON == split ? RIG_VFO_SUB : RIG_VFO_MAIN;
}
else if (is_ftdx10)
{
// FTDX10 always uses VFO B for transmit when in split mode
vfo = RIG_VFO_A;
tx_vfo = RIG_SPLIT_ON == split ? RIG_VFO_B : RIG_VFO_A;
}
else
{
err = newcat_get_vfo(rig, &rx_vfo); /* sync to rig current vfo */
@ -2760,11 +2767,21 @@ int newcat_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
switch (split)
{
case RIG_SPLIT_OFF:
err = newcat_set_tx_vfo(rig, vfo);
err = -RIG_ENAVAIL;
if (err != RIG_OK)
if (newcat_valid_command(rig, "ST"))
{
RETURNFUNC(err);
err = newcat_set_split(rig, split, &rx_vfo, &tx_vfo);
}
if (err == -RIG_ENAVAIL)
{
err = newcat_set_tx_vfo(rig, vfo);
if (err != RIG_OK)
{
RETURNFUNC(err);
}
}
if (rx_vfo != vfo && newcat_valid_command(rig, "VS"))
@ -2780,11 +2797,21 @@ int newcat_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
break;
case RIG_SPLIT_ON:
err = newcat_set_tx_vfo(rig, tx_vfo);
err = -RIG_ENAVAIL;
if (err != RIG_OK)
if (newcat_valid_command(rig, "ST"))
{
RETURNFUNC(err);
err = newcat_set_split(rig, split, &rx_vfo, &tx_vfo);
}
if (err == -RIG_ENAVAIL)
{
err = newcat_set_tx_vfo(rig, tx_vfo);
if (err != RIG_OK)
{
RETURNFUNC(err);
}
}
if (rx_vfo != vfo)
@ -2820,25 +2847,32 @@ int newcat_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
RETURNFUNC(err);
}
err = newcat_get_tx_vfo(rig, tx_vfo);
if (err != RIG_OK)
err = -RIG_ENAVAIL;
if (newcat_valid_command(rig, "ST"))
{
RETURNFUNC(err);
err = newcat_get_split(rig, split, tx_vfo);
}
// we assume split is always on VFO_B
//if (*tx_vfo == RIG_VFO_B || *tx_vfo == RIG_VFO_SUB)
rig_debug(RIG_DEBUG_TRACE, "%s: tx_vfo=%s, curr_vfo=%s\n", __func__,
rig_strvfo(*tx_vfo), rig_strvfo(rig->state.current_vfo));
if (err == -RIG_ENAVAIL)
{
err = newcat_get_tx_vfo(rig, tx_vfo);
if (*tx_vfo != rig->state.current_vfo)
{
*split = RIG_SPLIT_ON;
}
else
{
*split = RIG_SPLIT_OFF;
if (err != RIG_OK)
{
RETURNFUNC(err);
}
rig_debug(RIG_DEBUG_TRACE, "%s: tx_vfo=%s, curr_vfo=%s\n", __func__,
rig_strvfo(*tx_vfo), rig_strvfo(rig->state.current_vfo));
if (*tx_vfo != rig->state.current_vfo)
{
*split = RIG_SPLIT_ON;
}
else
{
*split = RIG_SPLIT_OFF;
}
}
rig_debug(RIG_DEBUG_TRACE, "SPLIT = %d, vfo = %s, TX_vfo = %s\n", *split,
@ -6906,12 +6940,12 @@ int newcat_get_parm(RIG *rig, setting_t parm, value_t *val)
RETURNFUNC(-RIG_ENAVAIL);
}
static int newcat_set_maxpower(RIG *rig, vfo_t vfo, token_t token, float val)
static int newcat_set_maxpower(RIG *rig, vfo_t vfo, hamlib_token_t token, float val)
{
return -RIG_ENIMPL;
}
static int newcat_get_maxpower(RIG *rig, vfo_t vfo, token_t token, value_t *val)
static int newcat_get_maxpower(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t *val)
{
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
int retval;
@ -6973,7 +7007,7 @@ static int newcat_get_maxpower(RIG *rig, vfo_t vfo, token_t token, value_t *val)
}
int newcat_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val)
int newcat_set_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t val)
{
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
@ -7026,7 +7060,7 @@ int newcat_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val)
}
}
int newcat_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val)
int newcat_get_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t *val)
{
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
char *result;
@ -7155,7 +7189,7 @@ int newcat_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val)
RETURNFUNC(RIG_OK);
}
int newcat_set_ext_parm(RIG *rig, token_t token, value_t val)
int newcat_set_ext_parm(RIG *rig, hamlib_token_t token, value_t val)
{
ENTERFUNC;
@ -7163,7 +7197,7 @@ int newcat_set_ext_parm(RIG *rig, token_t token, value_t val)
}
int newcat_get_ext_parm(RIG *rig, token_t token, value_t *val)
int newcat_get_ext_parm(RIG *rig, hamlib_token_t token, value_t *val)
{
ENTERFUNC;
@ -8156,16 +8190,12 @@ ncboolean newcat_is_rig(RIG *rig, rig_model_t model)
}
/*
* newcat_set_tx_vfo does not set priv->curr_vfo
* does set rig->state.tx_vfo
*/
int newcat_set_tx_vfo(RIG *rig, vfo_t tx_vfo)
{
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
int err;
char p1;
struct newcat_priv_data *priv = (struct newcat_priv_data *) rig->state.priv;
char *command = "FT";
int result;
char p1;
ENTERFUNC;
@ -8174,11 +8204,11 @@ int newcat_set_tx_vfo(RIG *rig, vfo_t tx_vfo)
RETURNFUNC(-RIG_ENAVAIL);
}
err = newcat_set_vfo_from_alias(rig, &tx_vfo);
result = newcat_set_vfo_from_alias(rig, &tx_vfo);
if (err < 0)
if (result < 0)
{
RETURNFUNC(err);
RETURNFUNC(result);
}
switch (tx_vfo)
@ -8211,36 +8241,12 @@ int newcat_set_tx_vfo(RIG *rig, vfo_t tx_vfo)
RETURNFUNC(-RIG_EINVAL);
}
/* TODO: G4WJS - FT-450 only has toggle command so not sure how to
definitively set the TX VFO (VS; doesn't seem to help
either) */
if (newcat_is_rig(rig, RIG_MODEL_FT950) ||
newcat_is_rig(rig, RIG_MODEL_FT2000) ||
newcat_is_rig(rig, RIG_MODEL_FTDX5000) ||
newcat_is_rig(rig, RIG_MODEL_FTDX1200) ||
newcat_is_rig(rig, RIG_MODEL_FT991) ||
newcat_is_rig(rig, RIG_MODEL_FTDX10) ||
newcat_is_rig(rig, RIG_MODEL_FTDX3000))
// NOTE: FT-450 only has toggle command so not sure how to definitively set the TX VFO (VS; doesn't seem to help either)
if (is_ft950 || is_ft2000 || is_ftdx3000 || is_ftdx3000dm || is_ftdx5000 || is_ftdx1200 || is_ft991 ||
is_ftdx10 || is_ftdx101d || is_ftdx101mp)
{
p1 = p1 + 2; /* use non-Toggle commands */
// If VFOB is active then we change VFOB with FT3 instead of VFOA
if (rig->state.current_vfo == RIG_VFO_B
|| rig->state.current_vfo == RIG_VFO_SUB) { p1++; }
}
// this doesn't seem to work on FTDX101MP latest firmware as of 20230911 so we test once and disable if needed
if ((is_ftdx101d || is_ftdx101mp) && p1 == '1' && !priv->ftdx101_st_missing)
{
// what other Yaesu rigs should be using this?
// The DX101D returns FT0 when in split and not transmitting
command = "ST";
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s%c%c", command, p1, cat_term);
int retval = newcat_set_cmd(rig);
if (retval != RIG_OK) {priv->ftdx101_st_missing = 1; retval = RIG_OK;}
RETURNFUNC(retval);
// These rigs use numbers 2 and 3 to denote A/B or Main/Sub VFOs - 0 and 1 are for toggling TX function
p1 = p1 + 2;
}
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s%c%c", command, p1, cat_term);
@ -8248,32 +8254,29 @@ int newcat_set_tx_vfo(RIG *rig, vfo_t tx_vfo)
rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s, vfo=%s\n", priv->cmd_str,
rig_strvfo(tx_vfo));
result = newcat_set_cmd(rig);
if (result != RIG_OK)
{
RETURNFUNC(result);
}
rig->state.tx_vfo = tx_vfo;
RETURNFUNC(newcat_set_cmd(rig));
RETURNFUNC(result);
}
/*
* newcat_get_tx_vfo does not set priv->curr_vfo
*/
int newcat_get_tx_vfo(RIG *rig, vfo_t *tx_vfo)
{
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
int err;
char c;
rmode_t vfo_mode;
struct newcat_priv_data *priv = (struct newcat_priv_data *) rig->state.priv;
char const *command = "FT";
vfo_t vfo_mode;
int result;
char c;
ENTERFUNC;
if (is_ftdx101d || is_ftdx101mp)
{
// what other Yaesu rigs should be using this?
// The DX101D returns FT0 when in split and not transmitting
command = "ST";
}
if (!newcat_valid_command(rig, command))
{
RETURNFUNC(-RIG_ENAVAIL);
@ -8281,10 +8284,9 @@ int newcat_get_tx_vfo(RIG *rig, vfo_t *tx_vfo)
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s%c", command, cat_term);
/* Get TX VFO */
if (RIG_OK != (err = newcat_get_cmd(rig)))
if (RIG_OK != (result = newcat_get_cmd(rig)))
{
RETURNFUNC(err);
RETURNFUNC(result);
}
c = priv->ret_data[2];
@ -8292,17 +8294,25 @@ int newcat_get_tx_vfo(RIG *rig, vfo_t *tx_vfo)
switch (c)
{
case '0':
if (rig->state.vfo_list & RIG_VFO_MAIN) { *tx_vfo = RIG_VFO_MAIN; }
else { *tx_vfo = RIG_VFO_A; }
rig->state.cache.split = 0;
if (rig->state.vfo_list & RIG_VFO_MAIN)
{
*tx_vfo = RIG_VFO_MAIN;
}
else
{
*tx_vfo = RIG_VFO_A;
}
break;
case '1' :
if (rig->state.vfo_list & RIG_VFO_SUB) { *tx_vfo = RIG_VFO_SUB; }
else { *tx_vfo = RIG_VFO_B; }
rig->state.cache.split = 1;
if (rig->state.vfo_list & RIG_VFO_SUB)
{
*tx_vfo = RIG_VFO_SUB;
}
else
{
*tx_vfo = RIG_VFO_B;
}
break;
default:
@ -8312,11 +8322,11 @@ int newcat_get_tx_vfo(RIG *rig, vfo_t *tx_vfo)
}
/* Check to see if RIG is in MEM mode */
err = newcat_get_vfo_mode(rig, RIG_VFO_A, &vfo_mode);
result = newcat_get_vfo_mode(rig, RIG_VFO_A, &vfo_mode);
if (err != RIG_OK)
if (result != RIG_OK)
{
RETURNFUNC(err);
RETURNFUNC(result);
}
if (vfo_mode == RIG_VFO_MEM && *tx_vfo == RIG_VFO_A)
@ -8330,6 +8340,160 @@ int newcat_get_tx_vfo(RIG *rig, vfo_t *tx_vfo)
}
static int newcat_set_split(RIG *rig, split_t split, vfo_t *rx_vfo, vfo_t *tx_vfo)
{
struct newcat_priv_data *priv = (struct newcat_priv_data *) rig->state.priv;
char *command = "ST";
char p1;
int result;
ENTERFUNC;
if (!newcat_valid_command(rig, "ST") || is_ft450 || priv->split_st_command_missing)
{
RETURNFUNC(-RIG_ENAVAIL);
}
result = newcat_set_vfo_from_alias(rig, tx_vfo);
if (result < 0)
{
RETURNFUNC(result);
}
switch (split)
{
case RIG_SPLIT_OFF:
p1 = '0';
break;
case RIG_SPLIT_ON:
p1 = '1';
break;
default:
RETURNFUNC(-RIG_EINVAL);
}
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s%c%c", command, p1, cat_term);
rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s, vfo=%s\n", priv->cmd_str,
rig_strvfo(*tx_vfo));
result = newcat_set_cmd(rig);
if (result != RIG_OK)
{
priv->split_st_command_missing = 1;
RETURNFUNC(result);
}
switch (split)
{
case RIG_SPLIT_OFF:
*rx_vfo = rig->state.current_vfo;
*tx_vfo = rig->state.current_vfo;
break;
case RIG_SPLIT_ON:
// These rigs have fixed RX and TX VFOs when using the ST split command
if (is_ftdx101d || is_ftdx101mp)
{
*rx_vfo = RIG_VFO_MAIN;
*tx_vfo = RIG_VFO_SUB;
}
else if (is_ftdx10)
{
*rx_vfo = RIG_VFO_A;
*tx_vfo = RIG_VFO_B;
}
else
{
*rx_vfo = rig->state.current_vfo;
result = newcat_get_tx_vfo(rig, tx_vfo);
if (result != RIG_OK)
{
RETURNFUNC(result);
}
}
break;
default:
RETURNFUNC(-RIG_EINVAL);
}
RETURNFUNC(result);
}
static int newcat_get_split(RIG *rig, split_t *split, vfo_t *tx_vfo)
{
struct newcat_priv_data *priv = (struct newcat_priv_data *) rig->state.priv;
char const *command = "ST";
int result;
char c;
ENTERFUNC;
if (!newcat_valid_command(rig, "ST") || is_ft450 || priv->split_st_command_missing)
{
RETURNFUNC(-RIG_ENAVAIL);
}
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s%c", command, cat_term);
result = newcat_get_cmd(rig);
if (result != RIG_OK)
{
priv->split_st_command_missing = 1;
RETURNFUNC(result);
}
c = priv->ret_data[2];
switch (c)
{
case '0':
*split = RIG_SPLIT_OFF;
result = newcat_get_tx_vfo(rig, tx_vfo);
if (result != RIG_OK)
{
RETURNFUNC(result);
}
break;
case '1' :
*split = RIG_SPLIT_ON;
// These rigs have fixed RX and TX VFOs when using the ST split command
if (is_ftdx101d || is_ftdx101mp)
{
*tx_vfo = RIG_VFO_SUB;
}
else if (is_ftdx10)
{
*tx_vfo = RIG_VFO_B;
}
else
{
result = newcat_get_tx_vfo(rig, tx_vfo);
if (result != RIG_OK)
{
RETURNFUNC(result);
}
}
break;
default:
rig_debug(RIG_DEBUG_ERR, "%s: Unknown split=%c from index 2 of %s\n", __func__,
c, priv->ret_data);
RETURNFUNC(-RIG_EPROTO);
}
rig_debug(RIG_DEBUG_TRACE, "%s: tx_vfo = %s\n", __func__, rig_strvfo(*tx_vfo));
RETURNFUNC(RIG_OK);
}
int newcat_set_vfo_from_alias(RIG *rig, vfo_t *vfo)
{
@ -10788,7 +10952,7 @@ int newcat_get_rigid(RIG *rig)
* RIG_VFO_MEM for VFO MEM
* return: RIG_OK or error
*/
int newcat_get_vfo_mode(RIG *rig, vfo_t vfo, rmode_t *vfo_mode)
int newcat_get_vfo_mode(RIG *rig, vfo_t vfo, vfo_t *vfo_mode)
{
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
int err;
@ -11275,7 +11439,7 @@ int newcat_set_cmd_validate(RIG *rig)
}
else if (strncmp(priv->cmd_str, "ST", 2) == 0)
{
strcpy(valcmd, ";");
strcpy(valcmd, "ST;");
}
else if (strncmp(priv->cmd_str, "KM", 2) == 0)
{
@ -11293,6 +11457,10 @@ int newcat_set_cmd_validate(RIG *rig)
{
strcpy(valcmd, "");
}
else if (strncmp(priv->cmd_str, "SY", 2) == 0)
{
strcpy(valcmd, "SY;");
}
else
{
rig_debug(RIG_DEBUG_TRACE, "%s: %s not implemented\n", __func__, priv->cmd_str);

Wyświetl plik

@ -129,7 +129,7 @@ struct newcat_priv_data
int poweron; /* to prevent powering on more than once */
int question_mark_response_means_rejected; /* the question mark response has multiple meanings */
char front_rear_status; /* e.g. FTDX5000 EX103 status */
int ftdx101_st_missing; /* is ST command gone? assume not until proven otherwise */
int split_st_command_missing; /* is ST command gone? assume not until proven otherwise */
};
/*
@ -172,9 +172,9 @@ int newcat_cleanup(RIG *rig);
int newcat_open(RIG *rig);
int newcat_close(RIG *rig);
int newcat_set_conf(RIG *rig, token_t token, const char *val);
int newcat_get_conf(RIG *rig, token_t token, char *val);
int newcat_get_conf2(RIG *rig, token_t token, char *val, int val_len);
int newcat_set_conf(RIG *rig, hamlib_token_t token, const char *val);
int newcat_get_conf(RIG *rig, hamlib_token_t token, char *val);
int newcat_get_conf2(RIG *rig, hamlib_token_t token, char *val, int val_len);
int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
int newcat_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
@ -233,8 +233,8 @@ rmode_t newcat_rmode(char mode);
char newcat_modechar(rmode_t rmode);
rmode_t newcat_rmode_width(RIG *rig, vfo_t vfo, char mode, pbwidth_t *width);
int newcat_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val);
int newcat_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val);
int newcat_set_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t val);
int newcat_get_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t *val);
int newcat_send_morse(RIG *rig, vfo_t vfo, const char *msg);
int newcat_send_voice_mem(RIG *rig, vfo_t vfo, int ch);

Some files were not shown because too many files have changed in this diff Show More