pfodParser 5.0.1 The pfodParser library is handles commands sent from the Android pfodApp, pfodApp supports WiFi, BLE, Bluetooth and SMS connections

Public Member Functions | List of all members
pfodRingBuffer Class Reference

pfodRingBuffer for Arduino Implements a ring buffer implementation of an Arduino Stream upto 32K buffers NOTE: this implementation DOES NOT BLOCK if the buffer is full extra bytes written are quietly dropped. More...

`#include <pfodRingBuffer.h>`

Inherits Stream.

## Public Member Functions
| pfodRingBuffer ()
void | init (uint8_t *_buf, size_t _size)
| _buf must be at least _size in length _size is limited to 32766 More...
| pfodRingBuffer (uint8_t *_buf, size_t _size)
void | clear ()
void | markWrite ()
void | resetWrite ()
void | copyTo (Print *outputPtr)
| copyTo() copies contents to the print stream unlike read() copyTo does not remove any data from the buffer or move the current read position More...
int | available ()
int | peek ()
int | read ()
void | flush ()
size_t | write (uint8_t b)
size_t | write (const uint8_t *buffer, size_t size)
int | availableForWrite ()
size_t | getSize ()

## Detailed Description

pfodRingBuffer for Arduino Implements a ring buffer implementation of an Arduino Stream upto 32K buffers NOTE: this implementation DOES NOT BLOCK if the buffer is full extra bytes written are quietly dropped.

markWrite() marks current write position resetWrite() resets buffer to previous markWrite effectively deleting any bytes written between markWrite() and resetWrite() any call to read() or flush() or clear() or resetWrite() clears the markWrite multiple calls to markWrite() only saves the last one.

Definition at line 25 of file pfodRingBuffer.h.

## Constructor & Destructor Documentation

## ◆ pfodRingBuffer() [1/2]

pfodRingBuffer::pfodRingBuffer | ( |  | ) |

## ◆ pfodRingBuffer() [2/2]

pfodRingBuffer::pfodRingBuffer | ( | uint8_t * | _buf,
|  | size_t | _size
| ) |  |

## Member Function Documentation

## ◆ available()

int pfodRingBuffer::available | ( |  | ) |

## ◆ availableForWrite()

int pfodRingBuffer::availableForWrite | ( |  | ) |

## ◆ clear()

void pfodRingBuffer::clear | ( |  | ) |

## ◆ copyTo()

void pfodRingBuffer::copyTo | ( | Print * | outputPtr | ) |

copyTo() copies contents to the print stream unlike read() copyTo does not remove any data from the buffer or move the current read position

## ◆ flush()

void pfodRingBuffer::flush | ( |  | ) |

## ◆ getSize()

size_t pfodRingBuffer::getSize | ( |  | ) |

## ◆ init()

void pfodRingBuffer::init | ( | uint8_t * | _buf,
|  | size_t | _size
| ) |  |

_buf must be at least _size in length _size is limited to 32766

## ◆ markWrite()

void pfodRingBuffer::markWrite | ( |  | ) |

## ◆ peek()

int pfodRingBuffer::peek | ( |  | ) |

## ◆ read()

int pfodRingBuffer::read | ( |  | ) |

## ◆ resetWrite()

void pfodRingBuffer::resetWrite | ( |  | ) |

## ◆ write() [1/2]

size_t pfodRingBuffer::write | ( | const uint8_t * | buffer,
|  | size_t | size
| ) |  |

## ◆ write() [2/2]

size_t pfodRingBuffer::write | ( | uint8_t | b | ) |