The following code shows you how to use a KcsIO derivative as a data member or as an object to pass into a function.
//Read 4 bytes from KcsIO starting at byte 8.
long getTheSecondLong(KcsStatus *aStat, KcsIO *aIO)
{
long badNumber = -1;
long sSecondLong;
if (aIO == NULL)
return(badNumber);
if ((*aStat = aIO->absRead(8, 4, &sSecondLong)) == KCS_SUCCESS)
return(sSecondLong);
else
return(badNumber);
}
|