kopia lustrzana https://github.com/Hamlib/Hamlib
Cast constant caps to variable caps in order to avoid compiler warnings.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2136 7ae35d74-ebe9-4afe-98af-79ac388436b8Hamlib-1.2.6rc1
rodzic
842a06fe98
commit
cee96e3af5
21
src/iofunc.c
21
src/iofunc.c
|
@ -2,7 +2,7 @@
|
||||||
* Hamlib Interface - generic file based io functions
|
* Hamlib Interface - generic file based io functions
|
||||||
* Copyright (c) 2000-2004 by Stephane Fillod and Frank Singleton
|
* Copyright (c) 2000-2004 by Stephane Fillod and Frank Singleton
|
||||||
*
|
*
|
||||||
* $Id: iofunc.c,v 1.14 2005-04-03 12:27:16 fillods Exp $
|
* $Id: iofunc.c,v 1.15 2006-10-07 21:33:31 csete Exp $
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or modify
|
* This library is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Library General Public License as
|
* it under the terms of the GNU Library General Public License as
|
||||||
|
@ -19,7 +19,6 @@
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -129,7 +128,7 @@ int HAMLIB_API write_block(hamlib_port_t *p, const char *txbuffer, size_t count)
|
||||||
/* with sequential fast writes*/
|
/* with sequential fast writes*/
|
||||||
}
|
}
|
||||||
rig_debug(RIG_DEBUG_TRACE,"TX %d bytes\n",count);
|
rig_debug(RIG_DEBUG_TRACE,"TX %d bytes\n",count);
|
||||||
dump_hex(txbuffer,count);
|
dump_hex((unsigned char *) txbuffer,count);
|
||||||
|
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
}
|
}
|
||||||
|
@ -168,13 +167,13 @@ int HAMLIB_API read_block(hamlib_port_t *p, char *rxbuffer, size_t count)
|
||||||
|
|
||||||
retval = select(p->fd+1, &rfds, NULL, NULL, &tv);
|
retval = select(p->fd+1, &rfds, NULL, NULL, &tv);
|
||||||
if (retval == 0) {
|
if (retval == 0) {
|
||||||
dump_hex(rxbuffer, total_count);
|
dump_hex((unsigned char *) rxbuffer, total_count);
|
||||||
rig_debug(RIG_DEBUG_WARN, "read_block: timedout after %d chars\n",
|
rig_debug(RIG_DEBUG_WARN, "read_block: timedout after %d chars\n",
|
||||||
total_count);
|
total_count);
|
||||||
return -RIG_ETIMEOUT;
|
return -RIG_ETIMEOUT;
|
||||||
}
|
}
|
||||||
if (retval < 0) {
|
if (retval < 0) {
|
||||||
dump_hex(rxbuffer, total_count);
|
dump_hex((unsigned char *) rxbuffer, total_count);
|
||||||
rig_debug(RIG_DEBUG_ERR,"read_block: select error after %d chars: "
|
rig_debug(RIG_DEBUG_ERR,"read_block: select error after %d chars: "
|
||||||
"%s\n", total_count, strerror(errno));
|
"%s\n", total_count, strerror(errno));
|
||||||
return -RIG_EIO;
|
return -RIG_EIO;
|
||||||
|
@ -195,7 +194,7 @@ int HAMLIB_API read_block(hamlib_port_t *p, char *rxbuffer, size_t count)
|
||||||
}
|
}
|
||||||
|
|
||||||
rig_debug(RIG_DEBUG_TRACE,"RX %d bytes\n",total_count);
|
rig_debug(RIG_DEBUG_TRACE,"RX %d bytes\n",total_count);
|
||||||
dump_hex(rxbuffer, total_count);
|
dump_hex((unsigned char *) rxbuffer, total_count);
|
||||||
return total_count; /* return bytes count read */
|
return total_count; /* return bytes count read */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,9 +239,9 @@ int HAMLIB_API read_string(hamlib_port_t *p, char *rxbuffer, size_t rxmax, const
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (retval < 0) {
|
if (retval < 0) {
|
||||||
dump_hex(rxbuffer, total_count);
|
dump_hex((unsigned char *) rxbuffer, total_count);
|
||||||
rig_debug(RIG_DEBUG_ERR, "%s: select error after %d chars: %s\n",
|
rig_debug(RIG_DEBUG_ERR, "%s: select error after %d chars: %s\n",
|
||||||
__FUNCTION__, total_count, strerror(errno));
|
__FUNCTION__, total_count, strerror(errno));
|
||||||
return -RIG_EIO;
|
return -RIG_EIO;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
@ -251,7 +250,7 @@ int HAMLIB_API read_string(hamlib_port_t *p, char *rxbuffer, size_t rxmax, const
|
||||||
*/
|
*/
|
||||||
rd_count = read(p->fd, &rxbuffer[total_count], 1);
|
rd_count = read(p->fd, &rxbuffer[total_count], 1);
|
||||||
if (rd_count < 0) {
|
if (rd_count < 0) {
|
||||||
dump_hex(rxbuffer, total_count);
|
dump_hex((unsigned char *) rxbuffer, total_count);
|
||||||
rig_debug(RIG_DEBUG_ERR, "%s: read failed - %s\n",__FUNCTION__,
|
rig_debug(RIG_DEBUG_ERR, "%s: read failed - %s\n",__FUNCTION__,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
return -RIG_EIO;
|
return -RIG_EIO;
|
||||||
|
@ -273,7 +272,7 @@ int HAMLIB_API read_string(hamlib_port_t *p, char *rxbuffer, size_t rxmax, const
|
||||||
}
|
}
|
||||||
|
|
||||||
rig_debug(RIG_DEBUG_TRACE,"RX %d characters\n",total_count);
|
rig_debug(RIG_DEBUG_TRACE,"RX %d characters\n",total_count);
|
||||||
dump_hex(rxbuffer, total_count);
|
dump_hex((unsigned char *) rxbuffer, total_count);
|
||||||
return total_count; /* return bytes count read */
|
return total_count; /* return bytes count read */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue