Commit a854caaa authored by Matteo Quintiliani's avatar Matteo Quintiliani
Browse files

Minor changes


git-svn-id: file:///home/quintiliani/svncopy/nmxptool/trunk@22 3cd66e75-5955-46cb-a940-c26e5fc5497d
parent cb392c6a
......@@ -77,7 +77,7 @@ int nmxp_sendConnect(int isock);
* \retval SOCKET_ERROR on error
*
*/
int nmxp_sendTerminateSubscription(int isock, NMXP_REASON_SHUTDOWN reason, char *message);
int nmxp_sendTerminateSubscription(int isock, NMXP_SHUTDOWN_REASON reason, char *message);
/*! \brief Receive message "NMXP_CHAN_LIST" from a socket
......
......@@ -31,54 +31,54 @@
/*! \brief Defines the type for reason of shutdown */
typedef enum {
NMXP_NORMAL_SHUTDOWN = 1,
NMXP_ERROR_SHUTDOWN = 2,
NMXP_TIMEOUT_SHUTDOWN = 3
} NMXP_REASON_SHUTDOWN;
NMXP_SHUTDOWN_NORMAL = 1,
NMXP_SHUTDOWN_ERROR = 2,
NMXP_SHUTDOWN_TIMEOUT = 3
} NMXP_SHUTDOWN_REASON;
/*! \brief Defines the client message types */
typedef enum {
NMXPMSG_CONNECT = 100,
NMXPMSG_REQUESTPENDIG = 110,
NMXPMSG_TERMINATESUBSCRIPTION = 200,
NMXPMSG_ADDTIMESERIESCHANNELS = 120,
NMXPMSG_ADDSOHCHANNELS = 121,
NMXPMSG_ADDSERIALCHANNELS = 124,
NMXPMSG_ADDTRIGGERCHANNELS = 122,
NMXPMSG_ADDEVENTS = 123,
NMXPMSG_REMOVETIMESERIESCHANNELS = 130,
NMXPMSG_REMOVESOHCHANNELS = 131,
NMXPMSG_REMOVESERIALCHANNELS = 134,
NMXPMSG_REMOVETRIGGERCHANNELS = 132,
NMXPMSG_REMOVEEVENTS = 133,
NMXPMSG_CONNECTREQUEST = 206,
NMXPMSG_CHANNELLISTREQUEST = 209,
NMXPMSG_PRECISLISTREQUEST = 203,
NMXPMSG_CHANNELINFOREQUEST = 226,
NMXPMSG_DATASIZEREQUEST = 229,
NMXPMSG_DATAREQUEST = 227,
NMXPMSG_TRIGGERREQUEST = 231,
NMXPMSG_EVENTREQUEST = 232
NMXP_MSG_CONNECT = 100,
NMXP_MSG_REQUESTPENDIG = 110,
NMXP_MSG_TERMINATESUBSCRIPTION = 200,
NMXP_MSG_ADDTIMESERIESCHANNELS = 120,
NMXP_MSG_ADDSOHCHANNELS = 121,
NMXP_MSG_ADDSERIALCHANNELS = 124,
NMXP_MSG_ADDTRIGGERCHANNELS = 122,
NMXP_MSG_ADDEVENTS = 123,
NMXP_MSG_REMOVETIMESERIESCHANNELS = 130,
NMXP_MSG_REMOVESOHCHANNELS = 131,
NMXP_MSG_REMOVESERIALCHANNELS = 134,
NMXP_MSG_REMOVETRIGGERCHANNELS = 132,
NMXP_MSG_REMOVEEVENTS = 133,
NMXP_MSG_CONNECTREQUEST = 206,
NMXP_MSG_CHANNELLISTREQUEST = 209,
NMXP_MSG_PRECISLISTREQUEST = 203,
NMXP_MSG_CHANNELINFOREQUEST = 226,
NMXP_MSG_DATASIZEREQUEST = 229,
NMXP_MSG_DATAREQUEST = 227,
NMXP_MSG_TRIGGERREQUEST = 231,
NMXP_MSG_EVENTREQUEST = 232
} NMXP_MSG_CLIENT;
/*! \brief Defines the server message types. */
typedef enum {
NMXPMSG_CHANNELLIST = 150,
NMXPMSG_ERROR = 190,
NMXPMSG_COMPRESSED = 1,
NMXPMSG_DECOMPRESSED = 4,
NMXPMSG_TRIGGER = 5,
NMXPMSG_EVENT = 6,
NMXPMSG_READY = 208,
NMXPMSG_PRECISLIST = 253,
NMXPMSG_CHANNELHEADER = 256,
NMXPMSG_DATASIZE = 257,
NMXPMSG_NAQSEVENT = 260,
NMXP_MSG_CHANNELLIST = 150,
NMXP_MSG_ERROR = 190,
NMXP_MSG_COMPRESSED = 1,
NMXP_MSG_DECOMPRESSED = 4,
NMXP_MSG_TRIGGER = 5,
NMXP_MSG_EVENT = 6,
NMXP_MSG_READY = 208,
NMXP_MSG_PRECISLIST = 253,
NMXP_MSG_CHANNELHEADER = 256,
NMXP_MSG_DATASIZE = 257,
NMXP_MSG_NAQSEVENT = 260,
NAQSTRIGGER = 259
} NMXP_MSG_SERVER;
......
......@@ -16,11 +16,11 @@
#include <string.h>
int nmxp_sendConnect(int isock) {
return nmxp_sendMessage(isock, NMXPMSG_CONNECT, NULL, 0);
return nmxp_sendMessage(isock, NMXP_MSG_CONNECT, NULL, 0);
}
int nmxp_sendTerminateSubscription(int isock, NMXP_REASON_SHUTDOWN reason, char *message) {
return nmxp_sendMessage(isock, NMXPMSG_TERMINATESUBSCRIPTION, message, ((message)? strlen(message)-1 : 0));
int nmxp_sendTerminateSubscription(int isock, NMXP_SHUTDOWN_REASON reason, char *message) {
return nmxp_sendMessage(isock, NMXP_MSG_TERMINATESUBSCRIPTION, message, ((message)? strlen(message)-1 : 0));
}
int nmxp_receiveChannelList(int isock, NMXP_CHAN_LIST **pchannelList) {
......@@ -35,8 +35,8 @@ int nmxp_receiveChannelList(int isock, NMXP_CHAN_LIST **pchannelList) {
ret = nmxp_receiveMessage(isock, &type, &buffer, &length);
if(type != NMXPMSG_CHANNELLIST) {
nmxp_log(1, 0, "Type %d is not NMXPMSG_CHANNELLIST!\n", type);
if(type != NMXP_MSG_CHANNELLIST) {
nmxp_log(1, 0, "Type %d is not NMXP_MSG_CHANNELLIST!\n", type);
} else {
*pchannelList = buffer;
......@@ -87,7 +87,7 @@ int nmxp_sendAddTimeSeriesChannel(int isock, NMXP_CHAN_LIST *channelList, uint32
memcpy(&buffer[disp], &app, 4);
disp+=4;
ret = nmxp_sendMessage(isock, NMXPMSG_ADDTIMESERIESCHANNELS, buffer, buffer_length);
ret = nmxp_sendMessage(isock, NMXP_MSG_ADDTIMESERIESCHANNELS, buffer, buffer_length);
if(buffer) {
free(buffer);
......@@ -105,8 +105,8 @@ int nmxp_receiveCompressedData(int isock, NMXP_CHAN_LIST *channelList) {
ret = nmxp_receiveMessage(isock, &type, &buffer, &length);
if(type != NMXPMSG_COMPRESSED) {
nmxp_log(1, 0, "Type %d is not NMXPMSG_COMPRESSED!\n", type);
if(type != NMXP_MSG_COMPRESSED) {
nmxp_log(1, 0, "Type %d is not NMXP_MSG_COMPRESSED!\n", type);
} else {
nmxp_processCompressedData(buffer, length, channelList);
......@@ -125,8 +125,8 @@ int nmxp_receiveDecompressedData(int isock, NMXP_CHAN_LIST *channelList) {
ret = nmxp_receiveMessage(isock, &type, &buffer, &length);
if(type != NMXPMSG_DECOMPRESSED) {
nmxp_log(1, 0, "Type %d is not NMXPMSG_DECOMPRESSED!\n", type);
if(type != NMXP_MSG_DECOMPRESSED) {
nmxp_log(1, 0, "Type %d is not NMXP_MSG_DECOMPRESSED!\n", type);
} else {
nmxp_processDecompressedData(buffer, length, channelList);
......
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