Add CAT_STATUS_AGAIN to report io::[write|read] can't send or receive more data#29
Add CAT_STATUS_AGAIN to report io::[write|read] can't send or receive more data#29xiaoxiang781216 wants to merge 1 commit intomarcinbor85:masterfrom
Conversation
|
The main idea behind returning BUSY state when can't send out character is related with sleep and low power modes. The main service function should return OK only when there is nothing to do (no pending read/write characters, no pending operations, and etc...). Many applications and projects use it so this is not backward-compatible change. |
The return from cat_io_interface::write doesn't equal to 1 mean that the low level can't accept more character(e.g. when fd is set to non-blocking mode, write will return -EAGAIN in this case). Application need to know this state to avoid the busy loop. |
|
So maybe it should return BUSY_WRITE (add new state) to distinguish this state from BUSY and OK ? |
… more data Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Change-Id: I1e4d69dc32ef94dd2d6d64086528096340f5c74a
Add CAT_STATUS_AGAIN(mimic non blocking io return AGAIN) to indicate this situation. |
|
So now, in which case the main service function will return OK instead of BUSY or AGAIN? |
|
Yes, I will find time to ensure all test pass. |
No description provided.