From ca59cfdfe4faf08a3a4881c739d6a5e3aa59e034 Mon Sep 17 00:00:00 2001 From: fengzero Date: Thu, 31 Mar 2022 09:01:08 +0000 Subject: [PATCH] remove auto json --- docs/json-api/gen-api-parsers.sh | 15 ---- docs/json-api/neu_json_error.json | 5 -- docs/json-api/neu_json_group_config.json | 57 ------------ docs/json-api/neu_json_license.json | 18 ---- docs/json-api/neu_json_log.json | 9 -- docs/json-api/neu_json_node.json | 52 ----------- docs/json-api/neu_json_plugin.json | 22 ----- docs/json-api/neu_json_rw.json | 43 ---------- docs/json-api/neu_json_tag.json | 86 ------------------- docs/json-api/neu_json_tty.json | 8 -- docs/json-persistence/gen-persists-parser.sh | 12 --- docs/json-persistence/json_adapter.json | 52 ----------- docs/json-persistence/json_datatags.json | 46 ---------- docs/json-persistence/json_group_configs.json | 12 --- docs/json-persistence/json_plugin.json | 14 --- docs/json-persistence/json_subs.json | 70 --------------- 16 files changed, 521 deletions(-) delete mode 100755 docs/json-api/gen-api-parsers.sh delete mode 100644 docs/json-api/neu_json_error.json delete mode 100644 docs/json-api/neu_json_group_config.json delete mode 100644 docs/json-api/neu_json_license.json delete mode 100644 docs/json-api/neu_json_log.json delete mode 100644 docs/json-api/neu_json_node.json delete mode 100644 docs/json-api/neu_json_plugin.json delete mode 100644 docs/json-api/neu_json_rw.json delete mode 100644 docs/json-api/neu_json_tag.json delete mode 100644 docs/json-api/neu_json_tty.json delete mode 100755 docs/json-persistence/gen-persists-parser.sh delete mode 100644 docs/json-persistence/json_adapter.json delete mode 100644 docs/json-persistence/json_datatags.json delete mode 100644 docs/json-persistence/json_group_configs.json delete mode 100644 docs/json-persistence/json_plugin.json delete mode 100644 docs/json-persistence/json_subs.json diff --git a/docs/json-api/gen-api-parsers.sh b/docs/json-api/gen-api-parsers.sh deleted file mode 100755 index 3ea42808..00000000 --- a/docs/json-api/gen-api-parsers.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -source_dir=${outc_dir:-"../../src/parser"} -header_dir=${outh_dir:-"../../include/json"} - -json-autotype --clang --no-autounify --debug -t json_error ./neu_json_error.json -o neu_json_error.c -json-autotype --clang --no-autounify --debug -t json_group_config ./neu_json_group_config.json -o neu_json_group_config.c -json-autotype --clang --no-autounify --debug -t json_node ./neu_json_node.json -o neu_json_node.c -json-autotype --clang --no-autounify --debug -t json_plugin ./neu_json_plugin.json -o neu_json_plugin.c -json-autotype --clang --no-autounify --debug -t json_rw ./neu_json_rw.json -o neu_json_rw.c -json-autotype --clang --no-autounify --debug -t json_tag ./neu_json_tag.json -o neu_json_tag.c -json-autotype --clang --no-autounify --debug -t json_tty ./neu_json_tty.json -o neu_json_tty.c - -mv *.c ${source_dir}/ -mv *.h ${header_dir}/ diff --git a/docs/json-api/neu_json_error.json b/docs/json-api/neu_json_error.json deleted file mode 100644 index f33b06d1..00000000 --- a/docs/json-api/neu_json_error.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "error_resp": { - "error": 0 - } -} \ No newline at end of file diff --git a/docs/json-api/neu_json_group_config.json b/docs/json-api/neu_json_group_config.json deleted file mode 100644 index 0d253b47..00000000 --- a/docs/json-api/neu_json_group_config.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "add_group_config_req": { - "name": "modbus-tcp-config1", - "node_id": 1, - "interval": 10000 - }, - "del_group_config_req": { - "node_id": 1, - "name": "gconfig1" - }, - "update_group_config_req": { - "name": "modbus-tcp-config1", - "interval": 20000, - "node_id": 4 - }, - "get_group_config_req": { - "node_id": 1 - }, - "get_group_config_resp": { - "group_configs": [ - { - "name": "config_modbus_tcp_sample_2", - "interval": 2000, - "pipe_count": 1, - "tag_count": 0 - }, - { - "name": "gconfig1", - "interval": 10000, - "pipe_count": 0, - "tag_count": 0 - } - ] - }, - "subscribe_req": { - "src_node_id": 4, - "dst_node_id": 5, - "name": "gconfig1" - }, - "unsubscribe_req": { - "src_node_id": 4, - "dst_node_id": 5, - "name": "gconfig1" - }, - "get_subscribe_resp": { - "groups": [ - { - "node_id": 1, - "group_config_name": "g1name" - }, - { - "node_id": 2, - "group_config_name": "g2name" - } - ] - } -} \ No newline at end of file diff --git a/docs/json-api/neu_json_license.json b/docs/json-api/neu_json_license.json deleted file mode 100644 index d37ac59c..00000000 --- a/docs/json-api/neu_json_license.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "set_license_req": { - "license": "xxxxx" - }, - "get_license_resp": { - "error": 0, - "license_type": "trial", - "valid": true, - "valid_since": "2021-05-13 09:36:56", - "valid_until": "2022-05-13 09:36:56", - "max_nodes": 100, - "max_node_tags": 1000, - "enabled_plugins": [ - "modbus-plus-tcp", - "modbus-rtu" - ] - } -} diff --git a/docs/json-api/neu_json_log.json b/docs/json-api/neu_json_log.json deleted file mode 100644 index 9f63e4fd..00000000 --- a/docs/json-api/neu_json_log.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "get_log_resp": { - "error": 0, - "page_count": 1, - "rows": [ - "2022-02-11 15:30:57 WARN [neuron] src/main.c:90: recv sig: 2" - ] - } -} diff --git a/docs/json-api/neu_json_node.json b/docs/json-api/neu_json_node.json deleted file mode 100644 index 039f4856..00000000 --- a/docs/json-api/neu_json_node.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "add_node_req": { - "type": 1, - "name": "modbus-tcp-node", - "plugin_name": "modbus-plugin-tcp" - }, - "del_node_req": { - "id": 7 - }, - "update_node_req": { - "id": 1, - "name": "modbus-tcp-node" - }, - "get_nodes_req": { - "node_type": 1 - }, - "get_nodes_resp": { - "nodes": [ - { - "name": "sample-driver-adapter", - "id": 1, - "plugin_id": 1 - }, - { - "name": "modbus-tcp-adapter", - "id": 4, - "plugin_id": 2 - }, - { - "name": "opcua-adapter", - "id": 6, - "plugin_id": 3 - }, - { - "name": "modbus-tcp-test", - "id": 7, - "plugin_id": 4 - } - ] - }, - "node_setting_req": { - "node_id": 4 - }, - "get_node_state_resp": { - "running": 2, - "link": 1 - }, - "node_ctl_req": { - "id": 4, - "cmd": 0 - } -} \ No newline at end of file diff --git a/docs/json-api/neu_json_plugin.json b/docs/json-api/neu_json_plugin.json deleted file mode 100644 index 5364dea3..00000000 --- a/docs/json-api/neu_json_plugin.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "add_plugin_req": { - "lib_name": "plugin_name.so" - }, - "del_plugin_req": { - "id": 1 - }, - "get_plugin_req": { - "id": 1 - }, - "get_plugin_resp": { - "plugin_libs": [ - { - "id": 1, - "kind": 1, - "node_type": 1, - "name": "plugin_name", - "lib_name": "plugin_lib_name" - } - ] - } -} \ No newline at end of file diff --git a/docs/json-api/neu_json_rw.json b/docs/json-api/neu_json_rw.json deleted file mode 100644 index e460c6e5..00000000 --- a/docs/json-api/neu_json_rw.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "read_resp": { - "tags": [ - { - "id": 1, - "error": 2014, - "value": 123 - }, - { - "id": 2, - "error": 0, - "value": 2.2 - }, - { - "id": 3, - "error": 0, - "value": true - } - ] - }, - "write_req": { - "node_id": 4, - "group_config_name": "config_modbus_tcp_sample_2", - "tags": [ - { - "id": 1, - "value": "wrhello" - }, - { - "id": 2, - "value": 2.2 - }, - { - "id": 3, - "value": true - } - ] - }, - "read_req": { - "node_id": 4, - "group_config_name": "config_modbus_tcp_sample_2" - } -} \ No newline at end of file diff --git a/docs/json-api/neu_json_tag.json b/docs/json-api/neu_json_tag.json deleted file mode 100644 index 41830b85..00000000 --- a/docs/json-api/neu_json_tag.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "add_tags_req": { - "node_id": 4, - "group_config_name": "config_modbus_tcp_sample_2", - "tags": [ - { - "name": "tag1", - "address": "1!400001", - "attribute": 1, - "type": 4 - }, - { - "name": "tag2", - "address": "1!00001", - "attribute": 3, - "type": 14 - }, - { - "name": "tag3", - "address": "1!400009", - "attribute": 3, - "type": 11 - } - ] - }, - "get_tags_req": { - "node_id": 4, - "group_config_name": "config_modbus_tcp_sample_2" - }, - "get_tags_resp": { - "tags": [ - { - "name": "tag1", - "type": 4, - "address": "1!400001", - "attribute": 1, - "group_config_name": "config_modbus_tcp_sample_2", - "id": 1 - }, - { - "name": "tag2", - "type": 14, - "address": "1!00001", - "attribute": 3, - "group_config_name": "config_modbus_tcp_sample_2", - "id": 4 - }, - { - "name": "tag3", - "type": 11, - "address": "1!400009", - "attribute": 3, - "group_config_name": "config_modbus_tcp_sample_2", - "id": 5 - } - ] - }, - "update_tags_req": { - "node_id": 4, - "group_config_name": "test-group", - "tags": [ - { - "id": 4, - "name": "tag1", - "type": 6, - "attribute": 0, - "address": "1!400001" - }, - { - "id": 5, - "name": "tag2", - "type": 6, - "attribute": 0, - "address": "1!400002" - } - ] - }, - "del_tags_req": { - "group_config_name": "config_modbus_tcp_sample_2", - "node_id": 4, - "ids": [ - 4, - 5 - ] - } -} \ No newline at end of file diff --git a/docs/json-api/neu_json_tty.json b/docs/json-api/neu_json_tty.json deleted file mode 100644 index e77531f9..00000000 --- a/docs/json-api/neu_json_tty.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "get_tty_resp": { - "ttys": [ - "/dev/tty0", - "/dev/tty1" - ] - } -} \ No newline at end of file diff --git a/docs/json-persistence/gen-persists-parser.sh b/docs/json-persistence/gen-persists-parser.sh deleted file mode 100755 index b55ccf79..00000000 --- a/docs/json-persistence/gen-persists-parser.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -outdir=${outc_dir:-"../../src/persist/json"} - -json-autotype --clang --no-autounify --debug -t json_node ./json_adapter.json -o persist_json_adapter.c -json-autotype --clang --no-autounify --debug -t json_datatags ./json_datatags.json -o persist_json_datatags.c -json-autotype --clang --no-autounify --debug -t json_group_configs ./json_group_configs.json -o persist_json_group_configs.c -json-autotype --clang --no-autounify --debug -t json_plugin ./json_plugin.json -o persist_json_plugin.c -json-autotype --clang --no-autounify --debug -t json_subscriptions ./json_subs.json -o persist_json_subs.c - -find -iname \*.c |xargs sed -i 's/json\/persist/persist/g' -mv *.c *.h ${outdir}/ diff --git a/docs/json-persistence/json_adapter.json b/docs/json-persistence/json_adapter.json deleted file mode 100644 index 8b7dc16f..00000000 --- a/docs/json-persistence/json_adapter.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "node_req": { - "nodes": [ - { - "id": 1, - "state": 1, - "type": 1, - "name": "sample-driver-adapter", - "plugin_name": "sample-drv-plugin" - }, - { - "id": 2, - "state": 2, - "type": 5, - "name": "sample-app-adapter", - "plugin_name": "sample-app-plugin" - }, - { - "id": 3, - "state": 3, - "type": 3, - "name": "mqtt-adapter", - "plugin_name": "mqtt-plugin" - } - ] - }, - "node_resp": { - "nodes": [ - { - "id": 1, - "state": 1, - "type": 1, - "name": "sample-driver-adapter", - "plugin_name": "sample-drv-plugin" - }, - { - "id": 2, - "state": 2, - "type": 5, - "name": "sample-app-adapter", - "plugin_name": "sample-app-plugin" - }, - { - "id": 3, - "state": 3, - "type": 3, - "name": "mqtt-adapter", - "plugin_name": "mqtt-plugin" - } - ] - } -} \ No newline at end of file diff --git a/docs/json-persistence/json_datatags.json b/docs/json-persistence/json_datatags.json deleted file mode 100644 index 89bafa5e..00000000 --- a/docs/json-persistence/json_datatags.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "datatag_req": { - "tags": [ - { - "attribute": 1, - "type": 3, - "address": "1!400001", - "name": "modbus1" - }, - { - "attribute": 1, - "type": 4, - "address": "1!400002", - "name": "modbus2" - }, - { - "attribute": 1, - "type": 5, - "address": "2!Channel1.Device1.Tag00000001", - "name": "opcua1" - } - ] - }, - "datatag_resp": { - "tags": [ - { - "attribute": 1, - "type": 3, - "address": "1!400001", - "name": "modbus1" - }, - { - "attribute": 1, - "type": 4, - "address": "1!400002", - "name": "modbus2" - }, - { - "attribute": 1, - "type": 5, - "address": "2!Channel1.Device1.Tag00000001", - "name": "opcua1" - } - ] - } -} \ No newline at end of file diff --git a/docs/json-persistence/json_group_configs.json b/docs/json-persistence/json_group_configs.json deleted file mode 100644 index 4c7c8ed6..00000000 --- a/docs/json-persistence/json_group_configs.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "group_configs_req": { - "adapter_name": "modbus_tcp_adapter", - "group_config_name": "config_modbus_tcp_sample_2", - "read_interval": 2000 - }, - "group_configs_resp": { - "adapter_name": "modbus_tcp_adapter", - "group_config_name": "config_modbus_tcp_sample_2", - "read_interval": 2000 - } -} diff --git a/docs/json-persistence/json_plugin.json b/docs/json-persistence/json_plugin.json deleted file mode 100644 index 16389b35..00000000 --- a/docs/json-persistence/json_plugin.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "plugin_req": { - "plugins": [ - "libplugin-mqtt.so", - "libplugin-modbus-tcp.so" - ] - }, - "plugin_resp": { - "plugins": [ - "libplugin-mqtt.so", - "libplugin-modbus-tcp.so" - ] - } -} \ No newline at end of file diff --git a/docs/json-persistence/json_subs.json b/docs/json-persistence/json_subs.json deleted file mode 100644 index e7ae1bc8..00000000 --- a/docs/json-persistence/json_subs.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "subscriptions_req": { - "subscriptions": [ - { - "sub_adapter_name": "sample-app-adapter", - "group_config_name": "config_drv_sample", - "src_adapter_name": "sample-driver-adapter", - "read_interval": 2000 - }, - { - "sub_adapter_name": "sample-driver-adapter", - "group_config_name": "config_app_sample", - "src_adapter_name": "config_app_sample", - "read_interval": 2000 - }, - { - "sub_adapter_name": "mqtt-adapter", - "group_config_name": "config_mqtt_sample", - "src_adapter_name": "sample-driver-adapter", - "read_interval": 2000 - }, - { - "sub_adapter_name": "mqtt-adapter", - "group_config_name": "config_modbus_tcp_sample_2", - "src_adapter_name": "modbus_tcp_adapter", - "read_interval": 2000 - }, - { - "sub_adapter_name": "mqtt_adapter", - "group_config_name": "config_opcua_sample", - "src_adapter_name": "opcua-adapter", - "read_interval": 2000 - } - ] - }, - "subscriptions_resp": { - "subscriptions": [ - { - "sub_adapter_name": "sample-app-adapter", - "group_config_name": "config_drv_sample", - "src_adapter_name": "sample-driver-adapter", - "read_interval": 2000 - }, - { - "sub_adapter_name": "sample-driver-adapter", - "group_config_name": "config_app_sample", - "src_adapter_name": "config_app_sample", - "read_interval": 2000 - }, - { - "sub_adapter_name": "mqtt-adapter", - "group_config_name": "config_mqtt_sample", - "src_adapter_name": "sample-driver-adapter", - "read_interval": 2000 - }, - { - "sub_adapter_name": "mqtt-adapter", - "group_config_name": "config_modbus_tcp_sample_2", - "src_adapter_name": "modbbus_tcp_adapter", - "read_interval": 2000 - }, - { - "sub_adapter_name": "mqtt_adapter", - "group_config_name": "config_opcua_sample", - "src_adapter_name": "opcua-adapter", - "read_interval": 2000 - } - ] - } -} \ No newline at end of file