https://github.com/robtillaart/devfull
Arduino library for a /dev/full stream.
https://github.com/robtillaart/devfull
arduino dev full
Last synced: 2 months ago
JSON representation
Arduino library for a /dev/full stream.
- Host: GitHub
- URL: https://github.com/robtillaart/devfull
- Owner: RobTillaart
- License: mit
- Created: 2022-03-10T20:34:02.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-13T08:57:52.000Z (about 2 years ago)
- Last Synced: 2025-01-20T08:08:57.915Z (over 1 year ago)
- Topics: arduino, dev, full
- Language: C++
- Homepage:
- Size: 14.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/marketplace/actions/arduino_ci)
[](https://github.com/RobTillaart/DEVFULL/actions/workflows/arduino-lint.yml)
[](https://github.com/RobTillaart/DEVFULL/actions/workflows/jsoncheck.yml)
[](https://github.com/RobTillaart/DEVFULL/issues)
[](https://github.com/RobTillaart/DEVFULL/blob/master/LICENSE)
[](https://github.com/RobTillaart/DEVFULL/releases)
[](https://registry.platformio.org/libraries/robtillaart/DEVFULL)
# DEVFULL
Arduino library for a /dev/full stream.
## Description
**Experimental**
The experimental library implements a stream class that mimics the **/dev/full**
device of a Linux system. You can write nothing to it as it is always full.
Every read data will return the value zero, just like **/dev/zero**.
Calls to **print()** and **println()** will be split up in multiple calls to **write()**.
This causes a return value of n x -28 ==> mostly a number in the 65xxx range
See - https://en.wikipedia.org/wiki//dev/full
feedback as always is welcome.
### Related
- https://github.com/RobTillaart/DEVFULL
- https://github.com/RobTillaart/DEVNULL
- https://github.com/RobTillaart/DEVRANDOM
## Interface
```cpp
#include "DEVFULL.h"
```
- **DEVFULL()** constructor, sets the timeout to zero.
- **int available()** always return INT_MAX = platform dependant.
- **int peek()** always returns 0.
- **int read()** always returns 0.
- **void flush()** does nothing but keeps some compilers happy.
- **size_t write(const uint8_t data)** always returns -28 (ENOSPC == ERROR NO SPACE).
- **size_t write(const uint8_t \*buffer, size_t size)** implements print interface.
Always returns -28 (ENOSPC).
## Error code
| value | name | description |
|:------|:--------|:------------|
| -28 | ENOSPC | No space available for writing onto the "storage device". |
## Operation
Use with care.
See examples.
## Future
#### Must
- improve documentation
#### Should
- improve code
- test different platforms.
#### Could
#### Wont
## Support
If you appreciate my libraries, you can support the development and maintenance.
Improve the quality of the libraries by providing issues and Pull Requests, or
donate through PayPal or GitHub sponsors.
Thank you,