serial programming, threads and dynamic buffer
I have a problem with reading from serial port. I have to read the com port continuously en put the data into files and database. The incoming data is very different from each other. some messages are 3000 characters long.
I read char per char, because i have to check each char, this is for seperating date, hour, header and message. There is some data lost, because of the great value of data and the writing into the database.
I want to solve this with threads, in this thread the port is being read and the data is put into a great buffer, in my main program i want to read from the great buffer to split the data. There is continuously data coming into and read from the buffer,but how can i do this???
i'm writing in c under linux
thanks in advance