18bff17cfSAdrien Destugues /* 28bff17cfSAdrien Destugues * Copyright 2017, Adrien Destugues, pulkomandy@pulkomandy.tk 38bff17cfSAdrien Destugues * Distributed under terms of the MIT license. 48bff17cfSAdrien Destugues */ 58bff17cfSAdrien Destugues 68bff17cfSAdrien Destugues 78bff17cfSAdrien Destugues #ifndef FILESENDER_H 88bff17cfSAdrien Destugues #define FILESENDER_H 98bff17cfSAdrien Destugues 108bff17cfSAdrien Destugues 118bff17cfSAdrien Destugues #include <stdint.h> 128bff17cfSAdrien Destugues #include <string.h> 138bff17cfSAdrien Destugues 148bff17cfSAdrien Destugues 158bff17cfSAdrien Destugues class BDataIO; 168bff17cfSAdrien Destugues class BHandler; 178bff17cfSAdrien Destugues class BSerialPort; 188bff17cfSAdrien Destugues 198bff17cfSAdrien Destugues 208bff17cfSAdrien Destugues class FileSender { 218bff17cfSAdrien Destugues public: 22*f1af46a2SAdrien Destugues virtual ~FileSender(); 238bff17cfSAdrien Destugues virtual bool BytesReceived(const uint8_t* data, 248bff17cfSAdrien Destugues size_t length) = 0; 258bff17cfSAdrien Destugues }; 268bff17cfSAdrien Destugues 278bff17cfSAdrien Destugues 288bff17cfSAdrien Destugues class RawSender: public FileSender { 298bff17cfSAdrien Destugues public: 308bff17cfSAdrien Destugues RawSender(BDataIO* source, BSerialPort* sink, 318bff17cfSAdrien Destugues BHandler* listener); 328bff17cfSAdrien Destugues virtual ~RawSender(); 338bff17cfSAdrien Destugues 348bff17cfSAdrien Destugues virtual bool BytesReceived(const uint8_t* data, 358bff17cfSAdrien Destugues size_t length); 368bff17cfSAdrien Destugues 378bff17cfSAdrien Destugues }; 388bff17cfSAdrien Destugues 398bff17cfSAdrien Destugues 408bff17cfSAdrien Destugues #endif /* !FILESENDER_H */ 41