iotkit-parent/data/init/pluginInfo.json

58 lines
3.3 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

[ {
"createDept" : null,
"createBy" : null,
"createTime" : 1708317062484,
"updateBy" : null,
"updateTime" : 1708317122265,
"id" : 516835985375301,
"pluginId" : "http-plugin",
"name" : "http插件",
"description" : "http示例插件配置参数端口(port)默认9081-初次使用,请重新上传",
"deployType" : "upload",
"file" : "http-plugin-1.0.1-repackage.jar",
"version" : "1.0.1",
"type" : null,
"protocol" : null,
"state" : "stopped",
"configSchema" : "[\n {\n \"id\": \"port\",\n \"name\": \"端口\",\n \"type\": \"number\",\n \"value\": 9081,\n \"desc\": \"http端口默认为9081\"\n },\n {\n \"id\": \"a\",\n \"name\": \"测试参数1\",\n \"type\": \"radio\",\n \"value\": 0,\n \"desc\": \"单选参数a\",\n \"options\": [\n {\n \"name\": \"值0\",\n \"value\": 0\n },\n {\n \"name\": \"值1\",\n \"value\": 11\n }\n ]\n }\n]",
"config" : null,
"script" : ""
}, {
"createDept" : null,
"createBy" : null,
"createTime" : 1708317067797,
"updateBy" : null,
"updateTime" : 1708317171964,
"id" : 516836007116869,
"pluginId" : "mqtt-plugin",
"name" : "mqtt插件",
"description" : "mqtt示例插件-初次使用,请重新上传",
"deployType" : "upload",
"file" : "mqtt-plugin-1.0.1-repackage.jar",
"version" : "1.0.1",
"type" : null,
"protocol" : null,
"state" : "stopped",
"configSchema" : "[\n {\n \"id\": \"port\",\n \"name\": \"端口\",\n \"type\": \"number\",\n \"value\": 1883,\n \"desc\": \"mqtt端口默认为1883\"\n }\n]",
"config" : null,
"script" : ""
}, {
"createDept" : null,
"createBy" : null,
"createTime" : 1708317072837,
"updateBy" : null,
"updateTime" : 1708317204758,
"id" : 516836027760709,
"pluginId" : "tcp-plugin",
"name" : "tcp插件",
"description" : "tcp示例插件-初次使用,请重新上传",
"deployType" : "upload",
"file" : "tcp-plugin-1.0.4-repackage.jar",
"version" : "1.0.4",
"type" : null,
"protocol" : null,
"state" : "stopped",
"configSchema" : "[\n {\n \"id\": \"host\",\n \"name\": \"绑定ip\",\n \"type\": \"text\",\n \"value\": \"127.0.0.1\",\n \"desc\": \"tcp绑定ip默认为127.0.0.1\"\n },\n {\n \"id\": \"port\",\n \"name\": \"端口\",\n \"type\": \"number\",\n \"value\": 6883,\n \"desc\": \"tcp端口默认为6883\"\n }\n]",
"config" : null,
"script" : "function hexToByte(hexString) {\n if (hexString.length % 2 !== 0) {\n throw new Error('Invalid hex string. String must have an even number of characters.');\n }\n\n let byteArray = [];\n for (let i = 0; i < hexString.length; i += 4) {\n byteArray.push(parseInt(hexString.substr(i, 4), 16));\n }\n\n return byteArray;\n}\nfunction byteToHex(bytes) {\n for (var hex = [], i = 0; i < bytes.length; i++) {\n hex.push((bytes[i] >>> 4).toString(16));\n hex.push((bytes[i] & 0xF).toString(16));\n }\n return hex.join(\"\");\n}\n\nthis.decode=function(data){\n hex=data.payload;\n const bytes=hexToByte(hex);\n return {\n \"rssi\":bytes[0],\n \"powerstate\":bytes[1]\n };\n}\n\nthis.encode=function(params){\n const hex=byteToHex([params.powerstate]);\n return hex;\n}"
} ]