Skip to content

Commit

Permalink
Use SpiDrv::available() to speed up ServerDrv::getDataBuf(...) in no …
Browse files Browse the repository at this point in the history
…socket data scenario
  • Loading branch information
sandeepmistry committed Sep 3, 2019
1 parent 227b2c8 commit 2254f32
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/utility/server_drv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,12 @@ bool ServerDrv::getData(uint8_t sock, uint8_t *data, uint8_t peek)

bool ServerDrv::getDataBuf(uint8_t sock, uint8_t *_data, uint16_t *_dataLen)
{
if (!SpiDrv::available())
{
*_dataLen = 0;
return false;
}

WAIT_FOR_SLAVE_SELECT();
// Send Command
SpiDrv::sendCmd(GET_DATABUF_TCP_CMD, PARAM_NUMS_2);
Expand Down

0 comments on commit 2254f32

Please sign in to comment.