Download the file
  1. #ifndef SPEAKER_H
  2. #define SPEAKER_H
  3.  
  4. #include "heater_controller_slave.h"
  5. #include "Scheduler.h"
  6. #include <RF12.h>
  7.  
  8. class Speaker: public Task {
  9. public:
  10. Speaker();
  11. bool canRun(uint32_t now);
  12. void run(uint32_t now);
  13. uint8_t* get_buffer();
  14. void send(uint8_t len, bool ack);
  15. void got_ack();
  16.  
  17. private:
  18. uint8_t buffer[BUFFER_LEN];
  19. uint8_t buffer_len;
  20. bool with_ack;
  21. uint8_t retry_count;
  22. unsigned long next_retry_millis;
  23. };
  24. #endif
  25. // vim:ft=arduino
  26.