We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b859fcd commit b1b6b27Copy full SHA for b1b6b27
libraries/lwIpWrapper/src/lwipClient.cpp
@@ -171,9 +171,13 @@ int lwipClient::read()
171
uint8_t b;
172
if ((_tcp_client != NULL) && (_tcp_client->data.p != NULL)) {
173
__disable_irq();
174
- pbuffer_get_data(&(_tcp_client->data), &b, 1);
+ int rv = pbuffer_get_data(&(_tcp_client->data), &b, 1);
175
__enable_irq();
176
- return b;
+ if(rv == 1) {
177
+ return b;
178
+ } else {
179
+ return -1;
180
+ }
181
}
182
// No data available
183
return -1;
0 commit comments