I have a problem with the function read() or open(), that some of you might be able to help me with.
I have a Huawei E220 3G modem, which works perfectly. I'm designing a system, that have to access the huawei modem, and read the flowreports it sends back. This also work perfectly (sometimes
But heres the kicker:
I currently open the modem like this:
fd = open(UIDEVICE, O_RDWR | O_NDELAY);
And read like this:
As far as i know, this means that it is opened as read and write, and it has/is no_delay/non_blocking.
When i use read, it does not call the read as blocking call, so it return null, when ever no data is present. I would like it to be a blocking call. This means that I have to remove the non_blocking option on the open function. But this does not make it blocking call. It still returns null values constantly.
I have also tried to make the mode to read only: O_RDONLY. But no results.
Do any of you have some idea that i could try to make it a blocking call, or perhaps an explanation to why it is not a blocking call?
Thanks in advance.
- the fish