Skip to content

Commit

Permalink
Added error loging
Browse files Browse the repository at this point in the history
  • Loading branch information
grodansparadis committed May 12, 2020
1 parent ae7c96f commit 1e71cde
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
11 changes: 10 additions & 1 deletion src/vscp/common/devicethread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -945,11 +945,20 @@ deviceLevel1WriteThread(void* pData)
}

canalMsg msg;
vscp_convertEventToCanal(&msg, pev);
if (!vscp_convertEventToCanal(&msg, pev)) {
syslog(
LOG_ERR,
"deviceLevel1WriteThread - vscp_convertEventToCanal failed");
vscp_deleteEvent(pev);
}

if (CANAL_ERROR_SUCCESS ==
pDevItem->m_proc_CanalBlockingSend(pDevItem->m_openHandle,
&msg,
300)) {
syslog(
LOG_ERR,
"deviceLevel1WriteThread - m_proc_CanalBlockingSend failed");
vscp_deleteEvent(pev);
}
else {
Expand Down
7 changes: 5 additions & 2 deletions src/vscp/common/vscphelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4927,10 +4927,13 @@ vscp_convertEventToCanal(canalMsg* pcanalMsg, const vscpEvent* pvscpEvent)
short sizeData = 0;
uint16_t vscp_class = 0;

if (NULL == pcanalMsg)
if (NULL == pcanalMsg) {
return false;
if (NULL == pvscpEvent)
}

if (NULL == pvscpEvent) {
return false;
}

sizeData = pvscpEvent->sizeData;
vscp_class = pvscpEvent->vscp_class;
Expand Down

0 comments on commit 1e71cde

Please sign in to comment.