Skip to content

Commit

Permalink
WiFiS3: fix peek() avoiding AT call
Browse files Browse the repository at this point in the history
  • Loading branch information
facchinm committed Jan 7, 2025
1 parent e9d112e commit 7fa5af1
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions libraries/WiFiS3/src/WiFiClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,11 @@ int WiFiClient::read(uint8_t *buf, size_t size) {
/* -------------------------------------------------------------------------- */
int WiFiClient::peek() {
/* -------------------------------------------------------------------------- */
int rv = -1;
if(_sock >= 0) {
string res = "";
modem.begin();
if(modem.write(string(PROMPT(_PEEK)),res, "%s%d\r\n" , CMD_WRITE(_PEEK), _sock)) {
rv = atoi(res.c_str());
}
read_if_needed(1);
if(_sock >= 0 && rx_buffer != nullptr) {
return rx_buffer->peek();
}
return rv;
return -1;
}


Expand Down

0 comments on commit 7fa5af1

Please sign in to comment.