Commander-API V3.0.0
Lightweight Command Parser
Loading...
Searching...
No Matches
commanderPipeChannel Class Reference

#include <Commander-IO.hpp>

Inheritance diagram for commanderPipeChannel:
Collaboration diagram for commanderPipeChannel:

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+1]
 
uint32_t readPointer = 0
 
uint32_t writePointer = 0
 

Friends

class commanderPipeChannelUT
 

Detailed Description

Definition at line 60 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 38 of file Commander-IO.cpp.

◆ flush()

void commanderPipeChannel::flush ( )
override

Flush the channel.

Definition at line 71 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 76 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 48 of file Commander-IO.cpp.

◆ write() [1/2]

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

Definition at line 99 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 successfully written to the channel. Because it is the base class, it returns 0.

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

Friends And Related Function Documentation

◆ commanderPipeChannelUT

friend class commanderPipeChannelUT
friend

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

Member Data Documentation

◆ buffer

uint8_t commanderPipeChannel::buffer[COMMANDER_MAX_COMMAND_SIZE+1]
private

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

◆ readPointer

uint32_t commanderPipeChannel::readPointer = 0
private

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

◆ writePointer

uint32_t commanderPipeChannel::writePointer = 0
private

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