Read response data. If data is available immediately copy up to
|bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of
bytes copied, and return true (1). To read the data at a later time keep a
pointer to |data_out|, set |bytes_read| to 0, return true (1) and execute
|callback| when the data is available (|data_out| will remain valid until
the callback is executed). To indicate response completion set
|bytes_read| to 0 and return false (0). To indicate failure set
|bytes_read| to < 0 (e.g. -2 for ERR_FAILED) and return false (0). This
function will be called in sequence but not from a dedicated thread. For
backwards compatibility set |bytes_read| to -1 and return false (0) and
the ReadResponse function will be called.
Read response data. If data is available immediately copy up to |bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of bytes copied, and return true (1). To read the data at a later time keep a pointer to |data_out|, set |bytes_read| to 0, return true (1) and execute |callback| when the data is available (|data_out| will remain valid until the callback is executed). To indicate response completion set |bytes_read| to 0 and return false (0). To indicate failure set |bytes_read| to < 0 (e.g. -2 for ERR_FAILED) and return false (0). This function will be called in sequence but not from a dedicated thread. For backwards compatibility set |bytes_read| to -1 and return false (0) and the ReadResponse function will be called.