[Gpredict-svn] SF.net SVN: gpredict:[655] branches/continuous_network/src
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
|
From: <aa...@us...> - 2010-09-25 13:58:53
|
Revision: 655
http://gpredict.svn.sourceforge.net/gpredict/?rev=655&view=rev
Author: aa1vs
Date: 2010-09-25 13:58:47 +0000 (Sat, 25 Sep 2010)
Log Message:
-----------
Move socket Out of radio-conf.h
Modified Paths:
--------------
branches/continuous_network/src/gtk-rig-ctrl.c
branches/continuous_network/src/gtk-rig-ctrl.h
branches/continuous_network/src/radio-conf.h
Modified: branches/continuous_network/src/gtk-rig-ctrl.c
===================================================================
--- branches/continuous_network/src/gtk-rig-ctrl.c 2010-09-25 11:46:00 UTC (rev 654)
+++ branches/continuous_network/src/gtk-rig-ctrl.c 2010-09-25 13:58:47 UTC (rev 655)
@@ -109,18 +109,18 @@
static void exec_toggle_tx_cycle (GtkRigCtrl *ctrl);
static void exec_duplex_cycle (GtkRigCtrl *ctrl);
static void exec_dual_rig_cycle (GtkRigCtrl *ctrl);
-static gboolean set_freq_simplex (GtkRigCtrl *ctrl, radio_conf_t *conf, gdouble freq);
-static gboolean get_freq_simplex (GtkRigCtrl *ctrl, radio_conf_t *conf, gdouble *freq);
-static gboolean set_freq_toggle (GtkRigCtrl *ctrl, radio_conf_t *conf, gdouble freq);
-static gboolean set_toggle (GtkRigCtrl *ctrl, radio_conf_t *conf);
-static gboolean unset_toggle (GtkRigCtrl *ctrl, radio_conf_t *conf);
-static gboolean get_freq_toggle (GtkRigCtrl *ctrl, radio_conf_t *conf, gdouble *freq);
-static gboolean get_ptt (GtkRigCtrl *ctrl, radio_conf_t *conf);
-static gboolean set_ptt (GtkRigCtrl *ctrl, radio_conf_t *conf, gboolean ptt);
+static gboolean set_freq_simplex (GtkRigCtrl *ctrl, gint sock, gdouble freq);
+static gboolean get_freq_simplex (GtkRigCtrl *ctrl, gint sock, gdouble *freq);
+static gboolean set_freq_toggle (GtkRigCtrl *ctrl, gint sock, gdouble freq);
+static gboolean set_toggle (GtkRigCtrl *ctrl, gint sock);
+static gboolean unset_toggle (GtkRigCtrl *ctrl, gint sock);
+static gboolean get_freq_toggle (GtkRigCtrl *ctrl, gint sock, gdouble *freq);
+static gboolean get_ptt (GtkRigCtrl *ctrl, gint sock);
+static gboolean set_ptt (GtkRigCtrl *ctrl, gint sock, gboolean ptt);
static gboolean set_vfo (GtkRigCtrl *ctrl, vfo_t vfo);
static void update_count_down (GtkRigCtrl *ctrl, gdouble t);
-static gboolean open_rigctld_socket(radio_conf_t *conf);
-static gboolean close_rigctld_socket(radio_conf_t *conf);
+static gboolean open_rigctld_socket(radio_conf_t *conf, gint *sock);
+static gboolean close_rigctld_socket(gint sock);
/* misc utility functions */
static void load_trsp_list (GtkRigCtrl *ctrl);
@@ -129,7 +129,7 @@
static void track_downlink (GtkRigCtrl *ctrl);
static void track_uplink (GtkRigCtrl *ctrl);
static gboolean is_rig_tx_capable (const gchar *confname);
-static gboolean send_rigctld_command(GtkRigCtrl *ctrl, radio_conf_t *conf, gchar *buff, gint size, gchar *buffout, gint sizeout);
+static gboolean send_rigctld_command(GtkRigCtrl *ctrl, gint sock, gchar *buff, gint size, gchar *buffout, gint sizeout);
static GtkVBoxClass *parent_class = NULL;
@@ -1173,15 +1173,15 @@
switch (ctrl->conf->type) {
case RIG_TYPE_TOGGLE_AUTO:
case RIG_TYPE_TOGGLE_MAN:
- unset_toggle (ctrl,ctrl->conf);
+ unset_toggle (ctrl,ctrl->sock);
break;
default:
break;
}
if (ctrl->conf2 != NULL) {
- close_rigctld_socket(ctrl->conf2);
+ close_rigctld_socket(ctrl->sock2);
}
- close_rigctld_socket(ctrl->conf);
+ close_rigctld_socket(ctrl->sock);
}
else {
@@ -1198,11 +1198,11 @@
ctrl->engaged = TRUE;
ctrl->wrops = 0;
- open_rigctld_socket(ctrl->conf);
+ open_rigctld_socket(ctrl->conf,&(ctrl->sock));
/* set initial frequency */
if (ctrl->conf2 != NULL) {
- open_rigctld_socket(ctrl->conf2);
+ open_rigctld_socket(ctrl->conf2,&(ctrl->sock2));
/* set initial dual mode */
exec_dual_rig_cycle (ctrl);
}
@@ -1227,7 +1227,7 @@
case RIG_TYPE_TOGGLE_AUTO:
case RIG_TYPE_TOGGLE_MAN:
- set_toggle (ctrl,ctrl->conf);
+ set_toggle (ctrl,ctrl->sock);
ctrl->last_toggle_tx = -1;
exec_toggle_cycle (ctrl);
break;
@@ -1363,7 +1363,7 @@
/* get PTT status */
if (ctrl->engaged && ctrl->conf->ptt)
- ptt = get_ptt (ctrl, ctrl->conf);
+ ptt = get_ptt (ctrl, ctrl->sock);
/* Dial feedback:
@@ -1377,7 +1377,7 @@
if ((ctrl->engaged) && (ctrl->lastrxf > 0.0)) {
if (ptt == FALSE) {
- if (!get_freq_simplex (ctrl, ctrl->conf, &readfreq)) {
+ if (!get_freq_simplex (ctrl, ctrl->sock, &readfreq)) {
/* error => use a passive value */
readfreq = ctrl->lastrxf;
ctrl->errcnt++;
@@ -1442,7 +1442,7 @@
/* if device is engaged, send freq command to radio */
if ((ctrl->engaged) && (ptt == FALSE) && (fabs(ctrl->lastrxf - tmpfreq) >= 1.0)) {
- if (set_freq_simplex (ctrl, ctrl->conf, tmpfreq)) {
+ if (set_freq_simplex (ctrl, ctrl->sock, tmpfreq)) {
/* reset error counter */
ctrl->errcnt = 0;
@@ -1453,7 +1453,7 @@
the tuning step is larger than what we work with (e.g. FT-817 has a
smallest tuning step of 10 Hz). Therefore we read back the actual
frequency from the rig. */
- get_freq_simplex (ctrl, ctrl->conf, &tmpfreq);
+ get_freq_simplex (ctrl, ctrl->sock, &tmpfreq);
ctrl->lastrxf = tmpfreq;
}
else {
@@ -1478,7 +1478,7 @@
/* get PTT status */
if (ctrl->engaged && ctrl->conf->ptt) {
- ptt = get_ptt (ctrl, ctrl->conf);
+ ptt = get_ptt (ctrl, ctrl->sock);
}
/* Dial feedback:
@@ -1492,7 +1492,7 @@
if ((ctrl->engaged) && (ctrl->lasttxf > 0.0)) {
if (ptt == TRUE) {
- if (!get_freq_simplex (ctrl, ctrl->conf, &readfreq)) {
+ if (!get_freq_simplex (ctrl, ctrl->sock, &readfreq)) {
/* error => use a passive value */
readfreq = ctrl->lasttxf;
ctrl->errcnt++;
@@ -1555,7 +1555,7 @@
/* if device is engaged, send freq command to radio */
if ((ctrl->engaged) && (ptt == TRUE) && (fabs(ctrl->lasttxf - tmpfreq) >= 1.0)) {
- if (set_freq_simplex (ctrl, ctrl->conf, tmpfreq)) {
+ if (set_freq_simplex (ctrl, ctrl->sock, tmpfreq)) {
/* reset error counter */
ctrl->errcnt = 0;
@@ -1566,7 +1566,7 @@
the tuning step is larger than what we work with (e.g. FT-817 has a
smallest tuning step of 10 Hz). Therefore we read back the actual
frequency from the rig. */
- get_freq_simplex (ctrl, ctrl->conf, &tmpfreq);
+ get_freq_simplex (ctrl, ctrl->sock, &tmpfreq);
ctrl->lasttxf = tmpfreq;
}
else {
@@ -1643,7 +1643,7 @@
if (ctrl->engaged && ctrl->conf->ptt) {
- ptt = get_ptt (ctrl, ctrl->conf);
+ ptt = get_ptt (ctrl, ctrl->sock);
}
/* if we are in TX mode do nothing */
@@ -1656,7 +1656,7 @@
/* if device is engaged, send freq command to radio */
if ((ctrl->engaged) && (fabs(ctrl->lasttxf - tmpfreq) >= 10.0)) {
- if (set_freq_toggle (ctrl, ctrl->conf, tmpfreq)) {
+ if (set_freq_toggle (ctrl, ctrl->sock, tmpfreq)) {
/* reset error counter */
ctrl->errcnt = 0;
}
@@ -1710,7 +1710,7 @@
if (ctrl->engaged && (ctrl->lastrxf > 0.0)) {
/* get frequency from receiver */
- if (!get_freq_simplex (ctrl, ctrl->conf, &readfreq)) {
+ if (!get_freq_simplex (ctrl, ctrl->sock, &readfreq)) {
/* error => use a passive value */
readfreq = ctrl->lastrxf;
ctrl->errcnt++;
@@ -1755,7 +1755,7 @@
/* if device is engaged, send freq command to radio */
if ((ctrl->engaged) && (fabs(ctrl->lasttxf - tmpfreq) >= 1.0)) {
- if (set_freq_simplex (ctrl, ctrl->conf2, tmpfreq)) {
+ if (set_freq_simplex (ctrl, ctrl->sock2, tmpfreq)) {
/* reset error counter */
ctrl->errcnt = 0;
@@ -1763,7 +1763,7 @@
g_usleep (WR_DEL);
/* The actual frequency migh be different from what we have set */
- get_freq_simplex (ctrl, ctrl->conf2, &tmpfreq);
+ get_freq_simplex (ctrl, ctrl->sock2, &tmpfreq);
ctrl->lasttxf = tmpfreq;
}
else {
@@ -1792,7 +1792,7 @@
/* if device is engaged, send freq command to radio */
if ((ctrl->engaged) && (fabs(ctrl->lastrxf - tmpfreq) >= 1.0)) {
- if (set_freq_simplex (ctrl, ctrl->conf, tmpfreq)) {
+ if (set_freq_simplex (ctrl, ctrl->sock, tmpfreq)) {
/* reset error counter */
ctrl->errcnt = 0;
@@ -1800,7 +1800,7 @@
g_usleep (WR_DEL);
/* The actual frequency migh be different from what we have set */
- get_freq_simplex (ctrl, ctrl->conf, &tmpfreq);
+ get_freq_simplex (ctrl, ctrl->sock, &tmpfreq);
ctrl->lastrxf = tmpfreq;
}
else {
@@ -1813,7 +1813,7 @@
/* check if uplink dial has changed */
if ((ctrl->engaged) && (ctrl->lasttxf > 0.0)) {
- if (!get_freq_simplex (ctrl, ctrl->conf2, &readfreq)) {
+ if (!get_freq_simplex (ctrl, ctrl->sock2, &readfreq)) {
/* error => use a passive value */
readfreq = ctrl->lasttxf;
ctrl->errcnt++;
@@ -1857,7 +1857,7 @@
/* if device is engaged, send freq command to radio */
if ((ctrl->engaged) && (fabs(ctrl->lastrxf - tmpfreq) >= 1.0)) {
- if (set_freq_simplex (ctrl, ctrl->conf, tmpfreq)) {
+ if (set_freq_simplex (ctrl, ctrl->sock, tmpfreq)) {
/* reset error counter */
ctrl->errcnt = 0;
@@ -1865,7 +1865,7 @@
g_usleep (WR_DEL);
/* The actual frequency migh be different from what we have set */
- get_freq_simplex (ctrl, ctrl->conf, &tmpfreq);
+ get_freq_simplex (ctrl, ctrl->sock, &tmpfreq);
ctrl->lastrxf = tmpfreq;
}
else {
@@ -1889,15 +1889,15 @@
/* if device is engaged, send freq command to radio */
if ((ctrl->engaged) && (fabs(ctrl->lasttxf - tmpfreq) >= 1.0)) {
- if (set_freq_simplex (ctrl, ctrl->conf2, tmpfreq)) {
+ if (set_freq_simplex (ctrl, ctrl->sock2, tmpfreq)) {
/* reset error counter */
ctrl->errcnt = 0;
/* give radio a chance to set frequency */
g_usleep (WR_DEL);
- /* The actual frequency migh be different from what we have set. */
- get_freq_simplex (ctrl, ctrl->conf2, &tmpfreq);
+ /* The actual frequency might be different from what we have set. */
+ get_freq_simplex (ctrl, ctrl->sock2, &tmpfreq);
ctrl->lasttxf = tmpfreq;
}
else {
@@ -1917,7 +1917,7 @@
* \return TRUE if PTT is ON, FALSE if PTT is OFF or an error occurred.
*
*/
-static gboolean get_ptt (GtkRigCtrl *ctrl, radio_conf_t *conf)
+static gboolean get_ptt (GtkRigCtrl *ctrl, gint sock)
{
gchar *buff,**vbuff;
gchar buffback[128];
@@ -1926,7 +1926,7 @@
guint64 pttstat = 0;
- if (conf->ptt == PTT_TYPE_CAT) {
+ if (ctrl->conf->ptt == PTT_TYPE_CAT) {
/* send command get_ptt (t) */
buff = g_strdup_printf ("t\x0a");
size = 2;
@@ -1937,7 +1937,7 @@
size = 2;
}
- retcode=send_rigctld_command(ctrl,conf,buff,size,buffback,128);
+ retcode=send_rigctld_command(ctrl,sock,buff,size,buffback,128);
if (retcode) {
vbuff = g_strsplit (buffback, "\n", 3);
pttstat = g_ascii_strtoull (vbuff[0], NULL, 0); //FIXME base = 0 ok?
@@ -1955,7 +1955,7 @@
* \param ptt The new PTT value (TRUE=ON, FALSE=OFF)
* \return TRUE if the operation was successful, FALSE if an error has occurred
*/
-static gboolean set_ptt (GtkRigCtrl *ctrl, radio_conf_t *conf, gboolean ptt)
+static gboolean set_ptt (GtkRigCtrl *ctrl, gint sock, gboolean ptt)
{
gchar *buff;
gchar buffback[128];
@@ -1971,7 +1971,7 @@
}
size = 4;
- retcode=send_rigctld_command(ctrl,conf,buff,size,buffback,128);
+ retcode=send_rigctld_command(ctrl,sock,buff,size,buffback,128);
g_free (buff);
@@ -1991,7 +1991,7 @@
* gotten the current frequency from the ctrl; however, the param
* might become useful in the future.
*/
-static gboolean set_freq_simplex (GtkRigCtrl *ctrl, radio_conf_t *conf, gdouble freq)
+static gboolean set_freq_simplex (GtkRigCtrl *ctrl, gint sock, gdouble freq)
{
gchar *buff;
gchar buffback[128];
@@ -2002,7 +2002,7 @@
size = 13;
- retcode=send_rigctld_command(ctrl,conf,buff,size,buffback,128);
+ retcode=send_rigctld_command(ctrl,sock,buff,size,buffback,128);
g_free(buff);
return retcode;
@@ -2020,7 +2020,7 @@
* might become useful in the future.
*/
-static gboolean set_freq_toggle (GtkRigCtrl *ctrl, radio_conf_t *conf, gdouble freq)
+static gboolean set_freq_toggle (GtkRigCtrl *ctrl, gint sock, gdouble freq)
{
gchar *buff;
gchar buffback[128];
@@ -2029,7 +2029,7 @@
/* send command */
buff = g_strdup_printf ("I %10.0f\x0a", freq);
size = 12;
- retcode=send_rigctld_command(ctrl,conf,buff,size,buffback,128);
+ retcode=send_rigctld_command(ctrl,sock,buff,size,buffback,128);
g_free(buff);
return retcode;
@@ -2042,7 +2042,7 @@
* occurred.
*
*/
-static gboolean set_toggle (GtkRigCtrl *ctrl, radio_conf_t *conf)
+static gboolean set_toggle (GtkRigCtrl *ctrl, gint sock)
{
gchar *buff;
gchar buffback[128];
@@ -2053,7 +2053,7 @@
buff = g_strdup_printf ("S 1 %d\x0a",ctrl->conf->vfoDown);
size = 13;
- retcode=send_rigctld_command(ctrl,conf,buff,size,buffback,128);
+ retcode=send_rigctld_command(ctrl,sock,buff,size,buffback,128);
g_free(buff);
return retcode;
@@ -2066,7 +2066,7 @@
*
*/
-static gboolean unset_toggle (GtkRigCtrl *ctrl, radio_conf_t *conf)
+static gboolean unset_toggle (GtkRigCtrl *ctrl, gint sock)
{
gchar *buff;
gchar buffback[128];
@@ -2076,7 +2076,7 @@
buff = g_strdup_printf ("S 0 %d\x0a",ctrl->conf->vfoDown);
size = 13;
- retcode=send_rigctld_command(ctrl,conf,buff,size,buffback,128);
+ retcode=send_rigctld_command(ctrl,sock,buff,size,buffback,128);
g_free(buff);
return retcode;
@@ -2089,7 +2089,7 @@
* \return TRUE if the operation was successful, FALSE if a connection error
* occurred.
*/
-static gboolean get_freq_simplex (GtkRigCtrl *ctrl, radio_conf_t *conf, gdouble *freq)
+static gboolean get_freq_simplex (GtkRigCtrl *ctrl, gint sock, gdouble *freq)
{
gchar *buff,**vbuff;
gchar buffback[128];
@@ -2106,7 +2106,7 @@
/* send command */
buff = g_strdup_printf ("f\x0a");
size = 2;
- retcode=send_rigctld_command(ctrl,conf,buff,size,buffback,128);
+ retcode=send_rigctld_command(ctrl,sock,buff,size,buffback,128);
if (retcode) {
vbuff = g_strsplit (buffback, "\n", 3);
*freq = g_ascii_strtod (vbuff[0], NULL);
@@ -2124,7 +2124,7 @@
* occurred.
*/
-static gboolean get_freq_toggle (GtkRigCtrl *ctrl, radio_conf_t *conf, gdouble *freq)
+static gboolean get_freq_toggle (GtkRigCtrl *ctrl, gint sock, gdouble *freq)
{
gchar *buff,**vbuff;
gchar buffback[128];
@@ -2142,7 +2142,7 @@
/* send command */
buff = g_strdup_printf ("i\x0a");
size = 2;
- retcode=send_rigctld_command(ctrl,conf,buff,size,buffback,128);
+ retcode=send_rigctld_command(ctrl,sock,buff,size,buffback,128);
if (retcode) {
vbuff = g_strsplit (buffback, "\n", 3);
*freq = g_ascii_strtod (vbuff[0], NULL);
@@ -2198,7 +2198,7 @@
size = 7;
break;
}
- retcode=send_rigctld_command(ctrl,ctrl->conf,buff,size,buffback,128);
+ retcode=send_rigctld_command(ctrl,ctrl->sock,buff,size,buffback,128);
g_free(buff);
return retcode;
@@ -2488,60 +2488,19 @@
-gboolean send_rigctld_command(GtkRigCtrl *ctrl, radio_conf_t *conf, gchar *buff, gint size, gchar *buffout, gint sizeout)
+gboolean send_rigctld_command(GtkRigCtrl *ctrl, gint sock, gchar *buff, gint size, gchar *buffout, gint sizeout)
{
gint written;
-#if 0
- gint status;
- struct hostent *h;
- struct sockaddr_in ServAddr;
- gint sock; /*!< Network socket */
-
-
- /* create socket */
- sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
- if (sock < 0) {
- sat_log_log (SAT_LOG_LEVEL_ERROR,
- _("%s: Failed to create socket"),
- __FUNCTION__);
- return FALSE;
- }
- else {
- sat_log_log (SAT_LOG_LEVEL_DEBUG,
- _("%s: Network socket created successfully"),
- __FUNCTION__);
- }
-
- memset(&ServAddr, 0, sizeof(ServAddr)); /* Zero out structure */
- ServAddr.sin_family = AF_INET; /* Internet address family */
- h = gethostbyname(conf->host);
- memcpy((char *) &ServAddr.sin_addr.s_addr, h->h_addr_list[0], h->h_length);
- ServAddr.sin_port = htons(conf->port); /* Server port */
-
- /* establish connection */
- status = connect(sock, (struct sockaddr *) &ServAddr, sizeof(ServAddr));
- if (status < 0) {
- sat_log_log (SAT_LOG_LEVEL_ERROR,
- _("%s: Failed to connect to %s:%d"),
- __FUNCTION__, conf->host, conf->port);
- return FALSE;
- }
- else {
- sat_log_log (SAT_LOG_LEVEL_DEBUG,
- _("%s: Connection opened to %s:%d"),
- __FUNCTION__, conf->host, conf->port);
- }
-#endif
/* send command */
- written = send(conf->sock, buff, size, 0);
+ written = send(sock, buff, size, 0);
if (written != size) {
sat_log_log (SAT_LOG_LEVEL_ERROR,
_("%s: SIZE ERROR %d / %d"),
__FUNCTION__, written, size);
}
/* try to read answer */
- size = read (conf->sock, buffout, 127);
+ size = read (sock, buffout, 127);
if (size == 0) {
sat_log_log (SAT_LOG_LEVEL_ERROR,
_("%s:%s: Got 0 bytes from rigctld"),
@@ -2554,17 +2513,6 @@
}
-#if 0
- /*shutdown the rigctld connect*/
- written = send(sock, "q\x0a", 2, 0);
-#ifndef WIN32
- shutdown (sock, SHUT_RDWR);
-#else
-
- shutdown (sock, SD_BOTH);
-#endif
- close (sock);
-#endif
ctrl->wrops++;
return TRUE;
@@ -2661,7 +2609,7 @@
}
else {
- ptt = get_ptt (ctrl, ctrl->conf);
+ ptt = get_ptt (ctrl, ctrl->sock);
if (ptt == FALSE) {
/* PTT is OFF => set TX freq then set PTT to ON */
@@ -2670,7 +2618,7 @@
__FUNCTION__);
exec_toggle_tx_cycle (ctrl);
- set_ptt(ctrl, ctrl->conf, TRUE);
+ set_ptt(ctrl, ctrl->sock, TRUE);
}
else {
/* PTT is ON => set to OFF */
@@ -2678,7 +2626,7 @@
_("%s: PTT is ON = Set PTT=OFF"),
__FUNCTION__);
- set_ptt(ctrl, ctrl->conf, FALSE);
+ set_ptt(ctrl, ctrl->sock, FALSE);
}
}
@@ -2693,13 +2641,13 @@
}
-static gboolean open_rigctld_socket (radio_conf_t *conf) {
+static gboolean open_rigctld_socket (radio_conf_t *conf, gint *sock) {
struct sockaddr_in ServAddr;
struct hostent *h;
gint status;
- conf->sock=socket(PF_INET,SOCK_STREAM,IPPROTO_TCP);
- if (conf->sock < 0) {
+ *sock=socket(PF_INET,SOCK_STREAM,IPPROTO_TCP);
+ if (sock < 0) {
sat_log_log (SAT_LOG_LEVEL_ERROR,
_("%s: Failed to create socket"),
__FUNCTION__);
@@ -2718,7 +2666,7 @@
ServAddr.sin_port = htons(conf->port); /* Server port */
/* establish connection */
- status = connect(conf->sock, (struct sockaddr *) &ServAddr, sizeof(ServAddr));
+ status = connect(*sock, (struct sockaddr *) &ServAddr, sizeof(ServAddr));
if (status < 0) {
sat_log_log (SAT_LOG_LEVEL_ERROR,
_("%s: Failed to connect to %s:%d"),
@@ -2734,18 +2682,18 @@
return TRUE;
}
-static gboolean close_rigctld_socket (radio_conf_t *conf) {
+static gboolean close_rigctld_socket (gint sock) {
gint written;
/*shutdown the rigctld connect*/
- written = send(conf->sock, "q\x0a", 2, 0);
+ written = send(sock, "q\x0a", 2, 0);
#ifndef WIN32
- shutdown (conf->sock, SHUT_RDWR);
+ shutdown (sock, SHUT_RDWR);
#else
- shutdown (conf->sock, SD_BOTH);
+ shutdown (sock, SD_BOTH);
#endif
- close (conf->sock);
+ close (sock);
return TRUE;
}
Modified: branches/continuous_network/src/gtk-rig-ctrl.h
===================================================================
--- branches/continuous_network/src/gtk-rig-ctrl.h 2010-09-25 11:46:00 UTC (rev 654)
+++ branches/continuous_network/src/gtk-rig-ctrl.h 2010-09-25 13:58:47 UTC (rev 655)
@@ -108,7 +108,9 @@
glong last_toggle_tx; /*!< Last time when exec_toggle_tx_cycle() was executed (seconds)
-1 indicates that an update should be performed ASAP */
-
+
+ gint sock, sock2; /*!< Sockets for controlling the radio(s). */
+
/* debug related */
guint wrops;
guint rdops;
Modified: branches/continuous_network/src/radio-conf.h
===================================================================
--- branches/continuous_network/src/radio-conf.h 2010-09-25 11:46:00 UTC (rev 654)
+++ branches/continuous_network/src/radio-conf.h 2010-09-25 13:58:47 UTC (rev 655)
@@ -69,7 +69,6 @@
ptt_type_t ptt; /*!< PTT type (needed for RX, TX, and TRX) */
vfo_t vfoDown; /*!< Downlink VFO for full-duplex radios */
vfo_t vfoUp; /*!< Uplink VFO for full-duplex radios */
- gint sock; /*!< Socket for communications with rigctld */
} radio_conf_t;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|