kopia lustrzana https://github.com/Hamlib/Hamlib
Add send_morse to icom rigs
Add send_morse to ic7300 -- now works with CQRLog CW mode 73 Mike W9MDBHamlib-3.1
rodzic
7ddb7841f6
commit
62a90596dc
|
@ -229,5 +229,6 @@ const struct rig_caps ic7300_caps = {
|
||||||
.get_split_mode = icom_get_split_mode,
|
.get_split_mode = icom_get_split_mode,
|
||||||
.set_split_vfo = icom_set_split_vfo,
|
.set_split_vfo = icom_set_split_vfo,
|
||||||
.get_split_vfo = NULL,
|
.get_split_vfo = NULL,
|
||||||
|
.send_morse = icom_send_morse
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
46
icom/icom.c
46
icom/icom.c
|
@ -956,6 +956,16 @@ int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (rig->caps->rig_model == RIG_MODEL_IC7300) {
|
||||||
|
switch (level) {
|
||||||
|
case RIG_LEVEL_KEYSPD:
|
||||||
|
if (val.i < 6) val.i = 6;
|
||||||
|
if (val.i > 48) val.i = 48;
|
||||||
|
icom_val = (val.i-6)*(255/42.0)+.99;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Most of the time, the data field is a 3 digit BCD,
|
* Most of the time, the data field is a 3 digit BCD,
|
||||||
|
@ -1360,6 +1370,13 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if ((rig->caps->rig_model == RIG_MODEL_IC7300)&&(level==RIG_LEVEL_KEYSPD)){
|
||||||
|
switch (level) {
|
||||||
|
case RIG_LEVEL_KEYSPD:
|
||||||
|
val->i = val->i*(42.0/255)+6+.5;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
rig_debug(RIG_DEBUG_TRACE,"icom_get_level: %d %d %d %f\n", lvl_len,
|
rig_debug(RIG_DEBUG_TRACE,"icom_get_level: %d %d %d %f\n", lvl_len,
|
||||||
icom_val, val->i, val->f);
|
icom_val, val->i, val->f);
|
||||||
|
@ -3182,6 +3199,35 @@ int icom_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* icom_send_morse
|
||||||
|
* Assumes rig!=NULL, msg!=NULL
|
||||||
|
*/
|
||||||
|
int icom_send_morse (RIG * rig, vfo_t vfo, const char *msg)
|
||||||
|
{
|
||||||
|
unsigned char ackbuf[MAXFRAMELEN];
|
||||||
|
int ack_len=sizeof(ackbuf), retval;
|
||||||
|
|
||||||
|
int len = strlen(msg);
|
||||||
|
if (len > 30) len=30;
|
||||||
|
|
||||||
|
rig_debug(RIG_DEBUG_TRACE,"icom_send_morse: %s\n", msg);
|
||||||
|
|
||||||
|
retval = icom_transaction(rig, C_SND_CW, -1, (unsigned char*)msg, len,
|
||||||
|
ackbuf, &ack_len);
|
||||||
|
|
||||||
|
if (retval != RIG_OK)
|
||||||
|
return retval;
|
||||||
|
|
||||||
|
if (ack_len != 1 || ackbuf[0] != ACK) {
|
||||||
|
rig_debug(RIG_DEBUG_ERR,"icom_send_morse: ack NG (%#.2x), "
|
||||||
|
"len=%d\n", ackbuf[0],ack_len);
|
||||||
|
return -RIG_ERJCTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
return RIG_OK;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* icom_decode is called by sa_sigio, when some asynchronous
|
* icom_decode is called by sa_sigio, when some asynchronous
|
||||||
* data has been received from the rig
|
* data has been received from the rig
|
||||||
|
|
|
@ -194,6 +194,7 @@ int icom_get_powerstat(RIG *rig, powerstat_t *status);
|
||||||
int icom_set_ant(RIG * rig, vfo_t vfo, ant_t ant);
|
int icom_set_ant(RIG * rig, vfo_t vfo, ant_t ant);
|
||||||
int icom_get_ant(RIG * rig, vfo_t vfo, ant_t *ant);
|
int icom_get_ant(RIG * rig, vfo_t vfo, ant_t *ant);
|
||||||
int icom_decode_event(RIG *rig);
|
int icom_decode_event(RIG *rig);
|
||||||
|
int icom_send_morse (RIG * rig, vfo_t vfo, const char *msg);
|
||||||
|
|
||||||
extern const struct confparams icom_cfg_params[];
|
extern const struct confparams icom_cfg_params[];
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue