34#ifndef SHELLMINATOR_IO_HPP_
35#define SHELLMINATOR_IO_HPP_
49#ifdef SHELLMINATOR_USE_WIFI_CLIENT
51 #include <ESP8266WiFi.h>
59#ifdef SHELLMINATOR_ENABLE_WEBSOCKET_MODULE
60#include <WebSocketsServer.h>
99 size_t write( uint8_t b ) {
return 0; }
105 size_t print(
char c ) {
return 0; }
111 size_t print( uint8_t b ) {
return 0; }
117 size_t print(
char *str ) {
return 0; }
123 size_t print(
const char *str ) {
return 0; }
158#ifdef SHELLMINATOR_ENABLE_WEBSOCKET_MODULE
160class shellminatorWebSocketChannel :
public Stream{
168 void select( WebSocketsServer *server_p, int8_t clientID_p );
170 void push( uint8_t data );
172 void push( uint8_t* data,
size_t size );
177 int available()
override;
190 void flush()
override;
196 size_t write( uint8_t b )
override;
198 size_t write(
const uint8_t *buffer,
size_t size )
override;
204 size_t print(
char c );
210 size_t print( uint8_t b );
216 size_t print(
char *str );
222 size_t print(
const char *str );
224 int8_t getClientID();
227 uint8_t buffer[ SHELLMINATOR_WEBSOCKET_BUFFER_LEN ];
228 uint32_t readPointer = 0;
229 uint32_t writePointer = 0;
231 WebSocketsServer *server = NULL;
232 int8_t clientID = -1;
Shellminator channel class.
size_t print(char *str)
Print c-string to the channel.
int read()
Read one byte form the channel.
size_t print(const char *str)
Print c-string to the channel.
int available()
Available bytes in the channel.
size_t print(uint8_t b)
Print one byte to the channel.
int peek()
Peek the firsts byte from the channel.
void flush()
Flush the channel.
size_t write(uint8_t b)
Write one byte to the channel.
size_t print(char c)
Print one character to the channel.