Line data Source code
1 : #pragma once 2 : 3 : #include <AP_Common/AP_Common.h> 4 : #include "AP_Notify_config.h" 5 : 6 : class AP_Notify; 7 : 8 : class NotifyDevice { 9 : public: 10 35598 : virtual ~NotifyDevice() {} 11 : // init - initialised the device 12 : virtual bool init(void) = 0; 13 : // update - updates device according to timed_updated. Should be 14 : // called at 50Hz 15 : virtual void update() = 0; 16 : 17 : #if AP_NOTIFY_MAVLINK_LED_CONTROL_SUPPORT_ENABLED 18 : // handle a LED_CONTROL message, by default device ignore message 19 0 : virtual void handle_led_control(const mavlink_message_t &msg) {} 20 : #endif 21 : 22 : // play a MML tune 23 12 : virtual void play_tune(const char *tune) {} 24 : 25 : // RGB control 26 : // give RGB and flash rate, used with scripting 27 0 : virtual void rgb_control(uint8_t r, uint8_t g, uint8_t b, uint8_t rate_hz) {} 28 : 29 : // RGB control multiple leds independently 30 : // give RGB value for single led 31 0 : virtual void rgb_set_id(uint8_t r, uint8_t g, uint8_t b, uint8_t id) {} 32 : 33 : // Allow text to be sent or removed from a display 34 0 : virtual void send_text_blocking(const char *text, uint8_t line) {} 35 0 : virtual void release_text(uint8_t line) {} 36 : 37 : // this pointer is used to read the parameters relative to devices 38 : const AP_Notify *pNotify; 39 : };