From 822a3130b502b2c42d5f6b87336a79ff823eb0bd Mon Sep 17 00:00:00 2001 From: Kevin Matz Date: Mon, 22 May 2023 09:13:03 -0400 Subject: [PATCH] devices must be aware of their DHCP status --- protocol/artistic/artnet/device.cpp | 13 +++++++++++++ protocol/artistic/artnet/device.h | 3 +++ 2 files changed, 16 insertions(+) diff --git a/protocol/artistic/artnet/device.cpp b/protocol/artistic/artnet/device.cpp index 57922fa..20853b6 100644 --- a/protocol/artistic/artnet/device.cpp +++ b/protocol/artistic/artnet/device.cpp @@ -511,6 +511,19 @@ ipAddress Device::broadcastIp() const } +/** + * @brief Device::deviceHasDHCP + * @return + * + * The default implimentation is to return false, as the default invalid IP is static. + * \note Platform aware device types must return their DHCP status. + */ +bool Device::deviceHasDHCP() const +{ + return false; +} + + /** * @brief Device::shortName * @return diff --git a/protocol/artistic/artnet/device.h b/protocol/artistic/artnet/device.h index 62bf212..febeb31 100644 --- a/protocol/artistic/artnet/device.h +++ b/protocol/artistic/artnet/device.h @@ -87,9 +87,12 @@ protected: virtual void txArtPollReply(std::shared_ptr = nullptr); virtual void txArtDiagData(); + // OSI layer 2 virtual std::array deviceMac() const; + // OSI layer 3 virtual ipAddress deviceIp() const; virtual ipAddress broadcastIp() const; + virtual bool deviceHasDHCP() const; private: std::weak_ptr, ipAddress)>> _sender;