To implement peek()
To implement peek() as in https://github.com/vshymanskyy/TinyGSM/issues/396
This commit is contained in:
@@ -122,6 +122,11 @@ public:
|
|||||||
return n - c;
|
return n - c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8_t peek()
|
||||||
|
{
|
||||||
|
return _b[_r];
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int _inc(int i, int n = 1)
|
int _inc(int i, int n = 1)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -241,10 +241,9 @@ class TinyGsmTCP {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(SRGDamia1): Implement peek
|
int peek() override {
|
||||||
int peek() override {
|
return (uint8_t)rx.peek();
|
||||||
return -1;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void flush() override {
|
void flush() override {
|
||||||
at->stream.flush();
|
at->stream.flush();
|
||||||
|
|||||||
Reference in New Issue
Block a user