Error in remote_terminal.c


#1

Hello.
I try to understand csd data port using.
I think I find an error in examples, in remote_terminal.c, in SendString function.
You write:
while ( ( StringCopy = wm_lstGetItem ( StringList, RT_ZERO ) ) != NULL )
{

sReturn = adl_fcmSendDataExt ( V24Handle, BlockToSend );
if ( ADL_FCM_RET_OK_WAIT_RESUME == sReturn )
{
FCMIsReady = FALSE;
}
}
I think it is more correct to write in so manner:
while ( ( ( StringCopy = wm_lstGetItem ( StringList, RT_ZERO ) ) != NULL ) &&( FCMIsReady != FALSE ))

Am I right ?
Thank you.


#2

Hi,

If you observe in the example following is the code in remote_terminal.c function :

if ( FCMIsReady == TRUE )
        {
            /* Send string while there is one in the list, or until flow */
            /* is not ready                                              */
            while ( ( StringCopy = wm_lstGetItem ( StringList, RT_ZERO ) )!= NULL )
            {
            ....

Here before entreing the while loop , the value of FCMIsReady is checked so i think there is no need to check the value again in the while loop.


#3

the value of FCMIsReady can be changed in the while loop:

if ( ADL_FCM_RET_OK_WAIT_RESUME == sReturn )
{
FCMIsReady = FALSE;
}

and I think we need to check the value again in the while loop to exit the while loop
to prevent the ADL_FCM_RET_ERR_WAIT_RESUME error