Skip to content

Commit

Permalink
Added new Error message VSCP_ERROR_CONVERSION.
Browse files Browse the repository at this point in the history
  • Loading branch information
grodansparadis committed Jan 10, 2025
1 parent b686f66 commit eec8bc3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/vscp/common/vscp.h
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,7 @@ struct vscpMyNode {
#define VSCP_ERROR_READ 66 /* DUPLICATE FOR CONVENIENCE! Error when reading data */
#define VSCP_ERROR_INVALID_CHECKSUM 67 /* Checksum is not correct */
#define VSCP_ERROR_INTERFACE 68 /* Interface error (not defined etc) */
#define VSCP_ERROR_CONVERSION 69 /* Error in conversion */

/*!
HLO (High Level Object) type (bits 7,6,5,4)
Expand Down
14 changes: 7 additions & 7 deletions src/vscp/common/vscpremotetcpif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ VscpRemoteTcpIf::doCmdReceive(vscpEvent *pEvent)
}

if (NULL == pEvent) {
return VSCP_ERROR_PARAMETER;
return VSCP_ERROR_MEMORY;
}

// If in receive loop terminate
Expand All @@ -712,7 +712,7 @@ VscpRemoteTcpIf::doCmdReceive(vscpEvent *pEvent)
}

if (!getEventFromLine(pEvent, m_inputStrArray[0])) {
return VSCP_ERROR_PARAMETER;
return VSCP_ERROR_READ;
}

return VSCP_ERROR_SUCCESS;
Expand Down Expand Up @@ -748,16 +748,16 @@ VscpRemoteTcpIf::doCmdReceiveEx(vscpEventEx *pEventEx)

vscpEvent *pEvent = new vscpEvent;
if (NULL == pEvent) {
return VSCP_ERROR_PARAMETER;
return VSCP_ERROR_MEMORY;
}

if (!getEventFromLine(pEvent, m_inputStrArray[0])) {
return VSCP_ERROR_PARAMETER;
return VSCP_ERROR_READ;
}

if (!vscp_convertEventToEventEx(pEventEx, pEvent)) {
vscp_deleteEvent(pEvent);
return VSCP_ERROR_PARAMETER;
return VSCP_ERROR_CONVERSION;
}

vscp_deleteEvent(pEvent);
Expand Down Expand Up @@ -906,7 +906,7 @@ VscpRemoteTcpIf::doCmdBlockingReceive(vscpEvent *pEvent, uint32_t mstimeout)

// This should be an event - Get it
if (!getEventFromLine(pEvent, strItem)) {
return VSCP_ERROR_PARAMETER;
return VSCP_ERROR_READ;
}

return VSCP_ERROR_SUCCESS;
Expand Down Expand Up @@ -953,7 +953,7 @@ VscpRemoteTcpIf::doCmdBlockingReceive(vscpEvent *pEvent, uint32_t mstimeout)

// This should be an event - Get it
if (!getEventFromLine(pEvent, strItem)) {
return VSCP_ERROR_PARAMETER;
return VSCP_ERROR_READ;
}

return VSCP_ERROR_SUCCESS;
Expand Down

0 comments on commit eec8bc3

Please sign in to comment.