diff options
author | David Crocker <dcrocker@eschertech.com> | 2020-01-06 18:43:33 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2020-01-06 18:43:33 +0300 |
commit | c8ef10d29d38856353689f3b5934c8fb226787d9 (patch) | |
tree | 444a61581b4c49b2de46141112051891ec3f0201 /src/Networking/LwipEthernet | |
parent | 1d61e272e01727afa810f8aa5acedc051206772d (diff) |
Major refactoring of object model framework
Refactored object model framework to simplify the code
Started bringing the object model into line with DSF
Added echo command
Added line number constant
Diffstat (limited to 'src/Networking/LwipEthernet')
-rw-r--r-- | src/Networking/LwipEthernet/LwipEthernetInterface.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Networking/LwipEthernet/LwipEthernetInterface.cpp b/src/Networking/LwipEthernet/LwipEthernetInterface.cpp index aefc7580..16ad4a6c 100644 --- a/src/Networking/LwipEthernet/LwipEthernetInterface.cpp +++ b/src/Networking/LwipEthernet/LwipEthernetInterface.cpp @@ -106,18 +106,19 @@ LwipEthernetInterface::LwipEthernetInterface(Platform& p) noexcept : platform(p) // Otherwise the table will be allocated in RAM instead of flash, which wastes too much RAM. // Macro to build a standard lambda function that includes the necessary type conversions -#define OBJECT_MODEL_FUNC(_ret) OBJECT_MODEL_FUNC_BODY(LwipEthernetInterface, _ret) +#define OBJECT_MODEL_FUNC(...) OBJECT_MODEL_FUNC_BODY(LwipEthernetInterface, __VA_ARGS__) constexpr ObjectModelTableEntry LwipEthernetInterface::objectModelTable[] = { // These entries must be in alphabetical order - { "gateway", OBJECT_MODEL_FUNC(&(self->gateway)), TYPE_OF(IPAddress), 0, ObjectModelEntryFlags::none }, - { "ip", OBJECT_MODEL_FUNC(&(self->ipAddress)), TYPE_OF(IPAddress), 0, ObjectModelEntryFlags::none }, - { "name", OBJECT_MODEL_FUNC_NOSELF("ethernet"), TYPE_OF(const char *), 0, ObjectModelEntryFlags::none }, - { "netmask", OBJECT_MODEL_FUNC(&(self->netmask)), TYPE_OF(IPAddress), 0, ObjectModelEntryFlags::none }, + { "ActualIP", OBJECT_MODEL_FUNC(self->ipAddress), ObjectModelEntryFlags::none }, + { "FirmwareVersion", OBJECT_MODEL_FUNC_NOSELF(nullptr), ObjectModelEntryFlags::none }, + { "Gateway", OBJECT_MODEL_FUNC(self->gateway), ObjectModelEntryFlags::none }, + { "Subnet", OBJECT_MODEL_FUNC(self->netmask), ObjectModelEntryFlags::none }, + { "Type", OBJECT_MODEL_FUNC_NOSELF("ethernet"), ObjectModelEntryFlags::none }, }; -constexpr uint8_t LwipEthernetInterface::objectModelTableDescriptor[] = { 1, 4 }; +constexpr uint8_t LwipEthernetInterface::objectModelTableDescriptor[] = { 1, 5 }; DEFINE_GET_OBJECT_MODEL_TABLE(LwipEthernetInterface) |