37 lines
614 B
C
Raw Normal View History

2021-01-29 12:31:58 +01:00
#pragma once
//
// FILE: DEVNULL.h
// AUTHOR: Rob Tillaart
2023-10-24 15:44:52 +02:00
// VERSION: 0.1.6
2021-11-25 12:55:36 +01:00
// PURPOSE: Arduino library for a /dev/null stream - useful for testing
2021-01-29 12:31:58 +01:00
// URL: https://github.com/RobTillaart/DEVNULL
2021-11-25 12:55:36 +01:00
2021-01-29 12:31:58 +01:00
#include "Arduino.h"
2023-10-24 15:44:52 +02:00
#define DEVNULL_LIB_VERSION (F("0.1.6"))
2021-11-25 12:55:36 +01:00
2021-01-29 12:31:58 +01:00
class DEVNULL : public Stream
{
public:
2022-09-21 10:45:14 +02:00
DEVNULL();
int available();
int peek();
int read();
void flush(); // placeholder to keep CI happy
size_t write(const uint8_t data);
size_t write( const uint8_t *buffer, size_t size);
2021-11-25 12:55:36 +01:00
2022-09-21 10:45:14 +02:00
int lastByte();
2021-01-29 12:31:58 +01:00
private:
uint8_t _bottomLessPit;
};
2021-11-25 12:55:36 +01:00
2023-10-24 15:44:52 +02:00
// -- END OF FILE --
2021-11-25 12:55:36 +01:00