EasyManuals Logo

Flexitron Webdyn SunPM User Manual

Flexitron Webdyn SunPM
214 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #175 background imageLoading...
Page #175 background image
contact@webdyn.com | webdyn.com
V2.05 subject to changes | Webdyn © by Flexitron Group
175
5.2.1.2 Example
Let’s start with the following script to illustrate the function invocation:
header = {
version = 1.1,
label = “Test”,
name = “test”
}
--[[
Test function
]]
function testFunction(parameters)
wd.log(“question is “ .. parameters.text)
local result = {
value = 42 = 42
}
return result
end
Command le for invoking the function:
[{
“rpcName”:”test.testFunction”,
“parameters”: {
“text”:”what is the answer ?”is the answer ?”
},
“callerId”:”3d9311ed-0076-4f28-ac59-a2debfa35b86”
}]
Result le obtained:
[{
“result”: {
“value”:42
},
“callerId”:”3d9311ed-0076-4f28-ac59-a2debfa35b86”
}]
5.2.2 MQTT command message
The WebdynSun PM can receive command messages in MQTT. Of course, for this an MQTT server must
be congured (See chapter 3.2.2.5.4: “MQTT”). In particular the topics of commands and results must
be informed. The WebdynSun PM subscribes to the command topic so that any message sent on it is
received and executed. The result of a command or function invocation is posted to the result topic.
The JSON format used for these messages is the JSON format described in chapter 5.2.1.1: “JSON format
of the command le”.
An MQTT message can contain only one command or result. Consequently, opening and closing
square brackets are not allowed.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Flexitron Webdyn SunPM and is the answer not in the manual?

Flexitron Webdyn SunPM Specifications

General IconGeneral
BrandFlexitron
ModelWebdyn SunPM
CategoryController
LanguageEnglish