add a property to track the operating state of the universe
This commit is contained in:
parent
718a3dd22f
commit
e76fd2f603
|
@ -32,6 +32,7 @@ namespace DMX {
|
|||
*/
|
||||
Universe::Universe(int timeout_period)
|
||||
: null_start_data({0})
|
||||
, status_(Status::DMX_NULL)
|
||||
, rx_timeout_period_(timeout_period)
|
||||
{
|
||||
}
|
||||
|
@ -158,6 +159,26 @@ void Universe::altSCdata(const std::vector<uint8_t> & data)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Universe::status
|
||||
* @return
|
||||
*/
|
||||
uint8_t Universe::status() const
|
||||
{
|
||||
return status_;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Universe::setStatus
|
||||
* @param val
|
||||
*/
|
||||
void Universe::setStatus(uint8_t val)
|
||||
{
|
||||
status_ = val;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Universe::setValue
|
||||
* @param address
|
||||
|
|
|
@ -72,6 +72,8 @@ class Universe {
|
|||
DMX_ACTIVE = 1, //!< actively sending/receiving data
|
||||
DMX_LOST = 2 //!< no activity in E111_DATA_LOSS_TIMEOUT
|
||||
};
|
||||
virtual uint8_t status() const;
|
||||
virtual void setStatus(uint8_t);
|
||||
|
||||
protected:
|
||||
DimmerData null_start_data; //!< NULL Start Code data
|
||||
|
@ -80,6 +82,8 @@ class Universe {
|
|||
std::vector<std::weak_ptr<DataHandler>> callbacks_; //!< list of calback functions
|
||||
void doDataCallbacks(); //!< execute valid callbacks
|
||||
|
||||
uint8_t status_; //!< the operating state of the universe
|
||||
|
||||
private:
|
||||
std::queue<std::chrono::time_point<std::chrono::system_clock>> rx_times_;
|
||||
|
||||
|
|
Loading…
Reference in New Issue