Skip to content

Commit

Permalink
Merge pull request arduino-libraries#84 from sandeepmistry/ServerDrv-…
Browse files Browse the repository at this point in the history
…getDataBuf-available-pin

Use SpiDrv::available() to speed up ServerDrv::getDataBuf(...) in no socket data scenario
  • Loading branch information
aentinger authored Jun 25, 2020
2 parents faa97e0 + 2254f32 commit 7fcdd4a
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 7fcdd4a

Please sign in to comment.