byte_input_vm.h 916 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include "generic_view_module.h"
  3. #include <gui/modules/byte_input.h>
  4. class ByteInputVM : public GenericViewModule {
  5. public:
  6. ByteInputVM();
  7. ~ByteInputVM() final;
  8. View* get_view() final;
  9. void clean() final;
  10. /**
  11. * @brief Set byte input result callback
  12. *
  13. * @param input_callback input callback fn
  14. * @param changed_callback changed callback fn
  15. * @param callback_context callback context
  16. * @param bytes buffer to use
  17. * @param bytes_count buffer length
  18. */
  19. void set_result_callback(
  20. ByteInputCallback input_callback,
  21. ByteChangedCallback changed_callback,
  22. void* callback_context,
  23. uint8_t* bytes,
  24. uint8_t bytes_count);
  25. /**
  26. * @brief Set byte input header text
  27. *
  28. * @param text text to be shown
  29. */
  30. void set_header_text(const char* text);
  31. private:
  32. ByteInput* byte_input;
  33. };