From 682201626c9b64669e22005fe83ba255af9991d8 Mon Sep 17 00:00:00 2001 From: Ollo Date: Thu, 1 Apr 2021 18:15:10 +0200 Subject: [PATCH] Parse MQTT connect function --- simulation/src/de/c3ma/ollo/mockup/ESP8266Mqtt.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/simulation/src/de/c3ma/ollo/mockup/ESP8266Mqtt.java b/simulation/src/de/c3ma/ollo/mockup/ESP8266Mqtt.java index cbc752a..90233fb 100644 --- a/simulation/src/de/c3ma/ollo/mockup/ESP8266Mqtt.java +++ b/simulation/src/de/c3ma/ollo/mockup/ESP8266Mqtt.java @@ -107,8 +107,14 @@ private class ConnectMqtt extends VarArgFunction { public LuaValue invoke(Varargs varargs) { final LuaTable onMqtt = new LuaTable(); - if (varargs.narg() == 1) { - System.out.println("[MQTT] connect "); + if (varargs.narg() == 6) { + final LuaTable table = varargs.arg(1).checktable(); + final String targetIP = varargs.arg(2).toString().toString(); + final int portnumber = varargs.arg(3).toint(); + final boolean unkownParameter = varargs.arg(4).toboolean(); + final LuaValue codeOnConnected = varargs.arg(5); + final LuaValue codeOnFailed = varargs.arg(6); + System.out.println("[MQTT] connect to " + targetIP + ":" + portnumber); } else { for(int i=0; i <= varargs.narg(); i++) { System.err.println("[MQTT] connect ["+(i) + "] (" + varargs.arg(i).typename() + ") " + varargs.arg(i).toString() );