1*8bff17cfSAdrien Destugues /* 2*8bff17cfSAdrien Destugues * Copyright 2017, Adrien Destugues, pulkomandy@pulkomandy.tk 3*8bff17cfSAdrien Destugues * Distributed under terms of the MIT license. 4*8bff17cfSAdrien Destugues */ 5*8bff17cfSAdrien Destugues 6*8bff17cfSAdrien Destugues 7*8bff17cfSAdrien Destugues #ifndef FILESENDER_H 8*8bff17cfSAdrien Destugues #define FILESENDER_H 9*8bff17cfSAdrien Destugues 10*8bff17cfSAdrien Destugues 11*8bff17cfSAdrien Destugues #include <stdint.h> 12*8bff17cfSAdrien Destugues #include <string.h> 13*8bff17cfSAdrien Destugues 14*8bff17cfSAdrien Destugues 15*8bff17cfSAdrien Destugues class BDataIO; 16*8bff17cfSAdrien Destugues class BHandler; 17*8bff17cfSAdrien Destugues class BSerialPort; 18*8bff17cfSAdrien Destugues 19*8bff17cfSAdrien Destugues 20*8bff17cfSAdrien Destugues class FileSender { 21*8bff17cfSAdrien Destugues public: 22*8bff17cfSAdrien Destugues virtual bool BytesReceived(const uint8_t* data, 23*8bff17cfSAdrien Destugues size_t length) = 0; 24*8bff17cfSAdrien Destugues }; 25*8bff17cfSAdrien Destugues 26*8bff17cfSAdrien Destugues 27*8bff17cfSAdrien Destugues class RawSender: public FileSender { 28*8bff17cfSAdrien Destugues public: 29*8bff17cfSAdrien Destugues RawSender(BDataIO* source, BSerialPort* sink, 30*8bff17cfSAdrien Destugues BHandler* listener); 31*8bff17cfSAdrien Destugues virtual ~RawSender(); 32*8bff17cfSAdrien Destugues 33*8bff17cfSAdrien Destugues virtual bool BytesReceived(const uint8_t* data, 34*8bff17cfSAdrien Destugues size_t length); 35*8bff17cfSAdrien Destugues 36*8bff17cfSAdrien Destugues }; 37*8bff17cfSAdrien Destugues 38*8bff17cfSAdrien Destugues 39*8bff17cfSAdrien Destugues #endif /* !FILESENDER_H */ 40