
TPMC118-SW-95 – QNX6 Neutrino Device Driver
Page 28 of 30
EXAMPLE
int
fd;
int
result;
TP118_SYNCREAD
syncRdBuf;
Int
i;
...
/*
** read synchronize channels
*/
result = devctl(
fd,
DCMD_TP118_SYNCREAD,
&syncRdBuf,
sizeof(syncRdBuf),
NULL);
if (result == EOK)
{
/* successful set */
for (i = 0; i < TP118_MAX_CHANS; i++)
{
if
(syncRdBuf.valid[i])
{
printf(“CH%d: %ld\n”, i + 1, syncRdBuf.value[i];
}
}
}
...
ERRORS
EINVAL
Invalid argument. This error code is returned if either the size of the
message buffer is too small.
SEE ALSO
Library Reference - devctl()