From 1ecae48e295ce746d47e65488c1ea490a5a8f7bf Mon Sep 17 00:00:00 2001 From: Evgeny Kochetkov Date: Tue, 10 Jul 2018 19:14:00 +0300 Subject: [PATCH] fix(stdlib): remove leftover native implementation files of `connect` and `connect-manual` in xod-dev/w5500 --- .../xod-dev/w5500/connect-manual/patch.cpp | 51 ------------------- .../__lib__/xod-dev/w5500/connect/patch.cpp | 35 ------------- 2 files changed, 86 deletions(-) delete mode 100644 workspace/__lib__/xod-dev/w5500/connect-manual/patch.cpp delete mode 100644 workspace/__lib__/xod-dev/w5500/connect/patch.cpp diff --git a/workspace/__lib__/xod-dev/w5500/connect-manual/patch.cpp b/workspace/__lib__/xod-dev/w5500/connect-manual/patch.cpp deleted file mode 100644 index 072b1a6e..00000000 --- a/workspace/__lib__/xod-dev/w5500/connect-manual/patch.cpp +++ /dev/null @@ -1,51 +0,0 @@ -{{#global}} -#include -#include -{{/global}} - -struct State { -}; - -{{ GENERATED_CODE }} - -void evaluate(Context ctx) { - if (!isInputDirty(ctx)) - return; - - auto dev = getValue(ctx); - Ethernet.init(dev.cs); - ValueType::T inet; - - auto ip = IPAddress(getValue(ctx)); - auto dns = IPAddress(getValue(ctx)); - auto gateway = IPAddress(getValue(ctx)); - auto subnet = IPAddress(getValue(ctx)); - - // if no DNS was provided - if((uint32_t)dns == 0) { - // Assume the DNS server will be the machine on the same network as the local IP - // but with last octet being '1' - dns = ip; - dns[3] = 1; - } - - if((uint32_t)gateway == 0) { - gateway = ip; - gateway[3] = 1; - } - - if((uint32_t)subnet == 0) { - subnet = IPAddress(255,255,255,0); - } - -#if defined(WIZ550io_WITH_MACADDRESS) - Ethernet.begin(ip, dns, gateway, subnet); -#else - Ethernet.begin(dev.mac, ip, dns, gateway, subnet); -#endif - - inet.ip = (uint32_t)Ethernet.localIP(); - inet.isConnected = true; - emitValue(ctx, inet); - emitValue(ctx, 1); -} diff --git a/workspace/__lib__/xod-dev/w5500/connect/patch.cpp b/workspace/__lib__/xod-dev/w5500/connect/patch.cpp deleted file mode 100644 index 16c3e5ec..00000000 --- a/workspace/__lib__/xod-dev/w5500/connect/patch.cpp +++ /dev/null @@ -1,35 +0,0 @@ -{{#global}} -#include -#include -{{/global}} - -struct State { -}; - -{{ GENERATED_CODE }} - -void evaluate(Context ctx) { - if (!isInputDirty(ctx)) - return; - - auto dev = getValue(ctx); - - Ethernet.init(dev.cs); - ValueType::T inet; - -#if defined(WIZ550io_WITH_MACADDRESS) - if (Ethernet.begin() == 0) { -#else - if (Ethernet.begin(dev.mac) == 0) { -#endif - inet.ip = (uint32_t)0; - inet.isConnected = false; - emitValue(ctx, 1); - } else { - inet.ip = (uint32_t)Ethernet.localIP(); - inet.isConnected = true; - emitValue(ctx, 1); - } - - emitValue(ctx, inet); -}