kopia lustrzana https://github.com/Hamlib/Hamlib
CM108 GPIO PTT: do not break ABI
Move around the ptt_bitnum field in the union of hamlib_port_t. Increase Hamlib frontend revision.Hamlib-1.2.15
rodzic
f6ea9f1246
commit
46033db165
|
@ -1341,7 +1341,6 @@ typedef struct {
|
||||||
int retry; /*!< Maximum number of retries, 0 to disable */
|
int retry; /*!< Maximum number of retries, 0 to disable */
|
||||||
|
|
||||||
char pathname[FILPATHLEN]; /*!< Port pathname */
|
char pathname[FILPATHLEN]; /*!< Port pathname */
|
||||||
int ptt_bitnum; /*< Bit number for CM108 GPIO PTT */
|
|
||||||
union {
|
union {
|
||||||
struct {
|
struct {
|
||||||
int rate; /*!< Serial baud rate */
|
int rate; /*!< Serial baud rate */
|
||||||
|
@ -1355,6 +1354,9 @@ typedef struct {
|
||||||
struct {
|
struct {
|
||||||
int pin; /*!< Parallel port pin number */
|
int pin; /*!< Parallel port pin number */
|
||||||
} parallel; /*!< parallel attributes */
|
} parallel; /*!< parallel attributes */
|
||||||
|
struct {
|
||||||
|
int ptt_bitnum; /*< Bit number for CM108 GPIO PTT */
|
||||||
|
} cm108; /*!< CM108 attributes */
|
||||||
struct {
|
struct {
|
||||||
int vid; /*!< Vendor ID */
|
int vid; /*!< Vendor ID */
|
||||||
int pid; /*!< Product ID */
|
int pid; /*!< Product ID */
|
||||||
|
|
|
@ -6,7 +6,7 @@ RIGSRC = rig.c serial.c misc.c register.c event.c cal.c conf.c tones.c \
|
||||||
|
|
||||||
lib_LTLIBRARIES = libhamlib.la
|
lib_LTLIBRARIES = libhamlib.la
|
||||||
libhamlib_la_SOURCES = $(RIGSRC)
|
libhamlib_la_SOURCES = $(RIGSRC)
|
||||||
libhamlib_la_LDFLAGS = $(WINLDFLAGS) $(OSXLDFLAGS) -no-undefined -version-info @ABI_VERSION@:15:0
|
libhamlib_la_LDFLAGS = $(WINLDFLAGS) $(OSXLDFLAGS) -no-undefined -version-info @ABI_VERSION@:16:0
|
||||||
libhamlib_la_CFLAGS = -DIN_HAMLIB $(AM_CFLAGS) -DHAMLIB_MODULE_DIR=\"$(pkglibdir)\"
|
libhamlib_la_CFLAGS = -DIN_HAMLIB $(AM_CFLAGS) -DHAMLIB_MODULE_DIR=\"$(pkglibdir)\"
|
||||||
libhamlib_la_LIBADD = @LIBLTDL@ $(top_builddir)/lib/libmisc.la \
|
libhamlib_la_LIBADD = @LIBLTDL@ $(top_builddir)/lib/libmisc.la \
|
||||||
@NET_LIBS@ @MATH_LIBS@ $(LIBUSB_LIBS)
|
@NET_LIBS@ @MATH_LIBS@ $(LIBUSB_LIBS)
|
||||||
|
|
11
src/cm108.c
11
src/cm108.c
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Hamlib Interface - CM108 HID communication low-level support
|
* Hamlib Interface - CM108 HID communication low-level support
|
||||||
* Copyright (c) 2000-2010 by Stephane Fillod
|
* Copyright (c) 2000-2012 by Stephane Fillod
|
||||||
* Copyright (c) 2011 by Andrew Errington
|
* Copyright (c) 2011 by Andrew Errington
|
||||||
* CM108 detection code Copyright (c) Thomas Sailer used with permission
|
* CM108 detection code Copyright (c) Thomas Sailer used with permission
|
||||||
*
|
*
|
||||||
|
@ -119,6 +119,7 @@ int cm108_open(hamlib_port_t *port)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
close(fd);
|
||||||
rig_debug(RIG_DEBUG_VERBOSE,"cm108:No cm108 (or compatible) device detected \n");
|
rig_debug(RIG_DEBUG_VERBOSE,"cm108:No cm108 (or compatible) device detected \n");
|
||||||
return -RIG_EINVAL;
|
return -RIG_EINVAL;
|
||||||
}
|
}
|
||||||
|
@ -172,14 +173,14 @@ int cm108_ptt_set(hamlib_port_t *p, ptt_t pttx)
|
||||||
// byte 3: xxxx xxxx SPDIF
|
// byte 3: xxxx xxxx SPDIF
|
||||||
|
|
||||||
rig_debug(RIG_DEBUG_VERBOSE,"cm108:cm108_ptt_set bit number %d to state %d\n",
|
rig_debug(RIG_DEBUG_VERBOSE,"cm108:cm108_ptt_set bit number %d to state %d\n",
|
||||||
p->ptt_bitnum, (pttx == RIG_PTT_ON) ? 1 : 0);
|
p->parm.cm108.ptt_bitnum, (pttx == RIG_PTT_ON) ? 1 : 0);
|
||||||
|
|
||||||
char out_rep[] = {
|
char out_rep[] = {
|
||||||
0x00, // report number
|
0x00, // report number
|
||||||
// HID output report
|
// HID output report
|
||||||
0x00,
|
0x00,
|
||||||
(pttx == RIG_PTT_ON) ? (1 << p->ptt_bitnum) : 0, // set GPIO
|
(pttx == RIG_PTT_ON) ? (1 << p->parm.cm108.ptt_bitnum) : 0, // set GPIO
|
||||||
1 << p->ptt_bitnum, // Data direction register (1=output)
|
1 << p->parm.cm108.ptt_bitnum, // Data direction register (1=output)
|
||||||
0x00
|
0x00
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -217,7 +218,6 @@ int cm108_ptt_get(hamlib_port_t *p, ptt_t *pttx)
|
||||||
switch(p->type.ptt) {
|
switch(p->type.ptt) {
|
||||||
case RIG_PTT_CM108:
|
case RIG_PTT_CM108:
|
||||||
{
|
{
|
||||||
unsigned char ctl;
|
|
||||||
int status;
|
int status;
|
||||||
return -RIG_ENIMPL;
|
return -RIG_ENIMPL;
|
||||||
return status;
|
return status;
|
||||||
|
@ -248,7 +248,6 @@ int cm108_dcd_get(hamlib_port_t *p, dcd_t *dcdx)
|
||||||
switch(p->type.dcd) {
|
switch(p->type.dcd) {
|
||||||
case RIG_DCD_CM108:
|
case RIG_DCD_CM108:
|
||||||
{
|
{
|
||||||
unsigned char reg;
|
|
||||||
int status;
|
int status;
|
||||||
return -RIG_ENIMPL;
|
return -RIG_ENIMPL;
|
||||||
return status;
|
return status;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
* \file src/conf.c
|
* \file src/conf.c
|
||||||
* \brief Rig configuration interface
|
* \brief Rig configuration interface
|
||||||
* \author Stephane Fillod
|
* \author Stephane Fillod
|
||||||
* \date 2000-2010
|
* \date 2000-2012
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Hamlib Interface - configuration interface
|
* Hamlib Interface - configuration interface
|
||||||
|
@ -310,7 +310,7 @@ static int frontend_set_conf(RIG *rig, token_t token, const char *val)
|
||||||
if (1 != sscanf(val, "%d", &val_i)){
|
if (1 != sscanf(val, "%d", &val_i)){
|
||||||
return -RIG_EINVAL;//value format error
|
return -RIG_EINVAL;//value format error
|
||||||
}
|
}
|
||||||
rs->pttport.ptt_bitnum=val_i;
|
rs->pttport.parm.cm108.ptt_bitnum=val_i;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TOK_DCD_TYPE:
|
case TOK_DCD_TYPE:
|
||||||
|
|
|
@ -327,7 +327,7 @@ RIG * HAMLIB_API rig_init(rig_model_t rig_model)
|
||||||
*/
|
*/
|
||||||
case RIG_PORT_CM108:
|
case RIG_PORT_CM108:
|
||||||
strncpy(rs->rigport.pathname, DEFAULT_CM108_PORT, FILPATHLEN);
|
strncpy(rs->rigport.pathname, DEFAULT_CM108_PORT, FILPATHLEN);
|
||||||
rs->rigport.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM;
|
rs->rigport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RIG_PORT_NETWORK:
|
case RIG_PORT_NETWORK:
|
||||||
|
|
Ładowanie…
Reference in New Issue