Home Alert System
Dependencies: PWM_Tone_Library DHT
M2XStreamClient/NullPrint.h@3:78f223d34f36, 2019-03-05 (annotated)
- Committer:
- ethaderu
- Date:
- Tue Mar 05 02:34:44 2019 +0000
- Revision:
- 3:78f223d34f36
Publish 1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ethaderu | 3:78f223d34f36 | 1 | #ifndef NullPrint_h |
ethaderu | 3:78f223d34f36 | 2 | #define NullPrint_h |
ethaderu | 3:78f223d34f36 | 3 | |
ethaderu | 3:78f223d34f36 | 4 | #include "Print.h" |
ethaderu | 3:78f223d34f36 | 5 | |
ethaderu | 3:78f223d34f36 | 6 | // Null Print class used to calculate length to print |
ethaderu | 3:78f223d34f36 | 7 | class NullPrint : public Print { |
ethaderu | 3:78f223d34f36 | 8 | public: |
ethaderu | 3:78f223d34f36 | 9 | virtual size_t write(uint8_t b) { |
ethaderu | 3:78f223d34f36 | 10 | return 1; |
ethaderu | 3:78f223d34f36 | 11 | } |
ethaderu | 3:78f223d34f36 | 12 | |
ethaderu | 3:78f223d34f36 | 13 | virtual size_t write(const uint8_t* buf, size_t size) { |
ethaderu | 3:78f223d34f36 | 14 | return size; |
ethaderu | 3:78f223d34f36 | 15 | } |
ethaderu | 3:78f223d34f36 | 16 | }; |
ethaderu | 3:78f223d34f36 | 17 | |
ethaderu | 3:78f223d34f36 | 18 | #endif /* NullPrint_h */ |