Commit 1292477f authored by Matteo Quintiliani's avatar Matteo Quintiliani

Added function nmxptool_ew_send_error()


git-svn-id: file:///home/quintiliani/svncopy/nmxptool/trunk@637 3cd66e75-5955-46cb-a940-c26e5fc5497d
parent f2323b7d
......@@ -7,7 +7,7 @@
* Istituto Nazionale di Geofisica e Vulcanologia - Italy
* quintiliani@ingv.it
*
* $Id: nmxptool.c,v 1.104 2008-01-09 15:27:30 mtheo Exp $
* $Id: nmxptool.c,v 1.105 2008-01-11 14:31:50 mtheo Exp $
*
*/
......@@ -627,6 +627,11 @@ int main (int argc, char **argv) {
exitpdscondition = 1;
} else {
nmxp_log(NMXP_LOG_ERR, NMXP_LOG_D_CONNFLOW, "Error receiving data. pd=%p recv_errno=%d\n", pd, recv_errno);
#ifdef HAVE_EARTHWORMOBJS
nmxptool_ew_send_error(NMXPTOOL_EW_ERR_RECVDATA);
#endif
exitpdscondition = 0;
}
......
......@@ -28,6 +28,11 @@
#include "nmxptool_ew.h"
char *NMXPTOOL_EW_ERR_MSG[NMXPTOOL_EW_ERR_MAXVALUE + 1] = {
"",
"Error receiving data."
};
#define MAXMESSAGELEN 160 /* Maximum length of a status or error */
/* message. */
......@@ -547,6 +552,15 @@ void nmxptool_ew_send_heartbeat_if_needed() {
}
}
void nmxptool_ew_send_error(short ierr) {
if(ierr >= 0 && ierr <= NMXPTOOL_EW_ERR_MAXVALUE) {
nmxptool_ew_report_status ( &errLogo, ierr, NMXPTOOL_EW_ERR_MSG[ierr] );
} else {
/* TODO */
}
}
/***************************************************************************
* nmxptool_ew_logit_msg() and nmxptool_ew_logit_err():
*
......
......@@ -22,6 +22,11 @@
#include <transport.h>
#include <trace_buf.h>
#define NMXPTOOL_EW_ERR_NULL 0
#define NMXPTOOL_EW_ERR_RECVDATA 1
/* TODO */
#define NMXPTOOL_EW_ERR_MAXVALUE 1
void nmxptool_ew_attach();
void nmxptool_ew_detach();
......@@ -37,6 +42,7 @@ void nmxptool_ew_report_status ( MSG_LOGO *pLogo, short code, char * message );
int nmxptool_ew_check_flag_terminate();
void nmxptool_ew_send_heartbeat_if_needed();
void nmxptool_ew_send_error(short ierr);
int nmxptool_ew_logit_msg ( char *msg );
int nmxptool_ew_logit_err ( char *msg );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment