We are developing a project invloving two seperate programs, a bluetooth(BT) connection program and application program(program A). In order to pass received BT data from a bluetooth device, we use file I/O skills, that is saving those data to several 'txt', says data.txt...etc. While the BT program is writing those files, program A will read those files for data processing and displaying. And now we have encountered the following problems.
1> while BT program and program A is running at the same time, the data wrote to those file seems distorted. Let's say, the BT data that is written to the file is '98', but actual value storing in that 'txt' file is '0'.
2> Orginally, BT program writing frequency is 3 times per second, and program A reading frequency is 2 time per second. In this case, the mobile crashed immediately after 2 programs run. After reducing the frequency or reading and writing, the problem happened after serveral seconds. Once the data is distorted, the problem keeps going on.
In addtiton, the constrain here is the fileIO rate cannot be too low and the data receiving rate of BT program cannot be changed, therefore we have no idea how to solve the problems.
Hope that someone can help us...^.^
Thanks in advance!