add(plugin Chinese description):modbus-tcp,ekuiper,mqtt,nano-mqtt

This commit is contained in:
lixiumei123
2022-11-16 08:09:22 +00:00
parent ef536f6f99
commit d2b85071a1
10 changed files with 49 additions and 25 deletions
+1
View File
@@ -193,6 +193,7 @@ typedef struct neu_req_get_plugin {
typedef struct neu_resp_plugin_info {
char name[NEU_PLUGIN_NAME_LEN];
char description[NEU_PLUGIN_DESCRIPTION_LEN];
char description_zh[NEU_PLUGIN_DESCRIPTION_LEN];
char library[NEU_PLUGIN_LIBRARY_LEN];
neu_plugin_kind_e kind;
+1
View File
@@ -88,6 +88,7 @@ typedef struct neu_plugin_module {
const uint32_t version;
const char * module_name;
const char * module_descr;
const char * module_descr_zh;
const neu_plugin_intf_funs_t *intf_funs;
neu_node_type_e type;
neu_plugin_kind_e kind;
+10 -9
View File
@@ -194,13 +194,14 @@ static const neu_plugin_intf_funs_t plugin_intf_funs = {
};
const neu_plugin_module_t neu_plugin_module = {
.version = NEURON_PLUGIN_VER_1_0,
.module_name = "ekuiper",
.module_descr = "Neuron and LF Edge eKuiper integration plugin",
.intf_funs = &plugin_intf_funs,
.kind = NEU_PLUGIN_KIND_SYSTEM,
.type = NEU_NA_TYPE_APP,
.display = true,
.single = true,
.single_name = "data-stream-processing",
.version = NEURON_PLUGIN_VER_1_0,
.module_name = "ekuiper",
.module_descr = "Neuron and LF Edge eKuiper integration plugin",
.module_descr_zh = "Neuron 和 LF Edge eKuiper 一体化插件",
.intf_funs = &plugin_intf_funs,
.kind = NEU_PLUGIN_KIND_SYSTEM,
.type = NEU_NA_TYPE_APP,
.display = true,
.single = true,
.single_name = "data-stream-processing",
};
+1
View File
@@ -59,6 +59,7 @@ const neu_plugin_module_t neu_plugin_module = {
.module_name = "modbus-tcp",
.module_descr = "The modbus-tcp plugin is used for devices connected using "
"the modbus protocol tcp mode.",
.module_descr_zh = "modbus-tcp 插件用于连接使用 modbus tcp 协议的设备",
.intf_funs = &plugin_intf_funs,
.kind = NEU_PLUGIN_KIND_SYSTEM,
.type = NEU_NA_TYPE_DRIVER,
+3
View File
@@ -674,6 +674,9 @@ const neu_plugin_module_t neu_plugin_module = {
"by Neuron from the device can be transmitted to the MQTT Broker "
"through the MQTT application, and users can also send commands to "
"Neuron through the MQTT application.",
.module_descr_zh = "Neuron 北向应用 MQTT。Neuron "
"从设备端采集到的数据可以通过北向应用 MQTT 传送到 MQTT "
"Broker。用户也可以通过北向应用 MQTT 向 Neuron 发送指令",
.intf_funs = &plugin_intf_funs,
.kind = NEU_PLUGIN_KIND_SYSTEM,
.type = NEU_NA_TYPE_APP,
+11 -9
View File
@@ -345,15 +345,17 @@ static const neu_plugin_intf_funs_t plugin_intf_funs = {
};
#define DESCRIPTION "Neuron northbound MQTT plugin bases on NanoSDK."
#define DESCRIPTION_ZH "基于 NanoSDK 的 Neuron 北向应用 MQTT 插件"
const neu_plugin_module_t neu_plugin_module = {
.version = NEURON_PLUGIN_VER_1_0,
.module_name = "nano-mqtt",
.module_descr = DESCRIPTION,
.intf_funs = &plugin_intf_funs,
.kind = NEU_PLUGIN_KIND_SYSTEM,
.type = NEU_NA_TYPE_APP,
.sub_msg[0] = NEU_SUBSCRIBE_NODES_STATE,
.display = true,
.single = false,
.version = NEURON_PLUGIN_VER_1_0,
.module_name = "nano-mqtt",
.module_descr = DESCRIPTION,
.module_descr_zh = DESCRIPTION_ZH,
.intf_funs = &plugin_intf_funs,
.kind = NEU_PLUGIN_KIND_SYSTEM,
.type = NEU_NA_TYPE_APP,
.sub_msg[0] = NEU_SUBSCRIBE_NODES_STATE,
.display = true,
.single = false,
};
+2
View File
@@ -109,6 +109,8 @@ void handle_get_plugin_resp(nng_aio *aio, neu_resp_get_plugin_t *plugins)
plugin_res.plugin_libs[index].name = (char *) info->name;
plugin_res.plugin_libs[index].library = (char *) info->library;
plugin_res.plugin_libs[index].description = (char *) info->description;
plugin_res.plugin_libs[index].description_zh =
(char *) info->description_zh;
}
neu_json_encode_by_fn(&plugin_res, neu_json_encode_get_plugin_resp,
+14 -7
View File
@@ -37,6 +37,7 @@ typedef struct plugin_entity {
char *name;
char *lib_name;
char *description;
char *description_zh;
neu_plugin_kind_e kind;
neu_node_type_e type;
@@ -122,13 +123,14 @@ int neu_plugin_manager_add(neu_plugin_manager_t *mgr,
}
plugin = calloc(1, sizeof(plugin_entity_t));
plugin->display = pm->display;
plugin->type = pm->type;
plugin->kind = pm->kind;
plugin->name = strdup(pm->module_name);
plugin->lib_name = strdup(plugin_lib_name);
plugin->description = strdup(pm->module_descr);
plugin->single = pm->single;
plugin->display = pm->display;
plugin->type = pm->type;
plugin->kind = pm->kind;
plugin->name = strdup(pm->module_name);
plugin->lib_name = strdup(plugin_lib_name);
plugin->description = strdup(pm->module_descr);
plugin->description_zh = strdup(pm->module_descr_zh);
plugin->single = pm->single;
if (plugin->single) {
plugin->single_name = strdup(pm->single_name);
}
@@ -180,6 +182,8 @@ UT_array *neu_plugin_manager_get(neu_plugin_manager_t *mgr)
strncpy(info.name, el->name, sizeof(info.name));
strncpy(info.library, el->lib_name, sizeof(info.library));
strncpy(info.description, el->description, sizeof(info.description));
strncpy(info.description_zh, el->description_zh,
sizeof(info.description_zh));
utarray_push_back(plugins, &info);
}
@@ -211,6 +215,8 @@ UT_array *neu_plugin_manager_get_single(neu_plugin_manager_t *mgr)
strncpy(info.library, el->lib_name, sizeof(info.library));
strncpy(info.description, el->description,
sizeof(info.description));
strncpy(info.description_zh, el->description_zh,
sizeof(info.description_zh));
utarray_push_back(plugins, &info);
}
@@ -306,5 +312,6 @@ static void entity_free(plugin_entity_t *entity)
free(entity->name);
free(entity->lib_name);
free(entity->description);
free(entity->description_zh);
free(entity);
}
+5
View File
@@ -150,6 +150,11 @@ int neu_json_encode_get_plugin_resp(void *json_object, void *param)
.t = NEU_JSON_STR,
.v.val_str = p_plugin_lib->description,
},
{
.name = "description_zh",
.t = NEU_JSON_STR,
.v.val_str = p_plugin_lib->description_zh,
},
{
.name = "kind",
.t = NEU_JSON_INT,
+1
View File
@@ -51,6 +51,7 @@ typedef struct {
char * name;
char * library;
char * description;
char * description_zh;
int64_t kind;
int64_t node_type;
} neu_json_get_plugin_resp_plugin_lib_t;