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
Stephane Fillod 2012-01-11 23:28:01 +01:00
rodzic f6ea9f1246
commit 46033db165
5 zmienionych plików z 12 dodań i 11 usunięć

Wyświetl plik

@ -1341,7 +1341,6 @@ typedef struct {
int retry; /*!< Maximum number of retries, 0 to disable */
char pathname[FILPATHLEN]; /*!< Port pathname */
int ptt_bitnum; /*< Bit number for CM108 GPIO PTT */
union {
struct {
int rate; /*!< Serial baud rate */
@ -1355,6 +1354,9 @@ typedef struct {
struct {
int pin; /*!< Parallel port pin number */
} parallel; /*!< parallel attributes */
struct {
int ptt_bitnum; /*< Bit number for CM108 GPIO PTT */
} cm108; /*!< CM108 attributes */
struct {
int vid; /*!< Vendor ID */
int pid; /*!< Product ID */

Wyświetl plik

@ -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
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_LIBADD = @LIBLTDL@ $(top_builddir)/lib/libmisc.la \
@NET_LIBS@ @MATH_LIBS@ $(LIBUSB_LIBS)

Wyświetl plik

@ -1,6 +1,6 @@
/*
* 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
* CM108 detection code Copyright (c) Thomas Sailer used with permission
*
@ -119,6 +119,7 @@ int cm108_open(hamlib_port_t *port)
}
else
{
close(fd);
rig_debug(RIG_DEBUG_VERBOSE,"cm108:No cm108 (or compatible) device detected \n");
return -RIG_EINVAL;
}
@ -172,14 +173,14 @@ int cm108_ptt_set(hamlib_port_t *p, ptt_t pttx)
// byte 3: xxxx xxxx SPDIF
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[] = {
0x00, // report number
// HID output report
0x00,
(pttx == RIG_PTT_ON) ? (1 << p->ptt_bitnum) : 0, // set GPIO
1 << p->ptt_bitnum, // Data direction register (1=output)
(pttx == RIG_PTT_ON) ? (1 << p->parm.cm108.ptt_bitnum) : 0, // set GPIO
1 << p->parm.cm108.ptt_bitnum, // Data direction register (1=output)
0x00
};
@ -217,7 +218,6 @@ int cm108_ptt_get(hamlib_port_t *p, ptt_t *pttx)
switch(p->type.ptt) {
case RIG_PTT_CM108:
{
unsigned char ctl;
int status;
return -RIG_ENIMPL;
return status;
@ -248,7 +248,6 @@ int cm108_dcd_get(hamlib_port_t *p, dcd_t *dcdx)
switch(p->type.dcd) {
case RIG_DCD_CM108:
{
unsigned char reg;
int status;
return -RIG_ENIMPL;
return status;

Wyświetl plik

@ -7,7 +7,7 @@
* \file src/conf.c
* \brief Rig configuration interface
* \author Stephane Fillod
* \date 2000-2010
* \date 2000-2012
*/
/*
* 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)){
return -RIG_EINVAL;//value format error
}
rs->pttport.ptt_bitnum=val_i;
rs->pttport.parm.cm108.ptt_bitnum=val_i;
break;
case TOK_DCD_TYPE:

Wyświetl plik

@ -327,7 +327,7 @@ RIG * HAMLIB_API rig_init(rig_model_t rig_model)
*/
case RIG_PORT_CM108:
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;
case RIG_PORT_NETWORK: