cwIo.cpp : Add missing body of serialDeviceSend().

This commit is contained in:
kevin 2024-10-07 12:22:39 -04:00
parent f57cc33e3c
commit 3f47ea20f3

View File

@ -2695,7 +2695,21 @@ void cw::io::serialDeviceSetId( handle_t h, unsigned devIdx, unsigned id
cw::rc_t cw::io::serialDeviceSend( handle_t h, unsigned devIdx, const void* byteA, unsigned byteN ) cw::rc_t cw::io::serialDeviceSend( handle_t h, unsigned devIdx, const void* byteA, unsigned byteN )
{ {
rc_t rc = kOkRC; rc_t rc = kOkRC;
//io_t* p = _handleToPtr(h); io_t* p = _handleToPtr(h);
if( devIdx >= p->serialN )
{
rc = cwLogError(kInvalidArgRC,"%i is an invalid serial device index.",devIdx);
goto errLabel;
}
if((rc = send( p->serialPortSrvH, p->serialA[devIdx].userId, byteA, byteN )) != kOkRC )
{
rc = cwLogError(rc,"Send on serial device index %i failed.",devIdx);
goto errLabel;
}
errLabel:
return rc; return rc;
} }