
APPENDIX
Protocol Data Mode
124
2.10
•
19.01.2007
5.1.11.6 DectClose
Function
int DectClose( int nChannel );
Description
Close a special channel for activating data-receive.
Parameter
nChannel
Channel-number
0
Ok
Return
< 0
Error
Note
A closed channel will ignore received data.
5.1.11.7 DectRead
Function
int DectRead( int nChannel,
void *pBuf,
int nMaxLen );
Description
Read the data from a special channel.
nChannel
Channel-number to read from
pBuf
Pointer to buffer for returning data
Parameter
nMaxLen
Max. number of bytes to read
>= 0
Number of actually read bytes
Return
< 0
Error
Note
The function directly returns in case of no data for this channel.
See DectReadTo()
5.1.11.8 DectWrite
Function
int DectWrite( int nChannel,
void *pBuf, int nLength );
Description
Write the data to a special channel.
nChannel
Channel-number to write to
pBuf
Pointer to buffer holding the data to write
Parameter
nLength
Number of bytes to write
>= 0
Number of actually written bytes
Return
< 0
Error
Note
To avoid data loss, the returned value should be considered. If required,
the remaining data should be written by another function call (e.g. by using
DectWriteTo() ). If the function returns with less bytes than instructed this
can be caused by the flow control.
After returning from this function it is possibly that the buffer is still filled
with 4*26 bytes unconfirmed data.
See DectWriteTo(), DectGetTxPending()