Casio IT-2000 PDAs & Smartphones User Manual


 
112
CloseComm
int CloseComm(idComDev)
int idComDev;
/* Device to be closed */
The CloseComm function will close the specified communication device and release the memory
area assigned to the transmission and reception queues of the device. All characters in the
transmission queue will be flushed out before the communication device is closed.
< Parameter >
idComDev
: Specifies the device to be closed. The OpenComm function returns this value.
< Return value >
Returns zero if the function is terminated normally. Otherwise it returns a value less than zero.
Note on IrDA:
The CloseComm function performs disconnection of the IrDA protocol. It takes between a few
seconds and 20 to 30 seconds before communication is actually disconnected. This disconnection
time varies depending on the connection partner, threshold time, number of transmitted data pieces
in the user-defined transmission queue and reception queue, and number of transmitted data pieces
in the transmission buffer and reception buffer in the IrDA driver. If the number of transmitted data
pieces in the transmission queue and transmission buffer is equal to or greater than one, that data will
be transmitted. If the number of data pieces reaches zero, this function will be terminated normally.
However, if the number of data pieces in the transmission queue and transmission buffer does not
reach zero within a given period of time, this function will be terminated normally after it clears the
transmission queue and transmission buffer. In other cases where the reception queue and reception
buffer contains at least one character of data, this function will be terminated normally after it erases
them. Since this CloseComm function does not perform OFF control of the IrDA power, it should be
separately handled by the user.