kopia lustrzana https://github.com/Hamlib/Hamlib
Merge branch 'master' of https://github.com/Hamlib/Hamlib
commit
4fd1acedfc
|
@ -2105,6 +2105,7 @@ enum rig_function_e {
|
||||||
RIG_FUNCTION_READ_FRAME_DIRECT,
|
RIG_FUNCTION_READ_FRAME_DIRECT,
|
||||||
RIG_FUNCTION_IS_ASYNC_FRAME,
|
RIG_FUNCTION_IS_ASYNC_FRAME,
|
||||||
RIG_FUNCTION_PROCESS_ASYNC_FRAME,
|
RIG_FUNCTION_PROCESS_ASYNC_FRAME,
|
||||||
|
RIG_FUNCTION_GET_CONF2,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
14
src/conf.c
14
src/conf.c
|
@ -692,7 +692,7 @@ static int frontend_set_conf(RIG *rig, token_t token, const char *val)
|
||||||
* frontend_get_conf
|
* frontend_get_conf
|
||||||
* assumes rig!=NULL, val!=NULL
|
* assumes rig!=NULL, val!=NULL
|
||||||
*/
|
*/
|
||||||
static int frontend_get_conf(RIG *rig, token_t token, char *val)
|
static int frontend_get_conf2(RIG *rig, token_t token, char *val, int val_len)
|
||||||
{
|
{
|
||||||
struct rig_state *rs;
|
struct rig_state *rs;
|
||||||
const char *s = "";
|
const char *s = "";
|
||||||
|
@ -1245,6 +1245,11 @@ int HAMLIB_API rig_set_conf(RIG *rig, token_t token, const char *val)
|
||||||
* \sa rig_set_conf()
|
* \sa rig_set_conf()
|
||||||
*/
|
*/
|
||||||
int HAMLIB_API rig_get_conf(RIG *rig, token_t token, char *val)
|
int HAMLIB_API rig_get_conf(RIG *rig, token_t token, char *val)
|
||||||
|
{
|
||||||
|
return rig_get_conf2(rig, token, val, 128);
|
||||||
|
}
|
||||||
|
|
||||||
|
int HAMLIB_API rig_get_conf2(RIG *rig, token_t token, char *val, int val_len)
|
||||||
{
|
{
|
||||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||||
|
|
||||||
|
@ -1255,7 +1260,12 @@ int HAMLIB_API rig_get_conf(RIG *rig, token_t token, char *val)
|
||||||
|
|
||||||
if (IS_TOKEN_FRONTEND(token))
|
if (IS_TOKEN_FRONTEND(token))
|
||||||
{
|
{
|
||||||
return frontend_get_conf(rig, token, val);
|
return frontend_get_conf2(rig, token, val, val_len);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rig->caps->get_conf2)
|
||||||
|
{
|
||||||
|
return rig->caps->get_conf2(rig, token, val, val_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rig->caps->get_conf == NULL)
|
if (rig->caps->get_conf == NULL)
|
||||||
|
|
|
@ -971,6 +971,7 @@ int HAMLIB_API write_block_sync_error(hamlib_port_t *p, const unsigned char *txb
|
||||||
int HAMLIB_API write_block(hamlib_port_t *p, const unsigned char *txbuffer, size_t count)
|
int HAMLIB_API write_block(hamlib_port_t *p, const unsigned char *txbuffer, size_t count)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
int method=0;
|
||||||
|
|
||||||
if (p->fd < 0)
|
if (p->fd < 0)
|
||||||
{
|
{
|
||||||
|
@ -1006,6 +1007,7 @@ int HAMLIB_API write_block(hamlib_port_t *p, const unsigned char *txbuffer, size
|
||||||
if (p->write_delay > 0)
|
if (p->write_delay > 0)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
method = 1;
|
||||||
|
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
|
@ -1028,6 +1030,7 @@ int HAMLIB_API write_block(hamlib_port_t *p, const unsigned char *txbuffer, size
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
method = 2;
|
||||||
ret = port_write(p, txbuffer, count);
|
ret = port_write(p, txbuffer, count);
|
||||||
|
|
||||||
if (ret != count)
|
if (ret != count)
|
||||||
|
@ -1045,6 +1048,7 @@ int HAMLIB_API write_block(hamlib_port_t *p, const unsigned char *txbuffer, size
|
||||||
|
|
||||||
if (p->post_write_delay > 0)
|
if (p->post_write_delay > 0)
|
||||||
{
|
{
|
||||||
|
method |= 4;
|
||||||
#ifdef WANT_NON_ACTIVE_POST_WRITE_DELAY
|
#ifdef WANT_NON_ACTIVE_POST_WRITE_DELAY
|
||||||
#define POST_WRITE_DELAY_TRSHLD 10
|
#define POST_WRITE_DELAY_TRSHLD 10
|
||||||
|
|
||||||
|
@ -1063,7 +1067,7 @@ int HAMLIB_API write_block(hamlib_port_t *p, const unsigned char *txbuffer, size
|
||||||
/* with sequential fast writes*/
|
/* with sequential fast writes*/
|
||||||
}
|
}
|
||||||
|
|
||||||
rig_debug(RIG_DEBUG_TRACE, "%s(): TX %d bytes\n", __func__, (int)count);
|
rig_debug(RIG_DEBUG_TRACE, "%s(): TX %d bytes, method=%d\n", __func__, (int)count, method);
|
||||||
dump_hex((unsigned char *) txbuffer, count);
|
dump_hex((unsigned char *) txbuffer, count);
|
||||||
|
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
|
|
|
@ -2351,6 +2351,9 @@ void *HAMLIB_API rig_get_function_ptr(rig_model_t rig_model,
|
||||||
case RIG_FUNCTION_GET_CONF:
|
case RIG_FUNCTION_GET_CONF:
|
||||||
return caps->get_conf;
|
return caps->get_conf;
|
||||||
|
|
||||||
|
case RIG_FUNCTION_GET_CONF2:
|
||||||
|
return caps->get_conf2;
|
||||||
|
|
||||||
case RIG_FUNCTION_SEND_DTMF:
|
case RIG_FUNCTION_SEND_DTMF:
|
||||||
return caps->send_dtmf;
|
return caps->send_dtmf;
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue