To implement peek()

To implement peek() as in https://github.com/vshymanskyy/TinyGSM/issues/396
This commit is contained in:
IoTThinks.com
2021-06-15 09:53:01 +07:00
committed by GitHub
parent a5a2ce3453
commit 4d722a34f2
2 changed files with 8 additions and 4 deletions

View File

@@ -122,6 +122,11 @@ public:
return n - c;
}
uint8_t peek()
{
return _b[_r];
}
private:
int _inc(int i, int n = 1)
{

View File

@@ -241,10 +241,9 @@ class TinyGsmTCP {
return -1;
}
// TODO(SRGDamia1): Implement peek
int peek() override {
return -1;
}
int peek() override {
return (uint8_t)rx.peek();
}
void flush() override {
at->stream.flush();