Download this file
#ifndef SPEAKER_H
#define SPEAKER_H

#include "heater_controller_master.h"
#include "Scheduler.h"
#include "protocol.h"
#include 

class Protocol; // forward declaration, needed because Speaker and Protocol
                // refer to each other
class Speaker: public Task {
  public:
    Speaker();
    void set_protocol(Protocol* protocol);
    bool canRun(uint32_t now);
    void run(uint32_t now);
    uint8_t* get_buffer();
    void send(uint8_t len, bool ack);
    void got_ack();

  private:
    Protocol* protocol;
    uint8_t buffer[BUFFER_LEN];
    uint8_t buffer_len;
    bool with_ack;
    uint8_t retry_count;
    unsigned long next_retry_millis;
};
#endif
// vim:ft=arduino