closers

Navigation:  Programming language SQC > Built-in functions > Serial >

closers

Previous pageReturn to chapter overviewNext page

The closers() function closes the serial port associated with handle.

The function returns 0 if successful, -1 to indicate an error.

 

int closers(int fd)

 

Example:

 

void main() 

{

    char buffer[100];

    int len,

        fd = openrs(RS232_1,9600,8,0,1,'>');

 

    while(1) 

    {

        if(recvrs(fd))

        {

            len = readrs(fd,buffer,100,1000,'>');

            if(len)

            {

                buffer[len] = '\0';

                printf("buffer %s\n",buffer);

            }

        }

 

        sleep(1000);

     }

     

     return;

}