diff options
author | David Crocker <dcrocker@eschertech.com> | 2020-01-26 23:56:03 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2020-01-26 23:56:03 +0300 |
commit | 79df4b88ed68875cd58ef4e1ec5ea22f9ab9d55e (patch) | |
tree | 701938eab5583381e5896116dec79e21cc278a82 /src/ObjectModel/ObjectModel.h | |
parent | 6e8f8223fd862eae27545ead596b52c5a6a46ca2 (diff) |
Refactored MAC address code
M540 on Duet WiFi now returns correct MAC address
MAC address added to object model
WiFi firmware version now returned correctly in object model
Diffstat (limited to 'src/ObjectModel/ObjectModel.h')
-rw-r--r-- | src/ObjectModel/ObjectModel.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ObjectModel/ObjectModel.h b/src/ObjectModel/ObjectModel.h index 9a18ffe6..54d007b6 100644 --- a/src/ObjectModel/ObjectModel.h +++ b/src/ObjectModel/ObjectModel.h @@ -16,6 +16,7 @@ #include <General/IPAddress.h> #include <General/Bitmap.h> #include <RTOSIface/RTOSIface.h> +#include <Networking/NetworkDefs.h> typedef uint8_t TypeCode; constexpr TypeCode NoType = 0; // code for an invalid or unknown type @@ -54,6 +55,7 @@ template<> constexpr TypeCode TypeOf<IPAddress> () noexcept { return 12; } template<> constexpr TypeCode TypeOf<const ObjectModelArrayDescriptor*> () noexcept { return 13; } template<> constexpr TypeCode TypeOf<DateTime> () noexcept { return 14; } template<> constexpr TypeCode TypeOf<DriverId> () noexcept { return 15; } +template<> constexpr TypeCode TypeOf<MacAddress> () noexcept { return 16; } #define TYPE_OF(_t) (TypeOf<_t>()) @@ -97,6 +99,7 @@ struct ExpressionValue explicit ExpressionValue(Bitmap<uint16_t> bm) noexcept : type(TYPE_OF(Bitmap<uint16_t>)), param(0), uVal(bm.GetRaw()) { } explicit ExpressionValue(Bitmap<uint32_t> bm) noexcept : type(TYPE_OF(Bitmap<uint32_t>)), param(0), uVal(bm.GetRaw()) { } explicit ExpressionValue(Bitmap<uint64_t> bm) noexcept : type(TYPE_OF(Bitmap<uint64_t>)), param(bm.GetRaw() >> 32), uVal((uint32_t)bm.GetRaw()) { } + explicit ExpressionValue(const MacAddress& mac) noexcept; void Set(bool b) noexcept { type = TYPE_OF(bool); bVal = b; } void Set(char c) noexcept { type = TYPE_OF(char); cVal = c; } |