#pragma once #include "indicator.h" #include #include namespace de::uvok::badge { enum class BleActionType { None, Template, Indicator, TextAsQrCode }; struct BlePollResult { BleActionType action_type; union { uint8_t new_template; DisplayIndicator new_indicator; }; std::string new_text; static BlePollResult MakeTemplate(uint8_t val) { BlePollResult p{}; p.action_type = BleActionType::Template; p.new_template = val; return p; } static BlePollResult MakeText(const std::string &val) { BlePollResult p{}; p.action_type = BleActionType::TextAsQrCode; p.new_text = val; return p; } static BlePollResult MakeEmpty() { BlePollResult p{}; return p; } static BlePollResult MakeIndicator(DisplayIndicator ind) { BlePollResult p{}; p.action_type = BleActionType::Indicator; p.new_indicator = ind; return p; } private: BlePollResult() : action_type(BleActionType::None), new_indicator(DisplayIndicator::None) { } }; void ble_init(); void ble_advertise(); bool ble_is_active(); BlePollResult ble_poll(); void ble_set_image(uint8_t image); } // namespace de::uvok::badge