diff options
author | David Crocker <dcrocker@eschertech.com> | 2020-01-05 20:27:13 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2020-01-05 20:27:13 +0300 |
commit | 1d61e272e01727afa810f8aa5acedc051206772d (patch) | |
tree | abd0044c1ea8c1ada382fddf5f5723799bb7eb86 /src/Networking/LwipEthernet | |
parent | 4f1c0947b1a0680679d8e8468f3e2e47be2bfc44 (diff) |
Refactored object model to allow multiple tables per class
Diffstat (limited to 'src/Networking/LwipEthernet')
-rw-r--r-- | src/Networking/LwipEthernet/LwipEthernetInterface.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Networking/LwipEthernet/LwipEthernetInterface.cpp b/src/Networking/LwipEthernet/LwipEthernetInterface.cpp index 0a46d850..aefc7580 100644 --- a/src/Networking/LwipEthernet/LwipEthernetInterface.cpp +++ b/src/Networking/LwipEthernet/LwipEthernetInterface.cpp @@ -108,15 +108,17 @@ LwipEthernetInterface::LwipEthernetInterface(Platform& p) noexcept : platform(p) // Macro to build a standard lambda function that includes the necessary type conversions #define OBJECT_MODEL_FUNC(_ret) OBJECT_MODEL_FUNC_BODY(LwipEthernetInterface, _ret) -const ObjectModelTableEntry LwipEthernetInterface::objectModelTable[] = +constexpr ObjectModelTableEntry LwipEthernetInterface::objectModelTable[] = { // These entries must be in alphabetical order - { "gateway", OBJECT_MODEL_FUNC(&(self->gateway)), TYPE_OF(IPAddress), ObjectModelTableEntry::none }, - { "ip", OBJECT_MODEL_FUNC(&(self->ipAddress)), TYPE_OF(IPAddress), ObjectModelTableEntry::none }, - { "name", OBJECT_MODEL_FUNC_NOSELF("ethernet"), TYPE_OF(const char *), ObjectModelTableEntry::none }, - { "netmask", OBJECT_MODEL_FUNC(&(self->netmask)), TYPE_OF(IPAddress), ObjectModelTableEntry::none }, + { "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 }, }; +constexpr uint8_t LwipEthernetInterface::objectModelTableDescriptor[] = { 1, 4 }; + DEFINE_GET_OBJECT_MODEL_TABLE(LwipEthernetInterface) #endif |