Commander-API  V2.1.0
Simple Command Parser
Loading...
Searching...
No Matches
commanderPipeChannel Class Reference

#include <Commander-IO.hpp>

Inheritance diagram for commanderPipeChannel:
[legend]
Collaboration diagram for commanderPipeChannel:
[legend]

Public Member Functions

int available () override
 Available bytes in the channel. More...
 
int read () override
 Read one byte form the channel. More...
 
int peek () override
 Peek the firtst byte from the channel. More...
 
void flush () override
 Flush the channel. More...
 
size_t write (uint8_t b) override
 Write one byte to the channel. More...
 
size_t write (const uint8_t *buffer, size_t size) override
 

Private Attributes

uint8_t buffer [COMMANDER_MAX_COMMAND_SIZE]
 
uint32_t readPointer = 0
 
uint32_t writePointer = 0
 

Detailed Description

Definition at line 102 of file Commander-IO.hpp.

Member Function Documentation

◆ available()

int commanderPipeChannel::available ( )
override

Available bytes in the channel.

Returns
The available bytes in the channel.

Definition at line 37 of file Commander-IO.cpp.

Here is the caller graph for this function:

◆ flush()

void commanderPipeChannel::flush ( )
override

Flush the channel.

Definition at line 81 of file Commander-IO.cpp.

◆ peek()

int commanderPipeChannel::peek ( )
override

Peek the firtst byte from the channel.

Returns
Read and return one byte form the channel. The byte will NOT be removed from the channel.

Definition at line 86 of file Commander-IO.cpp.

◆ read()

int commanderPipeChannel::read ( )
override

Read one byte form the channel.

Returns
Read and return one byte form the channel. The byte will be removed from the channel.

Definition at line 55 of file Commander-IO.cpp.

Here is the caller graph for this function:

◆ write() [1/2]

size_t commanderPipeChannel::write ( const uint8_t *  buffer,
size_t  size 
)
override

Definition at line 114 of file Commander-IO.cpp.

◆ write() [2/2]

size_t commanderPipeChannel::write ( uint8_t  b)
override

Write one byte to the channel.

Parameters
bThe value that has to be written to the channel.
Returns
The number of bytes that has been sucessfully written to the channel. Because it is the base class, it returns 0.

Definition at line 102 of file Commander-IO.cpp.

Member Data Documentation

◆ buffer

uint8_t commanderPipeChannel::buffer[COMMANDER_MAX_COMMAND_SIZE]
private

Definition at line 133 of file Commander-IO.hpp.

◆ readPointer

uint32_t commanderPipeChannel::readPointer = 0
private

Definition at line 134 of file Commander-IO.hpp.

◆ writePointer

uint32_t commanderPipeChannel::writePointer = 0
private

Definition at line 135 of file Commander-IO.hpp.