Shellminator  V1.1.1
Simple Terminal
Loading...
Searching...
No Matches
shellminatorChannel Class Reference

Shellminator channel class. More...

#include <Shellminator-IO.hpp>

Inheritance diagram for shellminatorChannel:
[legend]

Public Member Functions

virtual int available ()
 Available bytes in the channel. More...
 
virtual int read ()
 Read one byte form the channel. More...
 
virtual int peek ()
 Peek the firtst byte from the channel. More...
 
virtual void flush ()
 Flush the channel. More...
 
virtual size_t write (uint8_t b)
 Write one byte to the channel. More...
 
virtual size_t print (char c)
 Print one character to the channel. More...
 
virtual size_t print (uint8_t b)
 Print one byte to the channel. More...
 
virtual size_t print (char *str)
 Print c-string to the channel. More...
 
virtual size_t print (const char *str)
 Print c-string to the channel. More...
 

Detailed Description

Shellminator channel class.

Shellminator uses channels to communicate with external peripherials like Serial port or WiFi Client. To make it easy to change the communication source, virtual functions are used. This is the base class for these virtual functions, and they don't do anytging usefull. To make them work, every function in this class has to be overrided to every peripherial, where it has to be used.

Definition at line 63 of file Shellminator-IO.hpp.

Member Function Documentation

◆ available()

virtual int shellminatorChannel::available ( )
inlinevirtual

Available bytes in the channel.

Returns
The available bytes in the channel. Because it is the base class, it returns 0.

Reimplemented in shellminatorArduinoSerialChannel, shellminatorArduino32U4SerialChannel, and shellminatorWiFiClientChannel.

Definition at line 70 of file Shellminator-IO.hpp.

◆ flush()

virtual void shellminatorChannel::flush ( )
inlinevirtual

◆ peek()

virtual int shellminatorChannel::peek ( )
inlinevirtual

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. Because it is the base class, it returns 0.

Reimplemented in shellminatorArduinoSerialChannel, shellminatorArduino32U4SerialChannel, and shellminatorWiFiClientChannel.

Definition at line 80 of file Shellminator-IO.hpp.

◆ print() [1/4]

virtual size_t shellminatorChannel::print ( char *  str)
inlinevirtual

Print c-string to the channel.

Parameters
strThe string that has to be printed to the channel.
Returns
The number of bytes that has been sucessfully printed to the channel. Because it is the base class, it returns 0.

Reimplemented in shellminatorArduinoSerialChannel, shellminatorArduino32U4SerialChannel, and shellminatorWiFiClientChannel.

Definition at line 107 of file Shellminator-IO.hpp.

◆ print() [2/4]

virtual size_t shellminatorChannel::print ( char  c)
inlinevirtual

Print one character to the channel.

Parameters
cThe character that has to be printed to the channel.
Returns
The number of bytes that has been sucessfully printed to the channel. Because it is the base class, it returns 0.

Reimplemented in shellminatorArduinoSerialChannel, shellminatorArduino32U4SerialChannel, and shellminatorWiFiClientChannel.

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

◆ print() [3/4]

virtual size_t shellminatorChannel::print ( const char *  str)
inlinevirtual

Print c-string to the channel.

Parameters
strThe string that has to be printed to the channel.
Returns
The number of bytes that has been sucessfully printed to the channel. Because it is the base class, it returns 0.

Reimplemented in shellminatorArduinoSerialChannel, shellminatorArduino32U4SerialChannel, and shellminatorWiFiClientChannel.

Definition at line 113 of file Shellminator-IO.hpp.

◆ print() [4/4]

virtual size_t shellminatorChannel::print ( uint8_t  b)
inlinevirtual

Print one byte to the channel.

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

Reimplemented in shellminatorArduinoSerialChannel, shellminatorArduino32U4SerialChannel, and shellminatorWiFiClientChannel.

Definition at line 101 of file Shellminator-IO.hpp.

◆ read()

virtual int shellminatorChannel::read ( )
inlinevirtual

Read one byte form the channel.

Returns
Read and return one byte form the channel. The byte will be removed from the channel. Because it is the base class, it returns -1.

Reimplemented in shellminatorArduinoSerialChannel, shellminatorArduino32U4SerialChannel, and shellminatorWiFiClientChannel.

Definition at line 75 of file Shellminator-IO.hpp.

◆ write()

virtual size_t shellminatorChannel::write ( uint8_t  b)
inlinevirtual

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.

Reimplemented in shellminatorArduinoSerialChannel, shellminatorArduino32U4SerialChannel, and shellminatorWiFiClientChannel.

Definition at line 89 of file Shellminator-IO.hpp.