diff --git a/.cproject b/.cproject
index 55e6828..32dc3ef 100644
--- a/.cproject
+++ b/.cproject
@@ -14,27 +14,28 @@
-
+
-
+
+
@@ -42,13 +43,13 @@
+
+
+
+
@@ -91,41 +96,42 @@
-
+
-
+
+
-
+
+
+
+
+
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..13566b8
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/.idea/deployment.xml b/.idea/deployment.xml
new file mode 100644
index 0000000..a5120ee
--- /dev/null
+++ b/.idea/deployment.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..53624c9
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/other.xml b/.idea/other.xml
new file mode 100644
index 0000000..8fe5a6c
--- /dev/null
+++ b/.idea/other.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.metadata/.lock b/.metadata/.lock
new file mode 100644
index 0000000..e69de29
diff --git a/.metadata/.log b/.metadata/.log
new file mode 100644
index 0000000..91e2b0a
--- /dev/null
+++ b/.metadata/.log
@@ -0,0 +1,1292 @@
+!SESSION 2024-04-25 11:26:26.165 -----------------------------------------------
+eclipse.buildId=4.24.0.I20220607-0700
+java.version=17.0.3
+java.vendor=Eclipse Adoptium
+BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=zh_CN
+Framework arguments: -product org.eclipse.epp.package.cpp.product
+Command-line arguments: -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.cpp.product
+
+!ENTRY org.eclipse.linuxtools.docker.editor.ls 4 0 2024-04-25 11:26:26.982
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.linuxtools.docker.editor.ls [823]
+ Unresolved requirement: Require-Bundle: org.eclipse.lsp4e; bundle-version="0.11.0"
+ -> Bundle-SymbolicName: org.eclipse.lsp4e; bundle-version="0.15.0.202211292024"; singleton:="true"
+ org.eclipse.lsp4e [843]
+ Unresolved requirement: Require-Bundle: org.eclipse.lsp4j; bundle-version="[0.19.0,0.20.0)"
+ -> Bundle-SymbolicName: org.eclipse.lsp4j; bundle-version="0.19.0.v20221118-0359"
+ org.eclipse.lsp4j [846]
+ Unresolved requirement: Import-Package: com.google.gson; version="[2.9.1,2.10.0)"
+ -> Export-Package: com.google.gson; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"; uses:="com.google.gson.internal,com.google.gson.reflect,com.google.gson.stream"
+ com.google.gson [620]
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.messages; version="[0.19.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.messages; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="org.eclipse.lsp4j.jsonrpc.validation"
+ org.eclipse.lsp4j.jsonrpc [848]
+ Unresolved requirement: Import-Package: com.google.gson.internal; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson.internal; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"; x-internal:="true"; uses:="com.google.gson,com.google.gson.reflect,com.google.gson.stream"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.1.v20230829-0012"; version="0.21.1"; uses:="com.google.gson,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages"
+ org.eclipse.lsp4j.jsonrpc [847]
+ Unresolved requirement: Import-Package: com.google.gson.annotations; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson.annotations; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.messages
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.messages; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="org.eclipse.lsp4j.jsonrpc.validation"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.json.adapters
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.json.adapters; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="com.google.gson,com.google.gson.reflect,com.google.gson.stream,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: com.google.gson; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"; uses:="com.google.gson.internal,com.google.gson.reflect,com.google.gson.stream"
+ Unresolved requirement: Import-Package: com.google.gson.stream; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson.stream; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: com.google.gson.reflect; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson.reflect; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.json
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.json; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.19.0.v20221118-0359"; version="0.19.0"; uses:="com.google.gson,org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.messages"
+ org.eclipse.lsp4j.jsonrpc [849]
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.json.adapters
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.json.adapters; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="com.google.gson,com.google.gson.reflect,com.google.gson.stream,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: com.google.gson; version="[2.9.1,2.10.0)"
+ -> Export-Package: com.google.gson; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"; uses:="com.google.gson.internal,com.google.gson.reflect,com.google.gson.stream"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.services
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.services; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.1.v20230829-0012"; version="0.21.1"; uses:="org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.json"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.1.v20230829-0012"; version="0.21.1"; uses:="com.google.gson,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: com.google.gson.annotations; version="[2.9.1,2.10.0)"
+ -> Export-Package: com.google.gson.annotations; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.messages
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.messages; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="org.eclipse.lsp4j.jsonrpc.validation"
+ Unresolved requirement: Import-Package: com.google.gson.reflect; version="[2.9.1,2.10.0)"
+ -> Export-Package: com.google.gson.reflect; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: com.google.gson.stream; version="[2.9.1,2.10.0)"
+ -> Export-Package: com.google.gson.stream; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.validation
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.validation; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.19.0.v20221118-0359"; version="0.19.0"; uses:="org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: com.google.gson; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"; uses:="com.google.gson.internal,com.google.gson.reflect,com.google.gson.stream"
+ Unresolved requirement: Import-Package: com.google.gson.stream; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson.stream; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.services
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.services; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.1.v20230829-0012"; version="0.21.1"; uses:="org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.json"
+ Unresolved requirement: Import-Package: com.google.gson.reflect; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson.reflect; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.json
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.json; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.19.0.v20221118-0359"; version="0.19.0"; uses:="com.google.gson,org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.validation
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.validation; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.19.0.v20221118-0359"; version="0.19.0"; uses:="org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: com.google.gson.annotations; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson.annotations; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.validation; version="[0.19.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.validation; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.19.0.v20221118-0359"; version="0.19.0"; uses:="org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.json.adapters; version="[0.19.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.json.adapters; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.19.0.v20221118-0359"; version="0.19.0"; uses:="com.google.gson,com.google.gson.reflect,com.google.gson.stream,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: com.google.common.base; version="[30.1.0,31.0.0)"
+ -> Export-Package: com.google.common.base; bundle-symbolic-name="com.google.guava"; bundle-version="30.1.0.v20210127-2300"; version="30.1.0"; uses:="com.google.errorprone.annotations,org.checkerframework.checker.nullness.qual"
+ com.google.guava [1027]
+ Unresolved requirement: Import-Package: com.google.errorprone.annotations; version="[3.0.0,4.0.0)"; resolution:="optional"
+ Unresolved requirement: Import-Package: com.google.errorprone.annotations.concurrent; version="[3.0.0,4.0.0)"; resolution:="optional"
+ Unresolved requirement: Import-Package: javax.crypto; version="[3.0.0,4.0.0)"; resolution:="optional"
+ Unresolved requirement: Import-Package: javax.crypto.spec; version="[3.0.0,4.0.0)"; resolution:="optional"
+ Unresolved requirement: Import-Package: org.checkerframework.checker.nullness.qual; version="[3.5.0,4.0.0)"; resolution:="optional"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j
+ -> Export-Package: org.eclipse.lsp4j; bundle-symbolic-name="org.eclipse.lsp4j"; bundle-version="0.14.0.v20220526-1518"; version="0.14.0.v20220526-1518"; uses:="com.google.gson.annotations,org.eclipse.lsp4j.adapters,org.eclipse.lsp4j.jsonrpc.messages,org.eclipse.lsp4j.jsonrpc.validation,org.eclipse.xtext.xbase.lib"
+ org.eclipse.lsp4j [1069]
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc; version="[0.14.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.1.v20230829-0012"; version="0.21.1"; uses:="com.google.gson,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: com.google.gson.reflect; version="[2.8.9,2.9.0)"
+ -> Export-Package: com.google.gson.reflect; bundle-symbolic-name="com.google.gson"; bundle-version="2.8.9.v20220111-1409"; version="2.8.9"
+ com.google.gson [1026]
+ Unresolved requirement: Import-Package: com.google.gson.internal.sql; version="[2.8.0,3.0.0)"
+ -> Export-Package: com.google.gson.internal.sql; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"; x-internal:="true"; uses:="com.google.gson,com.google.gson.internal.bind"
+ Unresolved requirement: Import-Package: com.google.gson.annotations; version="[2.8.0,3.0.0)"
+ -> Export-Package: com.google.gson.annotations; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: com.google.gson.reflect; version="[2.8.0,3.0.0)"
+ -> Export-Package: com.google.gson.reflect; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: com.google.gson.internal.reflect; version="[2.8.0,3.0.0)"
+ -> Export-Package: com.google.gson.internal.reflect; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"; x-internal:="true"; uses:="com.google.gson"
+ Unresolved requirement: Import-Package: com.google.gson.internal.bind.util; version="[2.8.0,3.0.0)"
+ -> Export-Package: com.google.gson.internal.bind.util; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"; x-internal:="true"
+ Unresolved requirement: Import-Package: com.google.gson.internal; version="[2.8.0,3.0.0)"
+ -> Export-Package: com.google.gson.internal; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"; x-internal:="true"; uses:="com.google.gson,com.google.gson.reflect,com.google.gson.stream"
+ Unresolved requirement: Import-Package: com.google.gson.stream; version="[2.8.9,2.9.0)"
+ -> Export-Package: com.google.gson.stream; bundle-symbolic-name="com.google.gson"; bundle-version="2.8.9.v20220111-1409"; version="2.8.9"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.json; version="[0.14.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.json; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.19.0.v20221118-0359"; version="0.19.0"; uses:="com.google.gson,org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.messages; version="[0.14.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.messages; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="org.eclipse.lsp4j.jsonrpc.validation"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.validation; version="[0.14.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.validation; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.19.0.v20221118-0359"; version="0.19.0"; uses:="org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.services; version="[0.14.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.services; bundle-symbolic-name="org.eclipse.lsp4j"; bundle-version="0.21.1.v20230829-0012"; version="0.21.1"; uses:="org.eclipse.lsp4j,org.eclipse.lsp4j.adapters,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages,org.eclipse.lsp4j.jsonrpc.services"
+ org.eclipse.lsp4j [844]
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.json.adapters; version="[0.21.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.json.adapters; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="com.google.gson,com.google.gson.reflect,com.google.gson.stream,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: com.google.gson.stream; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson.stream; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.util
+ -> Export-Package: org.eclipse.lsp4j.util; bundle-symbolic-name="org.eclipse.lsp4j"; bundle-version="0.19.0.v20221118-0359"; version="0.19.0"; uses:="org.eclipse.lsp4j"
+ Unresolved requirement: Import-Package: com.google.gson.annotations; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson.annotations; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: com.google.gson.reflect; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson.reflect; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.validation; version="[0.21.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.validation; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc; version="[0.21.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.1.v20230829-0012"; version="0.21.1"; uses:="com.google.gson,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j
+ -> Export-Package: org.eclipse.lsp4j; bundle-symbolic-name="org.eclipse.lsp4j"; bundle-version="0.14.0.v20220526-1518"; version="0.14.0.v20220526-1518"; uses:="com.google.gson.annotations,org.eclipse.lsp4j.adapters,org.eclipse.lsp4j.jsonrpc.messages,org.eclipse.lsp4j.jsonrpc.validation,org.eclipse.xtext.xbase.lib"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.json; version="[0.21.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.json; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.1.v20230829-0012"; version="0.21.1"; uses:="com.google.gson,org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: com.google.gson; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"; uses:="com.google.gson.internal,com.google.gson.reflect,com.google.gson.stream"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.adapters
+ -> Export-Package: org.eclipse.lsp4j.adapters; bundle-symbolic-name="org.eclipse.lsp4j"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="com.google.gson,com.google.gson.reflect,com.google.gson.stream,org.eclipse.lsp4j,org.eclipse.lsp4j.jsonrpc.messages"
+ org.eclipse.lsp4j [845]
+ Unresolved requirement: Import-Package: com.google.gson.annotations; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson.annotations; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: com.google.gson.reflect; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson.reflect; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc; version="[0.21.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.1.v20230829-0012"; version="0.21.1"; uses:="com.google.gson,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.json; version="[0.21.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.json; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.1.v20230829-0012"; version="0.21.1"; uses:="com.google.gson,org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: com.google.gson; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"; uses:="com.google.gson.internal,com.google.gson.reflect,com.google.gson.stream"
+ Unresolved requirement: Import-Package: com.google.gson.stream; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson.stream; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j
+ -> Export-Package: org.eclipse.lsp4j; bundle-symbolic-name="org.eclipse.lsp4j"; bundle-version="0.14.0.v20220526-1518"; version="0.14.0.v20220526-1518"; uses:="com.google.gson.annotations,org.eclipse.lsp4j.adapters,org.eclipse.lsp4j.jsonrpc.messages,org.eclipse.lsp4j.jsonrpc.validation,org.eclipse.xtext.xbase.lib"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.services
+ -> Export-Package: org.eclipse.lsp4j.services; bundle-symbolic-name="org.eclipse.lsp4j"; bundle-version="0.21.1.v20230829-0012"; version="0.21.1"; uses:="org.eclipse.lsp4j,org.eclipse.lsp4j.adapters,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages,org.eclipse.lsp4j.jsonrpc.services"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.validation; version="[0.21.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.validation; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.json.adapters; version="[0.21.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.json.adapters; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="com.google.gson,com.google.gson.reflect,com.google.gson.stream,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.messages; version="[0.21.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.messages; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="org.eclipse.lsp4j.jsonrpc.validation"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.util
+ -> Export-Package: org.eclipse.lsp4j.util; bundle-symbolic-name="org.eclipse.lsp4j"; bundle-version="0.19.0.v20221118-0359"; version="0.19.0"; uses:="org.eclipse.lsp4j"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.services; version="[0.21.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.services; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.json"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.messages; version="[0.21.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.messages; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="org.eclipse.lsp4j.jsonrpc.validation"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.services; version="[0.21.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.services; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.json"
+ Unresolved requirement: Import-Package: com.google.gson; version="[2.8.9,2.9.0)"
+ -> Export-Package: com.google.gson; bundle-symbolic-name="com.google.gson"; bundle-version="2.8.9.v20220111-1409"; version="2.8.9"; uses:="com.google.gson.internal,com.google.gson.reflect,com.google.gson.stream"
+ Unresolved requirement: Import-Package: com.google.common.base; version="[14.0.0,31.0.0)"
+ -> Export-Package: com.google.common.base; bundle-symbolic-name="com.google.guava"; bundle-version="30.1.0.v20210127-2300"; version="30.1.0"; uses:="com.google.errorprone.annotations,org.checkerframework.checker.nullness.qual"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.util; version="[0.14.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.util; bundle-symbolic-name="org.eclipse.lsp4j"; bundle-version="0.19.0.v20221118-0359"; version="0.19.0"; uses:="org.eclipse.lsp4j"
+ Unresolved requirement: Import-Package: org.eclipse.xtext.xbase.lib.util; version="[2.24.0,3.0.0)"
+ -> Export-Package: org.eclipse.xtext.xbase.lib.util; bundle-symbolic-name="org.eclipse.xtext.xbase.lib"; bundle-version="2.29.0.v20221121-0915"; version="2.29.0"
+ org.eclipse.xtext.xbase.lib [943]
+ Unresolved requirement: Require-Bundle: com.google.guava; bundle-version="[30.1.0,31.0.0)"; visibility:="reexport"
+ -> Bundle-SymbolicName: com.google.guava; bundle-version="30.1.0.v20210127-2300"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.services; version="[0.14.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.services; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.1.v20230829-0012"; version="0.21.1"; uses:="org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.json"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.adapters; version="[0.14.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.adapters; bundle-symbolic-name="org.eclipse.lsp4j"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="com.google.gson,com.google.gson.reflect,com.google.gson.stream,org.eclipse.lsp4j,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: com.google.gson.annotations; version="[2.8.9,2.9.0)"
+ -> Export-Package: com.google.gson.annotations; bundle-symbolic-name="com.google.gson"; bundle-version="2.8.9.v20220111-1409"; version="2.8.9"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.json.adapters; version="[0.14.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.json.adapters; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="com.google.gson,com.google.gson.reflect,com.google.gson.stream,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: org.eclipse.xtext.xbase.lib; version="[2.24.0,3.0.0)"
+ -> Export-Package: org.eclipse.xtext.xbase.lib; bundle-symbolic-name="org.eclipse.xtext.xbase.lib"; bundle-version="2.29.0.v20221121-0915"; version="2.29.0"
+ Unresolved requirement: Import-Package: com.google.gson.reflect; version="[2.9.1,2.10.0)"
+ -> Export-Package: com.google.gson.reflect; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc; version="[0.19.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.1.v20230829-0012"; version="0.21.1"; uses:="com.google.gson,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: com.google.gson.annotations; version="[2.9.1,2.10.0)"
+ -> Export-Package: com.google.gson.annotations; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.services; version="[0.19.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.services; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.json"
+ Unresolved requirement: Import-Package: org.eclipse.xtext.xbase.lib.util; version="[2.28.0,3.0.0)"
+ -> Export-Package: org.eclipse.xtext.xbase.lib.util; bundle-symbolic-name="org.eclipse.xtext.xbase.lib"; bundle-version="2.29.0.v20221121-0915"; version="2.29.0"
+ Unresolved requirement: Import-Package: com.google.gson.stream; version="[2.9.1,2.10.0)"
+ -> Export-Package: com.google.gson.stream; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.adapters
+ -> Export-Package: org.eclipse.lsp4j.adapters; bundle-symbolic-name="org.eclipse.lsp4j"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="com.google.gson,com.google.gson.reflect,com.google.gson.stream,org.eclipse.lsp4j,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.services
+ -> Export-Package: org.eclipse.lsp4j.services; bundle-symbolic-name="org.eclipse.lsp4j"; bundle-version="0.21.1.v20230829-0012"; version="0.21.1"; uses:="org.eclipse.lsp4j,org.eclipse.lsp4j.adapters,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages,org.eclipse.lsp4j.jsonrpc.services"
+ Unresolved requirement: Import-Package: org.eclipse.xtext.xbase.lib; version="[2.28.0,3.0.0)"
+ -> Export-Package: org.eclipse.xtext.xbase.lib; bundle-symbolic-name="org.eclipse.xtext.xbase.lib"; bundle-version="2.29.0.v20221121-0915"; version="2.29.0"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.json; version="[0.19.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.json; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.19.0.v20221118-0359"; version="0.19.0"; uses:="com.google.gson,org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Require-Bundle: org.eclipse.mylyn.wikitext; bundle-version="3.0.40"
+ -> Bundle-SymbolicName: org.eclipse.mylyn.wikitext; bundle-version="3.0.42.20220107230029"
+ org.eclipse.mylyn.wikitext [361]
+ Unresolved requirement: Import-Package: org.jsoup; version="[1.14.0,2.0.0)"
+ -> Export-Package: org.jsoup; bundle-symbolic-name="org.jsoup"; bundle-version="1.14.3.v20211012-1727"; version="1.14.3"; uses:="javax.annotation,javax.net.ssl,org.jsoup.nodes,org.jsoup.parser,org.jsoup.safety"
+ org.jsoup [1113]
+ Unresolved requirement: Import-Package: javax.annotation.meta; resolution:="optional"
+ Unresolved requirement: Import-Package: com.google.common.collect; version="[30.1.0,31.0.0)"
+ -> Export-Package: com.google.common.collect; bundle-symbolic-name="com.google.guava"; bundle-version="30.1.0.v20210127-2300"; version="30.1.0"; uses:="com.google.common.base,com.google.errorprone.annotations,org.checkerframework.checker.nullness.qual"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.builder
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.builder; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.builder.event,org.eclipse.mylyn.wikitext.parser.outline,org.eclipse.mylyn.wikitext.util"
+ org.eclipse.mylyn.wikitext [851]
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.builder.event
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.builder.event; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; uses:="org.eclipse.mylyn.wikitext.parser"
+ Unresolved requirement: Import-Package: com.google.common.base; version="[31.1.0,32.0.0)"
+ -> Export-Package: com.google.common.base; bundle-symbolic-name="com.google.guava"; bundle-version="31.1.0.jre"; version="31.1.0"; uses:="javax.annotation"
+ com.google.guava [623]
+ Unresolved requirement: Import-Package: javax.annotation; version="[3.0.0,4.0.0)"; resolution:="optional"
+ Unresolved requirement: Import-Package: com.google.common.xml; version="[31.1.0,32.0.0)"
+ -> Export-Package: com.google.common.xml; bundle-symbolic-name="com.google.guava"; bundle-version="31.1.0.jre"; version="31.1.0"; uses:="com.google.common.escape"
+ Unresolved requirement: Import-Package: org.jsoup; version="[1.15.0,2.0.0)"
+ -> Export-Package: org.jsoup; bundle-symbolic-name="org.jsoup"; bundle-version="1.15.3"; version="1.15.3"; uses:="javax.annotation,javax.net.ssl,org.jsoup.nodes,org.jsoup.parser,org.jsoup.safety"
+ org.jsoup [978]
+ Unresolved requirement: Import-Package: javax.annotation.meta; resolution:="optional"
+ Unresolved requirement: Import-Package: org.jsoup.internal
+ -> Export-Package: org.jsoup.internal; bundle-symbolic-name="org.jsoup"; bundle-version="1.14.3.v20211012-1727"; version="1.14.3"; x-internal:="true"; uses:="javax.annotation,javax.annotation.meta"
+ Unresolved requirement: Import-Package: org.jsoup
+ -> Export-Package: org.jsoup; bundle-symbolic-name="org.jsoup"; bundle-version="1.14.3.v20211012-1727"; version="1.14.3"; uses:="javax.annotation,javax.net.ssl,org.jsoup.nodes,org.jsoup.parser,org.jsoup.safety"
+ Unresolved requirement: Import-Package: org.jsoup.parser
+ -> Export-Package: org.jsoup.parser; bundle-symbolic-name="org.jsoup"; bundle-version="1.14.3.v20211012-1727"; version="1.14.3"; uses:="javax.annotation,org.jsoup.nodes"
+ Unresolved requirement: Import-Package: org.jsoup.helper
+ -> Export-Package: org.jsoup.helper; bundle-symbolic-name="org.jsoup"; bundle-version="1.14.3.v20211012-1727"; version="1.14.3"; uses:="javax.annotation,javax.net.ssl,javax.xml.parsers,org.jsoup,org.jsoup.nodes,org.jsoup.parser,org.jsoup.select,org.w3c.dom"
+ Unresolved requirement: Import-Package: org.jsoup.safety
+ -> Export-Package: org.jsoup.safety; bundle-symbolic-name="org.jsoup"; bundle-version="1.14.3.v20211012-1727"; version="1.14.3"; uses:="org.jsoup.nodes"
+ Unresolved requirement: Import-Package: org.jsoup.select
+ -> Export-Package: org.jsoup.select; bundle-symbolic-name="org.jsoup"; bundle-version="1.14.3.v20211012-1727"; version="1.14.3"; uses:="javax.annotation,org.jsoup.nodes"
+ Unresolved requirement: Import-Package: org.jsoup.select; version="[1.15.0,2.0.0)"
+ -> Export-Package: org.jsoup.select; bundle-symbolic-name="org.jsoup"; bundle-version="1.15.3"; version="1.15.3"; uses:="javax.annotation,org.jsoup.nodes"
+ Unresolved requirement: Import-Package: com.google.common.collect; version="[31.1.0,32.0.0)"
+ -> Export-Package: com.google.common.collect; bundle-symbolic-name="com.google.guava"; bundle-version="31.1.0.jre"; version="31.1.0"; uses:="com.google.common.base,javax.annotation"
+ Unresolved requirement: Import-Package: com.google.common.escape; version="[31.1.0,32.0.0)"
+ -> Export-Package: com.google.common.escape; bundle-symbolic-name="com.google.guava"; bundle-version="31.1.0.jre"; version="31.1.0"; uses:="com.google.common.base,javax.annotation"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.outline
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.outline; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.markup.block
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.markup.block; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; uses:="org.eclipse.mylyn.wikitext.parser.markup,org.eclipse.mylyn.wikitext.parser.outline"
+ Unresolved requirement: Import-Package: org.jsoup.nodes; version="[1.15.0,2.0.0)"
+ -> Export-Package: org.jsoup.nodes; bundle-symbolic-name="org.jsoup"; bundle-version="1.15.3"; version="1.15.3"; uses:="javax.annotation,org.jsoup,org.jsoup.helper,org.jsoup.parser,org.jsoup.select"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.internal.parser.html
+ -> Export-Package: org.eclipse.mylyn.wikitext.internal.parser.html; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; x-internal:="true"; uses:="org.eclipse.mylyn.wikitext.parser,org.jsoup.nodes,org.xml.sax"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.markup
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.markup; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.util"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.markup.token
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.markup.token; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; uses:="org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.jsoup.internal; version="[1.15.0,2.0.0)"
+ -> Export-Package: org.jsoup.internal; bundle-symbolic-name="org.jsoup"; bundle-version="1.15.3"; version="1.15.3"; uses:="javax.annotation,javax.annotation.meta"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.util
+ -> Export-Package: org.eclipse.mylyn.wikitext.util; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="javax.xml.stream,org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.markup,org.xml.sax"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.css
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.css; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.internal.util
+ -> Export-Package: org.eclipse.mylyn.wikitext.internal.util; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; x-internal:="true"
+ Unresolved requirement: Import-Package: org.jsoup.internal; version="[1.14.0,2.0.0)"
+ -> Export-Package: org.jsoup.internal; bundle-symbolic-name="org.jsoup"; bundle-version="1.14.3.v20211012-1727"; version="1.14.3"; x-internal:="true"; uses:="javax.annotation,javax.annotation.meta"
+ Unresolved requirement: Import-Package: org.jsoup.nodes; version="[1.14.0,2.0.0)"
+ -> Export-Package: org.jsoup.nodes; bundle-symbolic-name="org.jsoup"; bundle-version="1.15.3"; version="1.15.3"; uses:="javax.annotation,org.jsoup,org.jsoup.helper,org.jsoup.parser,org.jsoup.select"
+ Unresolved requirement: Import-Package: com.google.common.base; version="[30.1.0,31.0.0)"
+ -> Export-Package: com.google.common.base; bundle-symbolic-name="com.google.guava"; bundle-version="30.1.0.v20210127-2300"; version="30.1.0"; uses:="com.google.errorprone.annotations,org.checkerframework.checker.nullness.qual"
+ Unresolved requirement: Import-Package: com.google.common.xml; version="[30.1.0,31.0.0)"
+ -> Export-Package: com.google.common.xml; bundle-symbolic-name="com.google.guava"; bundle-version="30.1.0.v20210127-2300"; version="30.1.0"; uses:="com.google.common.escape"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.util
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.util; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser.markup,org.eclipse.mylyn.wikitext.parser.outline,org.eclipse.mylyn.wikitext.util"
+ Unresolved requirement: Import-Package: org.jsoup.select; version="[1.14.0,2.0.0)"
+ -> Export-Package: org.jsoup.select; bundle-symbolic-name="org.jsoup"; bundle-version="1.14.3.v20211012-1727"; version="1.14.3"; uses:="javax.annotation,org.jsoup.nodes"
+ Unresolved requirement: Import-Package: com.google.common.escape; version="[30.1.0,31.0.0)"
+ -> Export-Package: com.google.common.escape; bundle-symbolic-name="com.google.guava"; bundle-version="30.1.0.v20210127-2300"; version="30.1.0"; uses:="com.google.common.base,com.google.errorprone.annotations,org.checkerframework.checker.nullness.qual"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser.markup,org.xml.sax"
+ Unresolved requirement: Import-Package: com.google.common.base
+ -> Export-Package: com.google.common.base; bundle-symbolic-name="com.google.guava"; bundle-version="32.1.2.jre"; version="32.1.2"; uses:="javax.annotation"
+ com.google.guava [622]
+ Unresolved requirement: Import-Package: javax.annotation; version="[3.0.0,4.0.0)"; resolution:="optional"
+ Unresolved requirement: Require-Bundle: com.google.guava; bundle-version="30.1.0"
+ -> Bundle-SymbolicName: com.google.guava; bundle-version="32.1.2.jre"
+ Unresolved requirement: Require-Bundle: org.eclipse.mylyn.wikitext.markdown; bundle-version="3.0.40"
+ -> Bundle-SymbolicName: org.eclipse.mylyn.wikitext.markdown; bundle-version="3.0.42.20220107230029"
+ org.eclipse.mylyn.wikitext.markdown [369]
+ Unresolved requirement: Import-Package: com.google.common.collect; version="[30.1.0,31.0.0)"
+ -> Export-Package: com.google.common.collect; bundle-symbolic-name="com.google.guava"; bundle-version="30.1.0.v20210127-2300"; version="30.1.0"; uses:="com.google.common.base,com.google.errorprone.annotations,org.checkerframework.checker.nullness.qual"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.markup.phrase; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.markup.phrase; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.util; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.util; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="javax.xml.stream,org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.markup,org.xml.sax"
+ Unresolved requirement: Import-Package: com.google.common.base; version="[30.1.0,31.0.0)"
+ -> Export-Package: com.google.common.base; bundle-symbolic-name="com.google.guava"; bundle-version="30.1.0.v20210127-2300"; version="30.1.0"; uses:="com.google.errorprone.annotations,org.checkerframework.checker.nullness.qual"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.markdown
+ -> Export-Package: org.eclipse.mylyn.wikitext.markdown; bundle-symbolic-name="org.eclipse.mylyn.wikitext.markdown"; bundle-version="3.0.48.202308291007"; version="3.0.48"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.markup"
+ org.eclipse.mylyn.wikitext.markdown [860]
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.util; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.util; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="javax.xml.stream,org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.markup,org.xml.sax"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.builder; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.builder; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.builder.event,org.eclipse.mylyn.wikitext.parser.outline,org.eclipse.mylyn.wikitext.util"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.markup; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.markup; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.util"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.markdown.internal
+ -> Export-Package: org.eclipse.mylyn.wikitext.markdown.internal; bundle-symbolic-name="org.eclipse.mylyn.wikitext.markdown"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; x-internal:="true"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.builder,org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.markdown.internal.token
+ -> Export-Package: org.eclipse.mylyn.wikitext.markdown.internal.token; bundle-symbolic-name="org.eclipse.mylyn.wikitext.markdown"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; x-internal:="true"; uses:="org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.validation; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.validation; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: com.google.common.base; version="[31.1.0,33.0.0)"
+ -> Export-Package: com.google.common.base; bundle-symbolic-name="com.google.guava"; bundle-version="32.1.2.jre"; version="32.1.2"; uses:="javax.annotation"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.markup.phrase; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.markup.phrase; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser.markup,org.xml.sax"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.markup.token; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.markup.token; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; uses:="org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.markdown.internal.util
+ -> Export-Package: org.eclipse.mylyn.wikitext.markdown.internal.util; bundle-symbolic-name="org.eclipse.mylyn.wikitext.markdown"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; x-internal:="true"; uses:="org.eclipse.mylyn.wikitext.markdown.internal.block,org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.markdown.internal.phrase
+ -> Export-Package: org.eclipse.mylyn.wikitext.markdown.internal.phrase; bundle-symbolic-name="org.eclipse.mylyn.wikitext.markdown"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; x-internal:="true"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.markup,org.eclipse.mylyn.wikitext.parser.markup.token"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.markdown.internal.block
+ -> Export-Package: org.eclipse.mylyn.wikitext.markdown.internal.block; bundle-symbolic-name="org.eclipse.mylyn.wikitext.markdown"; bundle-version="3.0.46.202301111837"; version="3.0.46"; x-internal:="true"; uses:="org.eclipse.mylyn.wikitext.markdown.internal.util,org.eclipse.mylyn.wikitext.parser.markup"
+ org.eclipse.mylyn.wikitext.markdown [861]
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.markdown.internal
+ -> Export-Package: org.eclipse.mylyn.wikitext.markdown.internal; bundle-symbolic-name="org.eclipse.mylyn.wikitext.markdown"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; x-internal:="true"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.builder,org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.markdown.internal.token
+ -> Export-Package: org.eclipse.mylyn.wikitext.markdown.internal.token; bundle-symbolic-name="org.eclipse.mylyn.wikitext.markdown"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; x-internal:="true"; uses:="org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.markdown.internal.phrase
+ -> Export-Package: org.eclipse.mylyn.wikitext.markdown.internal.phrase; bundle-symbolic-name="org.eclipse.mylyn.wikitext.markdown"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; x-internal:="true"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.markup,org.eclipse.mylyn.wikitext.parser.markup.token"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.util; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.util; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="javax.xml.stream,org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.markup,org.xml.sax"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.markdown.internal.util
+ -> Export-Package: org.eclipse.mylyn.wikitext.markdown.internal.util; bundle-symbolic-name="org.eclipse.mylyn.wikitext.markdown"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; x-internal:="true"; uses:="org.eclipse.mylyn.wikitext.markdown.internal.block,org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.markdown
+ -> Export-Package: org.eclipse.mylyn.wikitext.markdown; bundle-symbolic-name="org.eclipse.mylyn.wikitext.markdown"; bundle-version="3.0.48.202308291007"; version="3.0.48"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: com.google.common.base; version="[31.1.0,32.0.0)"
+ -> Export-Package: com.google.common.base; bundle-symbolic-name="com.google.guava"; bundle-version="31.1.0.jre"; version="31.1.0"; uses:="javax.annotation"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.builder; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.builder; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.builder.event,org.eclipse.mylyn.wikitext.parser.outline,org.eclipse.mylyn.wikitext.util"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.markup.token; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.markup.token; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; uses:="org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser.markup,org.xml.sax"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.validation; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.validation; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.markup.phrase; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.markup.phrase; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.markup; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.markup; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.util"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.markdown.internal.block
+ -> Export-Package: org.eclipse.mylyn.wikitext.markdown.internal.block; bundle-symbolic-name="org.eclipse.mylyn.wikitext.markdown"; bundle-version="3.0.46.202301111837"; version="3.0.46"; x-internal:="true"; uses:="org.eclipse.mylyn.wikitext.markdown.internal.util,org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.markup; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.markup; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.util"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.markup.token; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.markup.token; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; uses:="org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.validation; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.validation; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser.markup,org.xml.sax"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.builder; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.builder; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.builder.event,org.eclipse.mylyn.wikitext.parser.outline,org.eclipse.mylyn.wikitext.util"
+ Unresolved requirement: Import-Package: com.google.gson; version="2.7.0"
+ -> Export-Package: com.google.gson; bundle-symbolic-name="com.google.gson"; bundle-version="2.8.9.v20220111-1409"; version="2.8.9"; uses:="com.google.gson.internal,com.google.gson.reflect,com.google.gson.stream"
+ Unresolved requirement: Require-Bundle: org.eclipse.lsp4j.jsonrpc; bundle-version="[0.19.0,0.20.0)"
+ -> Bundle-SymbolicName: org.eclipse.lsp4j.jsonrpc; bundle-version="0.19.0.v20221118-0359"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.lsp4e 4 0 2024-04-25 11:26:26.988
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.lsp4e [843]
+ Unresolved requirement: Require-Bundle: org.eclipse.lsp4j; bundle-version="[0.19.0,0.20.0)"
+ -> Bundle-SymbolicName: org.eclipse.lsp4j; bundle-version="0.19.0.v20221118-0359"
+ org.eclipse.lsp4j [846]
+ Unresolved requirement: Import-Package: com.google.gson; version="[2.9.1,2.10.0)"
+ -> Export-Package: com.google.gson; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"; uses:="com.google.gson.internal,com.google.gson.reflect,com.google.gson.stream"
+ com.google.gson [620]
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.messages; version="[0.19.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.messages; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="org.eclipse.lsp4j.jsonrpc.validation"
+ org.eclipse.lsp4j.jsonrpc [848]
+ Unresolved requirement: Import-Package: com.google.gson.internal; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson.internal; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"; x-internal:="true"; uses:="com.google.gson,com.google.gson.reflect,com.google.gson.stream"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.1.v20230829-0012"; version="0.21.1"; uses:="com.google.gson,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages"
+ org.eclipse.lsp4j.jsonrpc [847]
+ Unresolved requirement: Import-Package: com.google.gson.annotations; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson.annotations; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.messages
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.messages; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="org.eclipse.lsp4j.jsonrpc.validation"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.json.adapters
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.json.adapters; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="com.google.gson,com.google.gson.reflect,com.google.gson.stream,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: com.google.gson; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"; uses:="com.google.gson.internal,com.google.gson.reflect,com.google.gson.stream"
+ Unresolved requirement: Import-Package: com.google.gson.stream; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson.stream; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: com.google.gson.reflect; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson.reflect; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.json
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.json; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.19.0.v20221118-0359"; version="0.19.0"; uses:="com.google.gson,org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.messages"
+ org.eclipse.lsp4j.jsonrpc [849]
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.json.adapters
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.json.adapters; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="com.google.gson,com.google.gson.reflect,com.google.gson.stream,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: com.google.gson; version="[2.9.1,2.10.0)"
+ -> Export-Package: com.google.gson; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"; uses:="com.google.gson.internal,com.google.gson.reflect,com.google.gson.stream"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.services
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.services; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.1.v20230829-0012"; version="0.21.1"; uses:="org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.json"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.1.v20230829-0012"; version="0.21.1"; uses:="com.google.gson,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: com.google.gson.annotations; version="[2.9.1,2.10.0)"
+ -> Export-Package: com.google.gson.annotations; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.messages
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.messages; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="org.eclipse.lsp4j.jsonrpc.validation"
+ Unresolved requirement: Import-Package: com.google.gson.reflect; version="[2.9.1,2.10.0)"
+ -> Export-Package: com.google.gson.reflect; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: com.google.gson.stream; version="[2.9.1,2.10.0)"
+ -> Export-Package: com.google.gson.stream; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.validation
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.validation; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.19.0.v20221118-0359"; version="0.19.0"; uses:="org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: com.google.gson; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"; uses:="com.google.gson.internal,com.google.gson.reflect,com.google.gson.stream"
+ Unresolved requirement: Import-Package: com.google.gson.stream; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson.stream; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.services
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.services; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.1.v20230829-0012"; version="0.21.1"; uses:="org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.json"
+ Unresolved requirement: Import-Package: com.google.gson.reflect; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson.reflect; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.json
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.json; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.19.0.v20221118-0359"; version="0.19.0"; uses:="com.google.gson,org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.validation
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.validation; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.19.0.v20221118-0359"; version="0.19.0"; uses:="org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: com.google.gson.annotations; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson.annotations; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.validation; version="[0.19.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.validation; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.19.0.v20221118-0359"; version="0.19.0"; uses:="org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.json.adapters; version="[0.19.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.json.adapters; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.19.0.v20221118-0359"; version="0.19.0"; uses:="com.google.gson,com.google.gson.reflect,com.google.gson.stream,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: com.google.common.base; version="[30.1.0,31.0.0)"
+ -> Export-Package: com.google.common.base; bundle-symbolic-name="com.google.guava"; bundle-version="30.1.0.v20210127-2300"; version="30.1.0"; uses:="com.google.errorprone.annotations,org.checkerframework.checker.nullness.qual"
+ com.google.guava [1027]
+ Unresolved requirement: Import-Package: com.google.errorprone.annotations; version="[3.0.0,4.0.0)"; resolution:="optional"
+ Unresolved requirement: Import-Package: com.google.errorprone.annotations.concurrent; version="[3.0.0,4.0.0)"; resolution:="optional"
+ Unresolved requirement: Import-Package: javax.crypto; version="[3.0.0,4.0.0)"; resolution:="optional"
+ Unresolved requirement: Import-Package: javax.crypto.spec; version="[3.0.0,4.0.0)"; resolution:="optional"
+ Unresolved requirement: Import-Package: org.checkerframework.checker.nullness.qual; version="[3.5.0,4.0.0)"; resolution:="optional"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j
+ -> Export-Package: org.eclipse.lsp4j; bundle-symbolic-name="org.eclipse.lsp4j"; bundle-version="0.14.0.v20220526-1518"; version="0.14.0.v20220526-1518"; uses:="com.google.gson.annotations,org.eclipse.lsp4j.adapters,org.eclipse.lsp4j.jsonrpc.messages,org.eclipse.lsp4j.jsonrpc.validation,org.eclipse.xtext.xbase.lib"
+ org.eclipse.lsp4j [1069]
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc; version="[0.14.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.1.v20230829-0012"; version="0.21.1"; uses:="com.google.gson,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: com.google.gson.reflect; version="[2.8.9,2.9.0)"
+ -> Export-Package: com.google.gson.reflect; bundle-symbolic-name="com.google.gson"; bundle-version="2.8.9.v20220111-1409"; version="2.8.9"
+ com.google.gson [1026]
+ Unresolved requirement: Import-Package: com.google.gson.internal.sql; version="[2.8.0,3.0.0)"
+ -> Export-Package: com.google.gson.internal.sql; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"; x-internal:="true"; uses:="com.google.gson,com.google.gson.internal.bind"
+ Unresolved requirement: Import-Package: com.google.gson.annotations; version="[2.8.0,3.0.0)"
+ -> Export-Package: com.google.gson.annotations; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: com.google.gson.reflect; version="[2.8.0,3.0.0)"
+ -> Export-Package: com.google.gson.reflect; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: com.google.gson.internal.reflect; version="[2.8.0,3.0.0)"
+ -> Export-Package: com.google.gson.internal.reflect; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"; x-internal:="true"; uses:="com.google.gson"
+ Unresolved requirement: Import-Package: com.google.gson.internal.bind.util; version="[2.8.0,3.0.0)"
+ -> Export-Package: com.google.gson.internal.bind.util; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"; x-internal:="true"
+ Unresolved requirement: Import-Package: com.google.gson.internal; version="[2.8.0,3.0.0)"
+ -> Export-Package: com.google.gson.internal; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"; x-internal:="true"; uses:="com.google.gson,com.google.gson.reflect,com.google.gson.stream"
+ Unresolved requirement: Import-Package: com.google.gson.stream; version="[2.8.9,2.9.0)"
+ -> Export-Package: com.google.gson.stream; bundle-symbolic-name="com.google.gson"; bundle-version="2.8.9.v20220111-1409"; version="2.8.9"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.json; version="[0.14.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.json; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.19.0.v20221118-0359"; version="0.19.0"; uses:="com.google.gson,org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.messages; version="[0.14.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.messages; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="org.eclipse.lsp4j.jsonrpc.validation"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.validation; version="[0.14.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.validation; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.19.0.v20221118-0359"; version="0.19.0"; uses:="org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.services; version="[0.14.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.services; bundle-symbolic-name="org.eclipse.lsp4j"; bundle-version="0.21.1.v20230829-0012"; version="0.21.1"; uses:="org.eclipse.lsp4j,org.eclipse.lsp4j.adapters,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages,org.eclipse.lsp4j.jsonrpc.services"
+ org.eclipse.lsp4j [844]
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.json.adapters; version="[0.21.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.json.adapters; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="com.google.gson,com.google.gson.reflect,com.google.gson.stream,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: com.google.gson.stream; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson.stream; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.util
+ -> Export-Package: org.eclipse.lsp4j.util; bundle-symbolic-name="org.eclipse.lsp4j"; bundle-version="0.19.0.v20221118-0359"; version="0.19.0"; uses:="org.eclipse.lsp4j"
+ Unresolved requirement: Import-Package: com.google.gson.annotations; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson.annotations; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: com.google.gson.reflect; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson.reflect; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.validation; version="[0.21.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.validation; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc; version="[0.21.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.1.v20230829-0012"; version="0.21.1"; uses:="com.google.gson,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j
+ -> Export-Package: org.eclipse.lsp4j; bundle-symbolic-name="org.eclipse.lsp4j"; bundle-version="0.14.0.v20220526-1518"; version="0.14.0.v20220526-1518"; uses:="com.google.gson.annotations,org.eclipse.lsp4j.adapters,org.eclipse.lsp4j.jsonrpc.messages,org.eclipse.lsp4j.jsonrpc.validation,org.eclipse.xtext.xbase.lib"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.json; version="[0.21.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.json; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.1.v20230829-0012"; version="0.21.1"; uses:="com.google.gson,org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: com.google.gson; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"; uses:="com.google.gson.internal,com.google.gson.reflect,com.google.gson.stream"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.adapters
+ -> Export-Package: org.eclipse.lsp4j.adapters; bundle-symbolic-name="org.eclipse.lsp4j"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="com.google.gson,com.google.gson.reflect,com.google.gson.stream,org.eclipse.lsp4j,org.eclipse.lsp4j.jsonrpc.messages"
+ org.eclipse.lsp4j [845]
+ Unresolved requirement: Import-Package: com.google.gson.annotations; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson.annotations; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: com.google.gson.reflect; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson.reflect; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc; version="[0.21.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.1.v20230829-0012"; version="0.21.1"; uses:="com.google.gson,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.json; version="[0.21.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.json; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.1.v20230829-0012"; version="0.21.1"; uses:="com.google.gson,org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: com.google.gson; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"; uses:="com.google.gson.internal,com.google.gson.reflect,com.google.gson.stream"
+ Unresolved requirement: Import-Package: com.google.gson.stream; version="[2.9.1,2.11.0)"
+ -> Export-Package: com.google.gson.stream; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j
+ -> Export-Package: org.eclipse.lsp4j; bundle-symbolic-name="org.eclipse.lsp4j"; bundle-version="0.14.0.v20220526-1518"; version="0.14.0.v20220526-1518"; uses:="com.google.gson.annotations,org.eclipse.lsp4j.adapters,org.eclipse.lsp4j.jsonrpc.messages,org.eclipse.lsp4j.jsonrpc.validation,org.eclipse.xtext.xbase.lib"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.services
+ -> Export-Package: org.eclipse.lsp4j.services; bundle-symbolic-name="org.eclipse.lsp4j"; bundle-version="0.21.1.v20230829-0012"; version="0.21.1"; uses:="org.eclipse.lsp4j,org.eclipse.lsp4j.adapters,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages,org.eclipse.lsp4j.jsonrpc.services"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.validation; version="[0.21.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.validation; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.json.adapters; version="[0.21.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.json.adapters; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="com.google.gson,com.google.gson.reflect,com.google.gson.stream,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.messages; version="[0.21.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.messages; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="org.eclipse.lsp4j.jsonrpc.validation"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.util
+ -> Export-Package: org.eclipse.lsp4j.util; bundle-symbolic-name="org.eclipse.lsp4j"; bundle-version="0.19.0.v20221118-0359"; version="0.19.0"; uses:="org.eclipse.lsp4j"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.services; version="[0.21.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.services; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.json"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.messages; version="[0.21.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.messages; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="org.eclipse.lsp4j.jsonrpc.validation"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.services; version="[0.21.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.services; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.json"
+ Unresolved requirement: Import-Package: com.google.gson; version="[2.8.9,2.9.0)"
+ -> Export-Package: com.google.gson; bundle-symbolic-name="com.google.gson"; bundle-version="2.8.9.v20220111-1409"; version="2.8.9"; uses:="com.google.gson.internal,com.google.gson.reflect,com.google.gson.stream"
+ Unresolved requirement: Import-Package: com.google.common.base; version="[14.0.0,31.0.0)"
+ -> Export-Package: com.google.common.base; bundle-symbolic-name="com.google.guava"; bundle-version="30.1.0.v20210127-2300"; version="30.1.0"; uses:="com.google.errorprone.annotations,org.checkerframework.checker.nullness.qual"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.util; version="[0.14.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.util; bundle-symbolic-name="org.eclipse.lsp4j"; bundle-version="0.19.0.v20221118-0359"; version="0.19.0"; uses:="org.eclipse.lsp4j"
+ Unresolved requirement: Import-Package: org.eclipse.xtext.xbase.lib.util; version="[2.24.0,3.0.0)"
+ -> Export-Package: org.eclipse.xtext.xbase.lib.util; bundle-symbolic-name="org.eclipse.xtext.xbase.lib"; bundle-version="2.29.0.v20221121-0915"; version="2.29.0"
+ org.eclipse.xtext.xbase.lib [943]
+ Unresolved requirement: Require-Bundle: com.google.guava; bundle-version="[30.1.0,31.0.0)"; visibility:="reexport"
+ -> Bundle-SymbolicName: com.google.guava; bundle-version="30.1.0.v20210127-2300"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.services; version="[0.14.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.services; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.1.v20230829-0012"; version="0.21.1"; uses:="org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.json"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.adapters; version="[0.14.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.adapters; bundle-symbolic-name="org.eclipse.lsp4j"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="com.google.gson,com.google.gson.reflect,com.google.gson.stream,org.eclipse.lsp4j,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: com.google.gson.annotations; version="[2.8.9,2.9.0)"
+ -> Export-Package: com.google.gson.annotations; bundle-symbolic-name="com.google.gson"; bundle-version="2.8.9.v20220111-1409"; version="2.8.9"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.json.adapters; version="[0.14.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.json.adapters; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="com.google.gson,com.google.gson.reflect,com.google.gson.stream,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: org.eclipse.xtext.xbase.lib; version="[2.24.0,3.0.0)"
+ -> Export-Package: org.eclipse.xtext.xbase.lib; bundle-symbolic-name="org.eclipse.xtext.xbase.lib"; bundle-version="2.29.0.v20221121-0915"; version="2.29.0"
+ Unresolved requirement: Import-Package: com.google.gson.reflect; version="[2.9.1,2.10.0)"
+ -> Export-Package: com.google.gson.reflect; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc; version="[0.19.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.1.v20230829-0012"; version="0.21.1"; uses:="com.google.gson,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: com.google.gson.annotations; version="[2.9.1,2.10.0)"
+ -> Export-Package: com.google.gson.annotations; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.services; version="[0.19.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.services; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.json"
+ Unresolved requirement: Import-Package: org.eclipse.xtext.xbase.lib.util; version="[2.28.0,3.0.0)"
+ -> Export-Package: org.eclipse.xtext.xbase.lib.util; bundle-symbolic-name="org.eclipse.xtext.xbase.lib"; bundle-version="2.29.0.v20221121-0915"; version="2.29.0"
+ Unresolved requirement: Import-Package: com.google.gson.stream; version="[2.9.1,2.10.0)"
+ -> Export-Package: com.google.gson.stream; bundle-symbolic-name="com.google.gson"; bundle-version="2.9.1.v20220915-1632"; version="2.9.1"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.adapters
+ -> Export-Package: org.eclipse.lsp4j.adapters; bundle-symbolic-name="org.eclipse.lsp4j"; bundle-version="0.21.0.v20230517-2120"; version="0.21.0"; uses:="com.google.gson,com.google.gson.reflect,com.google.gson.stream,org.eclipse.lsp4j,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.services
+ -> Export-Package: org.eclipse.lsp4j.services; bundle-symbolic-name="org.eclipse.lsp4j"; bundle-version="0.21.1.v20230829-0012"; version="0.21.1"; uses:="org.eclipse.lsp4j,org.eclipse.lsp4j.adapters,org.eclipse.lsp4j.jsonrpc.json,org.eclipse.lsp4j.jsonrpc.messages,org.eclipse.lsp4j.jsonrpc.services"
+ Unresolved requirement: Import-Package: org.eclipse.xtext.xbase.lib; version="[2.28.0,3.0.0)"
+ -> Export-Package: org.eclipse.xtext.xbase.lib; bundle-symbolic-name="org.eclipse.xtext.xbase.lib"; bundle-version="2.29.0.v20221121-0915"; version="2.29.0"
+ Unresolved requirement: Import-Package: org.eclipse.lsp4j.jsonrpc.json; version="[0.19.0,1.0.0)"
+ -> Export-Package: org.eclipse.lsp4j.jsonrpc.json; bundle-symbolic-name="org.eclipse.lsp4j.jsonrpc"; bundle-version="0.19.0.v20221118-0359"; version="0.19.0"; uses:="com.google.gson,org.eclipse.lsp4j.jsonrpc,org.eclipse.lsp4j.jsonrpc.messages"
+ Unresolved requirement: Require-Bundle: org.eclipse.mylyn.wikitext; bundle-version="3.0.40"
+ -> Bundle-SymbolicName: org.eclipse.mylyn.wikitext; bundle-version="3.0.42.20220107230029"
+ org.eclipse.mylyn.wikitext [361]
+ Unresolved requirement: Import-Package: org.jsoup; version="[1.14.0,2.0.0)"
+ -> Export-Package: org.jsoup; bundle-symbolic-name="org.jsoup"; bundle-version="1.14.3.v20211012-1727"; version="1.14.3"; uses:="javax.annotation,javax.net.ssl,org.jsoup.nodes,org.jsoup.parser,org.jsoup.safety"
+ org.jsoup [1113]
+ Unresolved requirement: Import-Package: javax.annotation.meta; resolution:="optional"
+ Unresolved requirement: Import-Package: com.google.common.collect; version="[30.1.0,31.0.0)"
+ -> Export-Package: com.google.common.collect; bundle-symbolic-name="com.google.guava"; bundle-version="30.1.0.v20210127-2300"; version="30.1.0"; uses:="com.google.common.base,com.google.errorprone.annotations,org.checkerframework.checker.nullness.qual"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.builder
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.builder; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.builder.event,org.eclipse.mylyn.wikitext.parser.outline,org.eclipse.mylyn.wikitext.util"
+ org.eclipse.mylyn.wikitext [851]
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.builder.event
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.builder.event; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; uses:="org.eclipse.mylyn.wikitext.parser"
+ Unresolved requirement: Import-Package: com.google.common.base; version="[31.1.0,32.0.0)"
+ -> Export-Package: com.google.common.base; bundle-symbolic-name="com.google.guava"; bundle-version="31.1.0.jre"; version="31.1.0"; uses:="javax.annotation"
+ com.google.guava [623]
+ Unresolved requirement: Import-Package: javax.annotation; version="[3.0.0,4.0.0)"; resolution:="optional"
+ Unresolved requirement: Import-Package: com.google.common.xml; version="[31.1.0,32.0.0)"
+ -> Export-Package: com.google.common.xml; bundle-symbolic-name="com.google.guava"; bundle-version="31.1.0.jre"; version="31.1.0"; uses:="com.google.common.escape"
+ Unresolved requirement: Import-Package: org.jsoup; version="[1.15.0,2.0.0)"
+ -> Export-Package: org.jsoup; bundle-symbolic-name="org.jsoup"; bundle-version="1.15.3"; version="1.15.3"; uses:="javax.annotation,javax.net.ssl,org.jsoup.nodes,org.jsoup.parser,org.jsoup.safety"
+ org.jsoup [978]
+ Unresolved requirement: Import-Package: javax.annotation.meta; resolution:="optional"
+ Unresolved requirement: Import-Package: org.jsoup.internal
+ -> Export-Package: org.jsoup.internal; bundle-symbolic-name="org.jsoup"; bundle-version="1.14.3.v20211012-1727"; version="1.14.3"; x-internal:="true"; uses:="javax.annotation,javax.annotation.meta"
+ Unresolved requirement: Import-Package: org.jsoup
+ -> Export-Package: org.jsoup; bundle-symbolic-name="org.jsoup"; bundle-version="1.14.3.v20211012-1727"; version="1.14.3"; uses:="javax.annotation,javax.net.ssl,org.jsoup.nodes,org.jsoup.parser,org.jsoup.safety"
+ Unresolved requirement: Import-Package: org.jsoup.parser
+ -> Export-Package: org.jsoup.parser; bundle-symbolic-name="org.jsoup"; bundle-version="1.14.3.v20211012-1727"; version="1.14.3"; uses:="javax.annotation,org.jsoup.nodes"
+ Unresolved requirement: Import-Package: org.jsoup.helper
+ -> Export-Package: org.jsoup.helper; bundle-symbolic-name="org.jsoup"; bundle-version="1.14.3.v20211012-1727"; version="1.14.3"; uses:="javax.annotation,javax.net.ssl,javax.xml.parsers,org.jsoup,org.jsoup.nodes,org.jsoup.parser,org.jsoup.select,org.w3c.dom"
+ Unresolved requirement: Import-Package: org.jsoup.safety
+ -> Export-Package: org.jsoup.safety; bundle-symbolic-name="org.jsoup"; bundle-version="1.14.3.v20211012-1727"; version="1.14.3"; uses:="org.jsoup.nodes"
+ Unresolved requirement: Import-Package: org.jsoup.select
+ -> Export-Package: org.jsoup.select; bundle-symbolic-name="org.jsoup"; bundle-version="1.14.3.v20211012-1727"; version="1.14.3"; uses:="javax.annotation,org.jsoup.nodes"
+ Unresolved requirement: Import-Package: org.jsoup.select; version="[1.15.0,2.0.0)"
+ -> Export-Package: org.jsoup.select; bundle-symbolic-name="org.jsoup"; bundle-version="1.15.3"; version="1.15.3"; uses:="javax.annotation,org.jsoup.nodes"
+ Unresolved requirement: Import-Package: com.google.common.collect; version="[31.1.0,32.0.0)"
+ -> Export-Package: com.google.common.collect; bundle-symbolic-name="com.google.guava"; bundle-version="31.1.0.jre"; version="31.1.0"; uses:="com.google.common.base,javax.annotation"
+ Unresolved requirement: Import-Package: com.google.common.escape; version="[31.1.0,32.0.0)"
+ -> Export-Package: com.google.common.escape; bundle-symbolic-name="com.google.guava"; bundle-version="31.1.0.jre"; version="31.1.0"; uses:="com.google.common.base,javax.annotation"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.outline
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.outline; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.markup.block
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.markup.block; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; uses:="org.eclipse.mylyn.wikitext.parser.markup,org.eclipse.mylyn.wikitext.parser.outline"
+ Unresolved requirement: Import-Package: org.jsoup.nodes; version="[1.15.0,2.0.0)"
+ -> Export-Package: org.jsoup.nodes; bundle-symbolic-name="org.jsoup"; bundle-version="1.15.3"; version="1.15.3"; uses:="javax.annotation,org.jsoup,org.jsoup.helper,org.jsoup.parser,org.jsoup.select"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.internal.parser.html
+ -> Export-Package: org.eclipse.mylyn.wikitext.internal.parser.html; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; x-internal:="true"; uses:="org.eclipse.mylyn.wikitext.parser,org.jsoup.nodes,org.xml.sax"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.markup
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.markup; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.util"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.markup.token
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.markup.token; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; uses:="org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.jsoup.internal; version="[1.15.0,2.0.0)"
+ -> Export-Package: org.jsoup.internal; bundle-symbolic-name="org.jsoup"; bundle-version="1.15.3"; version="1.15.3"; uses:="javax.annotation,javax.annotation.meta"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.util
+ -> Export-Package: org.eclipse.mylyn.wikitext.util; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="javax.xml.stream,org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.markup,org.xml.sax"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.css
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.css; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.internal.util
+ -> Export-Package: org.eclipse.mylyn.wikitext.internal.util; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; x-internal:="true"
+ Unresolved requirement: Import-Package: org.jsoup.internal; version="[1.14.0,2.0.0)"
+ -> Export-Package: org.jsoup.internal; bundle-symbolic-name="org.jsoup"; bundle-version="1.14.3.v20211012-1727"; version="1.14.3"; x-internal:="true"; uses:="javax.annotation,javax.annotation.meta"
+ Unresolved requirement: Import-Package: org.jsoup.nodes; version="[1.14.0,2.0.0)"
+ -> Export-Package: org.jsoup.nodes; bundle-symbolic-name="org.jsoup"; bundle-version="1.15.3"; version="1.15.3"; uses:="javax.annotation,org.jsoup,org.jsoup.helper,org.jsoup.parser,org.jsoup.select"
+ Unresolved requirement: Import-Package: com.google.common.base; version="[30.1.0,31.0.0)"
+ -> Export-Package: com.google.common.base; bundle-symbolic-name="com.google.guava"; bundle-version="30.1.0.v20210127-2300"; version="30.1.0"; uses:="com.google.errorprone.annotations,org.checkerframework.checker.nullness.qual"
+ Unresolved requirement: Import-Package: com.google.common.xml; version="[30.1.0,31.0.0)"
+ -> Export-Package: com.google.common.xml; bundle-symbolic-name="com.google.guava"; bundle-version="30.1.0.v20210127-2300"; version="30.1.0"; uses:="com.google.common.escape"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.util
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.util; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser.markup,org.eclipse.mylyn.wikitext.parser.outline,org.eclipse.mylyn.wikitext.util"
+ Unresolved requirement: Import-Package: org.jsoup.select; version="[1.14.0,2.0.0)"
+ -> Export-Package: org.jsoup.select; bundle-symbolic-name="org.jsoup"; bundle-version="1.14.3.v20211012-1727"; version="1.14.3"; uses:="javax.annotation,org.jsoup.nodes"
+ Unresolved requirement: Import-Package: com.google.common.escape; version="[30.1.0,31.0.0)"
+ -> Export-Package: com.google.common.escape; bundle-symbolic-name="com.google.guava"; bundle-version="30.1.0.v20210127-2300"; version="30.1.0"; uses:="com.google.common.base,com.google.errorprone.annotations,org.checkerframework.checker.nullness.qual"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser.markup,org.xml.sax"
+ Unresolved requirement: Import-Package: com.google.common.base
+ -> Export-Package: com.google.common.base; bundle-symbolic-name="com.google.guava"; bundle-version="32.1.2.jre"; version="32.1.2"; uses:="javax.annotation"
+ com.google.guava [622]
+ Unresolved requirement: Import-Package: javax.annotation; version="[3.0.0,4.0.0)"; resolution:="optional"
+ Unresolved requirement: Require-Bundle: com.google.guava; bundle-version="30.1.0"
+ -> Bundle-SymbolicName: com.google.guava; bundle-version="32.1.2.jre"
+ Unresolved requirement: Require-Bundle: org.eclipse.mylyn.wikitext.markdown; bundle-version="3.0.40"
+ -> Bundle-SymbolicName: org.eclipse.mylyn.wikitext.markdown; bundle-version="3.0.42.20220107230029"
+ org.eclipse.mylyn.wikitext.markdown [369]
+ Unresolved requirement: Import-Package: com.google.common.collect; version="[30.1.0,31.0.0)"
+ -> Export-Package: com.google.common.collect; bundle-symbolic-name="com.google.guava"; bundle-version="30.1.0.v20210127-2300"; version="30.1.0"; uses:="com.google.common.base,com.google.errorprone.annotations,org.checkerframework.checker.nullness.qual"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.markup.phrase; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.markup.phrase; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.util; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.util; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="javax.xml.stream,org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.markup,org.xml.sax"
+ Unresolved requirement: Import-Package: com.google.common.base; version="[30.1.0,31.0.0)"
+ -> Export-Package: com.google.common.base; bundle-symbolic-name="com.google.guava"; bundle-version="30.1.0.v20210127-2300"; version="30.1.0"; uses:="com.google.errorprone.annotations,org.checkerframework.checker.nullness.qual"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.markdown
+ -> Export-Package: org.eclipse.mylyn.wikitext.markdown; bundle-symbolic-name="org.eclipse.mylyn.wikitext.markdown"; bundle-version="3.0.48.202308291007"; version="3.0.48"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.markup"
+ org.eclipse.mylyn.wikitext.markdown [860]
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.util; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.util; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="javax.xml.stream,org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.markup,org.xml.sax"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.builder; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.builder; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.builder.event,org.eclipse.mylyn.wikitext.parser.outline,org.eclipse.mylyn.wikitext.util"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.markup; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.markup; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.util"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.markdown.internal
+ -> Export-Package: org.eclipse.mylyn.wikitext.markdown.internal; bundle-symbolic-name="org.eclipse.mylyn.wikitext.markdown"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; x-internal:="true"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.builder,org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.markdown.internal.token
+ -> Export-Package: org.eclipse.mylyn.wikitext.markdown.internal.token; bundle-symbolic-name="org.eclipse.mylyn.wikitext.markdown"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; x-internal:="true"; uses:="org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.validation; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.validation; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: com.google.common.base; version="[31.1.0,33.0.0)"
+ -> Export-Package: com.google.common.base; bundle-symbolic-name="com.google.guava"; bundle-version="32.1.2.jre"; version="32.1.2"; uses:="javax.annotation"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.markup.phrase; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.markup.phrase; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser.markup,org.xml.sax"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.markup.token; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.markup.token; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; uses:="org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.markdown.internal.util
+ -> Export-Package: org.eclipse.mylyn.wikitext.markdown.internal.util; bundle-symbolic-name="org.eclipse.mylyn.wikitext.markdown"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; x-internal:="true"; uses:="org.eclipse.mylyn.wikitext.markdown.internal.block,org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.markdown.internal.phrase
+ -> Export-Package: org.eclipse.mylyn.wikitext.markdown.internal.phrase; bundle-symbolic-name="org.eclipse.mylyn.wikitext.markdown"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; x-internal:="true"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.markup,org.eclipse.mylyn.wikitext.parser.markup.token"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.markdown.internal.block
+ -> Export-Package: org.eclipse.mylyn.wikitext.markdown.internal.block; bundle-symbolic-name="org.eclipse.mylyn.wikitext.markdown"; bundle-version="3.0.46.202301111837"; version="3.0.46"; x-internal:="true"; uses:="org.eclipse.mylyn.wikitext.markdown.internal.util,org.eclipse.mylyn.wikitext.parser.markup"
+ org.eclipse.mylyn.wikitext.markdown [861]
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.markdown.internal
+ -> Export-Package: org.eclipse.mylyn.wikitext.markdown.internal; bundle-symbolic-name="org.eclipse.mylyn.wikitext.markdown"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; x-internal:="true"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.builder,org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.markdown.internal.token
+ -> Export-Package: org.eclipse.mylyn.wikitext.markdown.internal.token; bundle-symbolic-name="org.eclipse.mylyn.wikitext.markdown"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; x-internal:="true"; uses:="org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.markdown.internal.phrase
+ -> Export-Package: org.eclipse.mylyn.wikitext.markdown.internal.phrase; bundle-symbolic-name="org.eclipse.mylyn.wikitext.markdown"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; x-internal:="true"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.markup,org.eclipse.mylyn.wikitext.parser.markup.token"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.util; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.util; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="javax.xml.stream,org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.markup,org.xml.sax"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.markdown.internal.util
+ -> Export-Package: org.eclipse.mylyn.wikitext.markdown.internal.util; bundle-symbolic-name="org.eclipse.mylyn.wikitext.markdown"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; x-internal:="true"; uses:="org.eclipse.mylyn.wikitext.markdown.internal.block,org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.markdown
+ -> Export-Package: org.eclipse.mylyn.wikitext.markdown; bundle-symbolic-name="org.eclipse.mylyn.wikitext.markdown"; bundle-version="3.0.48.202308291007"; version="3.0.48"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: com.google.common.base; version="[31.1.0,32.0.0)"
+ -> Export-Package: com.google.common.base; bundle-symbolic-name="com.google.guava"; bundle-version="31.1.0.jre"; version="31.1.0"; uses:="javax.annotation"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.builder; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.builder; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.builder.event,org.eclipse.mylyn.wikitext.parser.outline,org.eclipse.mylyn.wikitext.util"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.markup.token; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.markup.token; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; uses:="org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser.markup,org.xml.sax"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.validation; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.validation; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.markup.phrase; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.markup.phrase; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.markup; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.markup; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.util"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.markdown.internal.block
+ -> Export-Package: org.eclipse.mylyn.wikitext.markdown.internal.block; bundle-symbolic-name="org.eclipse.mylyn.wikitext.markdown"; bundle-version="3.0.46.202301111837"; version="3.0.46"; x-internal:="true"; uses:="org.eclipse.mylyn.wikitext.markdown.internal.util,org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.markup; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.markup; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.util"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.markup.token; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.markup.token; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.42.20220107230029"; version="3.0.42"; uses:="org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.validation; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.validation; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser.markup"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser.markup,org.xml.sax"
+ Unresolved requirement: Import-Package: org.eclipse.mylyn.wikitext.parser.builder; version="[3.0.0,4.0.0)"
+ -> Export-Package: org.eclipse.mylyn.wikitext.parser.builder; bundle-symbolic-name="org.eclipse.mylyn.wikitext"; bundle-version="3.0.46.202301111837"; version="3.0.46"; uses:="org.eclipse.mylyn.wikitext.parser,org.eclipse.mylyn.wikitext.parser.builder.event,org.eclipse.mylyn.wikitext.parser.outline,org.eclipse.mylyn.wikitext.util"
+ Unresolved requirement: Import-Package: com.google.gson; version="2.7.0"
+ -> Export-Package: com.google.gson; bundle-symbolic-name="com.google.gson"; bundle-version="2.8.9.v20220111-1409"; version="2.8.9"; uses:="com.google.gson.internal,com.google.gson.reflect,com.google.gson.stream"
+ Unresolved requirement: Require-Bundle: org.eclipse.lsp4j.jsonrpc; bundle-version="[0.19.0,0.20.0)"
+ -> Bundle-SymbolicName: org.eclipse.lsp4j.jsonrpc; bundle-version="0.19.0.v20221118-0359"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.cdt.remote.core 4 0 2024-04-25 11:26:26.990
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.cdt.remote.core [1052]
+ Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="1.2.0.202211062329"; osgi.identity="org.eclipse.cdt.remote.core"; singleton:="true"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.ecf.provider.filetransfer 4 0 2024-04-25 11:26:26.991
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.ecf.provider.filetransfer [1054]
+ Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="3.3.0.v20230422-0242"; osgi.identity="org.eclipse.ecf.provider.filetransfer"; singleton:="true"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.ecf.provider.filetransfer.httpclient5 4 0 2024-04-25 11:26:26.991
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.ecf.provider.filetransfer.httpclient5 [1055]
+ Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="1.1.0.v20230423-0417"; osgi.identity="org.eclipse.ecf.provider.filetransfer.httpclient5"; singleton:="true"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.emf.common.ui 4 0 2024-04-25 11:26:26.992
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.emf.common.ui [1058]
+ Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="2.21.0.v20230211-1150"; osgi.identity="org.eclipse.emf.common.ui"; singleton:="true"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.equinox.p2.discovery.compatibility 4 0 2024-04-25 11:26:26.993
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.equinox.p2.discovery.compatibility [1060]
+ Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="1.3.0.v20230322-1009"; osgi.identity="org.eclipse.equinox.p2.discovery.compatibility"; singleton:="true"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.linuxtools.dataviewers 4 0 2024-04-25 11:26:26.993
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.linuxtools.dataviewers [1062]
+ Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="6.1.0.202309052024"; osgi.identity="org.eclipse.linuxtools.dataviewers"; singleton:="true"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.linuxtools.dataviewers.charts 4 0 2024-04-25 11:26:26.994
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.linuxtools.dataviewers.charts [1063]
+ Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="7.0.0.202309052024"; osgi.identity="org.eclipse.linuxtools.dataviewers.charts"; singleton:="true"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.linuxtools.docker.core 4 0 2024-04-25 11:26:26.995
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.linuxtools.docker.core [1065]
+ Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="5.9.0.202211291906"; osgi.identity="org.eclipse.linuxtools.docker.core"; singleton:="true"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.linuxtools.docker.editor.ls 4 0 2024-04-25 11:26:26.995
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.linuxtools.docker.editor.ls [1067]
+ Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="1.0.1.202211291906"; osgi.identity="org.eclipse.linuxtools.docker.editor.ls"; singleton:="true"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.linuxtools.docker.ui 4 0 2024-04-25 11:26:26.996
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.linuxtools.docker.ui [1068]
+ Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="5.9.0.202211291906"; osgi.identity="org.eclipse.linuxtools.docker.ui"; singleton:="true"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.remote.serial.core 4 0 2024-04-25 11:26:26.996
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.remote.serial.core [1072]
+ Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="1.2.0.202211062329"; osgi.identity="org.eclipse.remote.serial.core"; singleton:="true"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.remote.serial.ui 4 0 2024-04-25 11:26:26.997
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.remote.serial.ui [1073]
+ Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="1.1.0.202211062329"; osgi.identity="org.eclipse.remote.serial.ui"; singleton:="true"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.remote.telnet.core 4 0 2024-04-25 11:26:26.998
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.remote.telnet.core [1074]
+ Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="1.2.0.202211062329"; osgi.identity="org.eclipse.remote.telnet.core"; singleton:="true"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.swtchart.extensions 4 0 2024-04-25 11:26:26.998
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.swtchart.extensions [1076]
+ Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="0.13.0.202207230616"; osgi.identity="org.eclipse.swtchart.extensions"; singleton:="true"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.tm.terminal.connector.local 4 0 2024-04-25 11:26:26.999
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.tm.terminal.connector.local [1077]
+ Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="4.8.0.202211062329"; osgi.identity="org.eclipse.tm.terminal.connector.local"; singleton:="true"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.tm.terminal.connector.process 4 0 2024-04-25 11:26:26.999
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.tm.terminal.connector.process [1078]
+ Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="4.9.0.202211062329"; osgi.identity="org.eclipse.tm.terminal.connector.process"; singleton:="true"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.tm.terminal.connector.ssh 4 0 2024-04-25 11:26:27.000
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.tm.terminal.connector.ssh [1079]
+ Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="4.8.100.202303140100"; osgi.identity="org.eclipse.tm.terminal.connector.ssh"; singleton:="true"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.tm.terminal.connector.telnet 4 0 2024-04-25 11:26:27.001
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.tm.terminal.connector.telnet [1080]
+ Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="4.8.0.202211062329"; osgi.identity="org.eclipse.tm.terminal.connector.telnet"; singleton:="true"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.tm.terminal.control 4 0 2024-04-25 11:26:27.001
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.tm.terminal.control [1081]
+ Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="5.5.100.202311142253"; osgi.identity="org.eclipse.tm.terminal.control"; singleton:="true"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.tm.terminal.view.core 4 0 2024-04-25 11:26:27.002
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.tm.terminal.view.core [1082]
+ Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="4.10.100.202309151124"; osgi.identity="org.eclipse.tm.terminal.view.core"; singleton:="true"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.tm.terminal.view.ui 4 0 2024-04-25 11:26:27.002
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.tm.terminal.view.ui [1083]
+ Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="4.11.300.202311142324"; osgi.identity="org.eclipse.tm.terminal.view.ui"; singleton:="true"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.tm4e.registry 4 0 2024-04-25 11:26:27.003
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.tm4e.registry [1085]
+ Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="0.6.5.202308132047"; osgi.identity="org.eclipse.tm4e.registry"; singleton:="true"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.tm4e.ui 4 0 2024-04-25 11:26:27.003
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.tm4e.ui [1086]
+ Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="0.6.1.202211021121"; osgi.identity="org.eclipse.tm4e.ui"; singleton:="true"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.wst.common.frameworks.ui 4 0 2024-04-25 11:26:27.004
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.wst.common.frameworks.ui [1091]
+ Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="1.3.0.v202308161955"; osgi.identity="org.eclipse.wst.common.frameworks.ui"; singleton:="true"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.wst.common.uriresolver 4 0 2024-04-25 11:26:27.005
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.wst.common.uriresolver [1092]
+ Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="1.4.0.v202308161955"; osgi.identity="org.eclipse.wst.common.uriresolver"; singleton:="true"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.wst.sse.core 4 0 2024-04-25 11:26:27.005
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.wst.sse.core [1093]
+ Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="1.2.900.v202211200019"; osgi.identity="org.eclipse.wst.sse.core"; singleton:="true"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.wst.xml.core 4 0 2024-04-25 11:26:27.006
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.wst.xml.core [1094]
+ Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="1.2.700.v202305221615"; osgi.identity="org.eclipse.wst.xml.core"; singleton:="true"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.xsd 4 0 2024-04-25 11:26:27.006
+!MESSAGE FrameworkEvent ERROR
+!STACK 0
+org.osgi.framework.BundleException: Could not resolve module: org.eclipse.xsd [1095]
+ Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="2.19.0.v20230614-0642"; osgi.identity="org.eclipse.xsd"; singleton:="true"
+
+ at org.eclipse.osgi.container.Module.start(Module.java:463)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847)
+ at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667)
+ at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
+ at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
+ at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
+
+!ENTRY org.eclipse.equinox.app 0 0 2024-04-25 11:26:27.065
+!MESSAGE Product org.eclipse.epp.package.cpp.product could not be found.
+
+!ENTRY org.eclipse.osgi 4 0 2024-04-25 11:26:38.863
+!MESSAGE Application error
+!STACK 1
+java.lang.LinkageError: loader constraint violation: loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @602c167e wants to load abstract class org.eclipse.e4.core.contexts.ContextFunction. A different abstract class with the same name was previously loaded by org.eclipse.osgi.internal.loader.EquinoxClassLoader @194ec3c8. (org.eclipse.e4.core.contexts.ContextFunction is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @194ec3c8, parent loader 'platform')
+ at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.getHandler(HandlerServiceImpl.java:65)
+ at org.eclipse.ui.internal.commands.CommandPersistence.readCommandsFromRegistry(CommandPersistence.java:196)
+ at org.eclipse.ui.internal.commands.CommandPersistence.reRead(CommandPersistence.java:461)
+ at org.eclipse.ui.internal.CommandToModelProcessor.process(CommandToModelProcessor.java:71)
+ at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
+ at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
+ at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
+ at java.base/java.lang.reflect.Method.invoke(Method.java:568)
+ at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
+ at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:300)
+ at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:234)
+ at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:173)
+ at org.eclipse.e4.ui.internal.workbench.ModelAssembler.runProcessor(ModelAssembler.java:715)
+ at org.eclipse.e4.ui.internal.workbench.ModelAssembler.runProcessors(ModelAssembler.java:649)
+ at org.eclipse.e4.ui.internal.workbench.ModelAssembler.processModel(ModelAssembler.java:322)
+ at org.eclipse.e4.ui.internal.workbench.ResourceHandler.loadMostRecentModel(ResourceHandler.java:199)
+ at org.eclipse.e4.ui.internal.workbench.swt.E4Application.loadApplicationModel(E4Application.java:371)
+ at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:247)
+ at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:573)
+ at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:342)
+ at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
+ at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
+ at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
+ at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
+ at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
+ at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
+ at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
+ at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
+ at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
+ at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
+ at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
+ at java.base/java.lang.reflect.Method.invoke(Method.java:568)
+ at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
+ at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
+ at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
+ at org.eclipse.equinox.launcher.Main.main(Main.java:1440)
diff --git a/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version
new file mode 100644
index 0000000..6b2aaa7
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..30841eb
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,3 @@
+eclipse.preferences.version=1
+encoding=UTF-8
+version=1
diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml
index 1a5207d..3023585 100644
--- a/.settings/language.settings.xml
+++ b/.settings/language.settings.xml
@@ -5,7 +5,7 @@
-
+
@@ -16,10 +16,10 @@
-
+
-
+
\ No newline at end of file
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..455a709
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,73 @@
+{
+ "files.associations": {
+ "array": "cpp",
+ "atomic": "cpp",
+ "bit": "cpp",
+ "*.tcc": "cpp",
+ "cctype": "cpp",
+ "clocale": "cpp",
+ "cmath": "cpp",
+ "compare": "cpp",
+ "concepts": "cpp",
+ "cstdarg": "cpp",
+ "cstddef": "cpp",
+ "cstdint": "cpp",
+ "cstdio": "cpp",
+ "cstdlib": "cpp",
+ "cstring": "cpp",
+ "cwchar": "cpp",
+ "cwctype": "cpp",
+ "deque": "cpp",
+ "list": "cpp",
+ "map": "cpp",
+ "set": "cpp",
+ "string": "cpp",
+ "unordered_map": "cpp",
+ "vector": "cpp",
+ "exception": "cpp",
+ "algorithm": "cpp",
+ "functional": "cpp",
+ "iterator": "cpp",
+ "memory": "cpp",
+ "memory_resource": "cpp",
+ "numeric": "cpp",
+ "optional": "cpp",
+ "random": "cpp",
+ "string_view": "cpp",
+ "system_error": "cpp",
+ "tuple": "cpp",
+ "type_traits": "cpp",
+ "utility": "cpp",
+ "fstream": "cpp",
+ "initializer_list": "cpp",
+ "iosfwd": "cpp",
+ "iostream": "cpp",
+ "istream": "cpp",
+ "limits": "cpp",
+ "new": "cpp",
+ "numbers": "cpp",
+ "ostream": "cpp",
+ "sstream": "cpp",
+ "stdexcept": "cpp",
+ "streambuf": "cpp",
+ "cinttypes": "cpp",
+ "typeinfo": "cpp",
+ "csignal": "cpp",
+ "ctime": "cpp",
+ "strstream": "cpp",
+ "bitset": "cpp",
+ "chrono": "cpp",
+ "codecvt": "cpp",
+ "complex": "cpp",
+ "condition_variable": "cpp",
+ "ratio": "cpp",
+ "future": "cpp",
+ "iomanip": "cpp",
+ "mutex": "cpp",
+ "semaphore": "cpp",
+ "stop_token": "cpp",
+ "thread": "cpp",
+ "cfenv": "cpp",
+ "typeindex": "cpp"
+ }
+}
\ No newline at end of file
diff --git a/API_log/SH_log.cpp b/API_log/SH_log.cpp
index 61d06f7..05bb876 100644
--- a/API_log/SH_log.cpp
+++ b/API_log/SH_log.cpp
@@ -7,7 +7,8 @@
#include
#include
#include
-
+#include "../common/SH_global.h"
+#include "../common/SH_CommonFunc.hpp"
struct _LogParam {
pthread_mutex_t *m_mutex;
@@ -33,7 +34,8 @@ int log_init(const char* file_name, int log_buf_size, int limit_size)
struct timeval now = {0,0};
gettimeofday(&now, NULL);
- time_t t = now.tv_sec;
+ time_t t ;
+ t = now.tv_sec;
struct tm* sys_tm = localtime(&t);
char fileTime[20]={0x00};
char fileName[100]={0x00};
@@ -46,6 +48,16 @@ int log_init(const char* file_name, int log_buf_size, int limit_size)
void log_write(const char *level, const char* format, ...)
{
+ struct timeval now = {0,0};
+ gettimeofday(&now, NULL);
+ time_t t;
+ t = now.tv_sec;
+ struct tm* sys_tm = localtime(&t);
+ char fileTime[20]={0x00};
+ char fileName[100]={0x00};
+ int n = snprintf(fileTime, 64, "%d-%02d-%02d.log", sys_tm->tm_year+1900, sys_tm->tm_mon+1, sys_tm->tm_mday);
+ sprintf(fileName,"%s%s",SOFTWARE_RUN_LOG,fileTime);
+ strcpy(gLogParam.m_log_full_name, fileName);
FILE *fp = fopen(gLogParam.m_log_full_name, "a");
if(fp == NULL) {
return;
@@ -53,15 +65,10 @@ void log_write(const char *level, const char* format, ...)
memset(gLogParam.m_buf, 0, sizeof(char)*gLogParam.m_log_buf_size);
- struct timeval now = {0,0};
- gettimeofday(&now, NULL);
- time_t t = now.tv_sec;
- struct tm* sys_tm = localtime(&t);
-
pthread_mutex_lock(gLogParam.m_mutex);
- int n = snprintf(gLogParam.m_buf, 64, "%d-%02d-%02d %02d:%02d:%02d %s: ", sys_tm->tm_year+1900, sys_tm->tm_mon+1, sys_tm->tm_mday,
+ n = snprintf(gLogParam.m_buf, 64, "%d-%02d-%02d %02d:%02d:%02d %s: ", sys_tm->tm_year+1900, sys_tm->tm_mon+1, sys_tm->tm_mday,
sys_tm->tm_hour, sys_tm->tm_min, sys_tm->tm_sec, level);
diff --git a/Cidn-SH b/Cidn-SH
new file mode 100644
index 0000000..d5a8937
Binary files /dev/null and b/Cidn-SH differ
diff --git a/MD5/md5.cpp b/MD5/md5.cpp
new file mode 100644
index 0000000..6c9cd15
--- /dev/null
+++ b/MD5/md5.cpp
@@ -0,0 +1,304 @@
+#include "md5.h"
+
+#ifndef HAVE_OPENSSL
+
+ #define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z))))
+ #define G(x, y, z) ((y) ^ ((z) & ((x) ^ (y))))
+ #define H(x, y, z) ((x) ^ (y) ^ (z))
+ #define I(x, y, z) ((y) ^ ((x) | ~(z)))
+ #define STEP(f, a, b, c, d, x, t, s) \
+ (a) += f((b), (c), (d)) + (x) + (t); \
+ (a) = (((a) << (s)) | (((a) & 0xffffffff) >> (32 - (s)))); \
+ (a) += (b);
+
+ #if defined(__i386__) || defined(__x86_64__) || defined(__vax__)
+ #define SET(n) \
+ (*(MD5_u32 *)&ptr[(n) * 4])
+ #define GET(n) \
+ SET(n)
+ #else
+ #define SET(n) \
+ (ctx->block[(n)] = \
+ (MD5_u32)ptr[(n) * 4] | \
+ ((MD5_u32)ptr[(n) * 4 + 1] << 8) | \
+ ((MD5_u32)ptr[(n) * 4 + 2] << 16) | \
+ ((MD5_u32)ptr[(n) * 4 + 3] << 24))
+ #define GET(n) \
+ (ctx->block[(n)])
+ #endif
+
+ typedef unsigned int MD5_u32;
+
+ typedef struct {
+ MD5_u32 lo, hi;
+ MD5_u32 a, b, c, d;
+ unsigned char buffer[64];
+ MD5_u32 block[16];
+ } MD5_CTX;
+
+ static void MD5_Init(MD5_CTX *ctx);
+ static void MD5_Update(MD5_CTX *ctx, const void *data, unsigned long size);
+ static void MD5_Final(unsigned char *result, MD5_CTX *ctx);
+
+ static const void *body(MD5_CTX *ctx, const void *data, unsigned long size){
+ const unsigned char *ptr;
+ MD5_u32 a, b, c, d;
+ MD5_u32 saved_a, saved_b, saved_c, saved_d;
+
+ ptr = (const unsigned char*)data;
+
+ a = ctx->a;
+ b = ctx->b;
+ c = ctx->c;
+ d = ctx->d;
+
+ do {
+ saved_a = a;
+ saved_b = b;
+ saved_c = c;
+ saved_d = d;
+
+ STEP(F, a, b, c, d, SET(0), 0xd76aa478, 7)
+ STEP(F, d, a, b, c, SET(1), 0xe8c7b756, 12)
+ STEP(F, c, d, a, b, SET(2), 0x242070db, 17)
+ STEP(F, b, c, d, a, SET(3), 0xc1bdceee, 22)
+ STEP(F, a, b, c, d, SET(4), 0xf57c0faf, 7)
+ STEP(F, d, a, b, c, SET(5), 0x4787c62a, 12)
+ STEP(F, c, d, a, b, SET(6), 0xa8304613, 17)
+ STEP(F, b, c, d, a, SET(7), 0xfd469501, 22)
+ STEP(F, a, b, c, d, SET(8), 0x698098d8, 7)
+ STEP(F, d, a, b, c, SET(9), 0x8b44f7af, 12)
+ STEP(F, c, d, a, b, SET(10), 0xffff5bb1, 17)
+ STEP(F, b, c, d, a, SET(11), 0x895cd7be, 22)
+ STEP(F, a, b, c, d, SET(12), 0x6b901122, 7)
+ STEP(F, d, a, b, c, SET(13), 0xfd987193, 12)
+ STEP(F, c, d, a, b, SET(14), 0xa679438e, 17)
+ STEP(F, b, c, d, a, SET(15), 0x49b40821, 22)
+ STEP(G, a, b, c, d, GET(1), 0xf61e2562, 5)
+ STEP(G, d, a, b, c, GET(6), 0xc040b340, 9)
+ STEP(G, c, d, a, b, GET(11), 0x265e5a51, 14)
+ STEP(G, b, c, d, a, GET(0), 0xe9b6c7aa, 20)
+ STEP(G, a, b, c, d, GET(5), 0xd62f105d, 5)
+ STEP(G, d, a, b, c, GET(10), 0x02441453, 9)
+ STEP(G, c, d, a, b, GET(15), 0xd8a1e681, 14)
+ STEP(G, b, c, d, a, GET(4), 0xe7d3fbc8, 20)
+ STEP(G, a, b, c, d, GET(9), 0x21e1cde6, 5)
+ STEP(G, d, a, b, c, GET(14), 0xc33707d6, 9)
+ STEP(G, c, d, a, b, GET(3), 0xf4d50d87, 14)
+ STEP(G, b, c, d, a, GET(8), 0x455a14ed, 20)
+ STEP(G, a, b, c, d, GET(13), 0xa9e3e905, 5)
+ STEP(G, d, a, b, c, GET(2), 0xfcefa3f8, 9)
+ STEP(G, c, d, a, b, GET(7), 0x676f02d9, 14)
+ STEP(G, b, c, d, a, GET(12), 0x8d2a4c8a, 20)
+ STEP(H, a, b, c, d, GET(5), 0xfffa3942, 4)
+ STEP(H, d, a, b, c, GET(8), 0x8771f681, 11)
+ STEP(H, c, d, a, b, GET(11), 0x6d9d6122, 16)
+ STEP(H, b, c, d, a, GET(14), 0xfde5380c, 23)
+ STEP(H, a, b, c, d, GET(1), 0xa4beea44, 4)
+ STEP(H, d, a, b, c, GET(4), 0x4bdecfa9, 11)
+ STEP(H, c, d, a, b, GET(7), 0xf6bb4b60, 16)
+ STEP(H, b, c, d, a, GET(10), 0xbebfbc70, 23)
+ STEP(H, a, b, c, d, GET(13), 0x289b7ec6, 4)
+ STEP(H, d, a, b, c, GET(0), 0xeaa127fa, 11)
+ STEP(H, c, d, a, b, GET(3), 0xd4ef3085, 16)
+ STEP(H, b, c, d, a, GET(6), 0x04881d05, 23)
+ STEP(H, a, b, c, d, GET(9), 0xd9d4d039, 4)
+ STEP(H, d, a, b, c, GET(12), 0xe6db99e5, 11)
+ STEP(H, c, d, a, b, GET(15), 0x1fa27cf8, 16)
+ STEP(H, b, c, d, a, GET(2), 0xc4ac5665, 23)
+ STEP(I, a, b, c, d, GET(0), 0xf4292244, 6)
+ STEP(I, d, a, b, c, GET(7), 0x432aff97, 10)
+ STEP(I, c, d, a, b, GET(14), 0xab9423a7, 15)
+ STEP(I, b, c, d, a, GET(5), 0xfc93a039, 21)
+ STEP(I, a, b, c, d, GET(12), 0x655b59c3, 6)
+ STEP(I, d, a, b, c, GET(3), 0x8f0ccc92, 10)
+ STEP(I, c, d, a, b, GET(10), 0xffeff47d, 15)
+ STEP(I, b, c, d, a, GET(1), 0x85845dd1, 21)
+ STEP(I, a, b, c, d, GET(8), 0x6fa87e4f, 6)
+ STEP(I, d, a, b, c, GET(15), 0xfe2ce6e0, 10)
+ STEP(I, c, d, a, b, GET(6), 0xa3014314, 15)
+ STEP(I, b, c, d, a, GET(13), 0x4e0811a1, 21)
+ STEP(I, a, b, c, d, GET(4), 0xf7537e82, 6)
+ STEP(I, d, a, b, c, GET(11), 0xbd3af235, 10)
+ STEP(I, c, d, a, b, GET(2), 0x2ad7d2bb, 15)
+ STEP(I, b, c, d, a, GET(9), 0xeb86d391, 21)
+
+ a += saved_a;
+ b += saved_b;
+ c += saved_c;
+ d += saved_d;
+
+ ptr += 64;
+ } while (size -= 64);
+
+ ctx->a = a;
+ ctx->b = b;
+ ctx->c = c;
+ ctx->d = d;
+
+ return ptr;
+ }
+
+ void MD5_Init(MD5_CTX *ctx){
+ ctx->a = 0x67452301;
+ ctx->b = 0xefcdab89;
+ ctx->c = 0x98badcfe;
+ ctx->d = 0x10325476;
+
+ ctx->lo = 0;
+ ctx->hi = 0;
+ }
+
+ void MD5_Update(MD5_CTX *ctx, const void *data, unsigned long size){
+ MD5_u32 saved_lo;
+ unsigned long used, free;
+
+ saved_lo = ctx->lo;
+ if ((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo)
+ ctx->hi++;
+ ctx->hi += size >> 29;
+ used = saved_lo & 0x3f;
+
+ if (used){
+ free = 64 - used;
+ if (size < free) {
+ memcpy(&ctx->buffer[used], data, size);
+ return;
+ }
+
+ memcpy(&ctx->buffer[used], data, free);
+ data = (unsigned char *)data + free;
+ size -= free;
+ body(ctx, ctx->buffer, 64);
+ }
+
+ if (size >= 64) {
+ data = body(ctx, data, size & ~(unsigned long)0x3f);
+ size &= 0x3f;
+ }
+
+ memcpy(ctx->buffer, data, size);
+ }
+
+ void MD5_Final(unsigned char *result, MD5_CTX *ctx){
+ unsigned long used, free;
+ used = ctx->lo & 0x3f;
+ ctx->buffer[used++] = 0x80;
+ free = 64 - used;
+
+ if (free < 8) {
+ memset(&ctx->buffer[used], 0, free);
+ body(ctx, ctx->buffer, 64);
+ used = 0;
+ free = 64;
+ }
+
+ memset(&ctx->buffer[used], 0, free - 8);
+
+ ctx->lo <<= 3;
+ ctx->buffer[56] = ctx->lo;
+ ctx->buffer[57] = ctx->lo >> 8;
+ ctx->buffer[58] = ctx->lo >> 16;
+ ctx->buffer[59] = ctx->lo >> 24;
+ ctx->buffer[60] = ctx->hi;
+ ctx->buffer[61] = ctx->hi >> 8;
+ ctx->buffer[62] = ctx->hi >> 16;
+ ctx->buffer[63] = ctx->hi >> 24;
+ body(ctx, ctx->buffer, 64);
+ result[0] = ctx->a;
+ result[1] = ctx->a >> 8;
+ result[2] = ctx->a >> 16;
+ result[3] = ctx->a >> 24;
+ result[4] = ctx->b;
+ result[5] = ctx->b >> 8;
+ result[6] = ctx->b >> 16;
+ result[7] = ctx->b >> 24;
+ result[8] = ctx->c;
+ result[9] = ctx->c >> 8;
+ result[10] = ctx->c >> 16;
+ result[11] = ctx->c >> 24;
+ result[12] = ctx->d;
+ result[13] = ctx->d >> 8;
+ result[14] = ctx->d >> 16;
+ result[15] = ctx->d >> 24;
+ memset(ctx, 0, sizeof(*ctx));
+ }
+#else
+ #include
+#endif
+
+
+using namespace std;
+
+/* Return Calculated raw result(always little-endian), the size is always 16 */
+void md5bin(const void* dat, size_t len, unsigned char out[16]) {
+ MD5_CTX c;
+ MD5_Init(&c);
+ MD5_Update(&c, dat, len);
+ MD5_Final(out, &c);
+}
+
+static char hb2hex(unsigned char hb) {
+ hb = hb & 0xF;
+ return hb < 10 ? '0' + hb : hb - 10 + 'a';
+}
+
+string md5file(const char* filename){
+ printf("file = %s\n",filename);
+ FILE* file = fopen(filename, "rb");
+ string res = md5file(file);
+ fclose(file);
+ return res;
+}
+
+string md5file(FILE* file){
+
+ MD5_CTX c;
+ MD5_Init(&c);
+
+ char buff[BUFSIZ];
+ unsigned char out[16];
+ size_t len = 0;
+ while( ( len = fread(buff ,sizeof(char), BUFSIZ, file) ) > 0) {
+ MD5_Update(&c, buff, len);
+ }
+ MD5_Final(out, &c);
+
+ string res;
+ for(size_t i = 0; i < 16; ++ i) {
+ res.push_back(hb2hex(out[i] >> 4));
+ res.push_back(hb2hex(out[i]));
+ }
+ return res;
+}
+
+string md5(const void* dat, size_t len) {
+ string res;
+ unsigned char out[16];
+ md5bin(dat, len, out);
+ for(size_t i = 0; i < 16; ++ i) {
+ res.push_back(hb2hex(out[i] >> 4));
+ res.push_back(hb2hex(out[i]));
+ }
+ return res;
+}
+
+std::string md5(std::string dat){
+ return md5(dat.c_str(), dat.length());
+}
+
+/* Generate shorter md5sum by something like base62 instead of base16 or base10. 0~61 are represented by 0-9a-zA-Z */
+string md5sum6(const void* dat, size_t len){
+ static const char* tbl = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ string res;
+ unsigned char out[16];
+ md5bin(dat, len, out);
+ for(size_t i = 0; i < 6; ++i) {
+ res.push_back(tbl[out[i] % 62]);
+ }
+ return res;
+}
+
+std::string md5sum6(std::string dat){
+ return md5sum6(dat.c_str(), dat.length() );
+}
diff --git a/MD5/md5.h b/MD5/md5.h
new file mode 100644
index 0000000..f63ab34
--- /dev/null
+++ b/MD5/md5.h
@@ -0,0 +1,16 @@
+#ifndef MD5_H
+#define MD5_H
+
+#define _CRT_SECURE_NO_WARNINGS
+#include
+#include
+#include
+
+std::string md5(std::string dat);
+std::string md5(const void* dat, size_t len);
+extern std::string md5file(const char* filename);
+std::string md5file(FILE* file);
+std::string md5sum6(std::string dat);
+std::string md5sum6(const void* dat, size_t len);
+
+#endif // end of MD5_H
diff --git a/Makefile b/Makefile
index 481d64f..54d941c 100644
--- a/Makefile
+++ b/Makefile
@@ -2,22 +2,24 @@ TARGET = Cidn-SH
OBJ_PATH = $(shell pwd)/debug
PREFIX_BIN =
-CC = arm-linux-gnueabihf-g++
-STRIP = arm-linux-gnueabihf-strip
-INCLUDES = -I../third_party/boost/include \
- -I../third_party/fftw/include \
- -I../third_party/jsoncpp/include \
- -I../third_party/sqlite/include/
+CC = ${CXX}
+STRIP = aarch64-poky-linux-strip
+INCLUDES = -I../Tools/GatewayThirdParty/boost/include \
+ -I../Tools/GatewayThirdParty/fftw/include \
+ -I../Tools/GatewayThirdParty/jsoncpp/include \
+ -I../Tools/GatewayThirdParty/sqlite/include/ \
+ -I../Tools/GatewayThirdParty/curl/include/ \
+ -I ./ \
-LIBS = -L../third_party/boost/lib \
- -L../third_party/fftw/lib \
- -L../third_party/ssl/lib \
- -L../third_party/jsoncpp \
- -L../third_party/mqtt1410/lib \
- -L../third_party/sqlite/lib \
- -lsqlite3 -lboost_system -lpthread -lboost_thread -lboost_date_time -lfftw3 -lssl -lcrypto -ljson -lmosquitto
+LIBS = -L../Tools/renesas_thirdparty/lib \
+ -L../Tools/renesas_thirdparty/lib \
+ -L../Tools/renesas_thirdparty/lib \
+ -L../Tools/renesas_thirdparty/lib \
+ -L../Tools/renesas_thirdparty/lib \
+ -L../Tools/renesas_thirdparty/lib \
+ -lsqlite3 -lboost_system -lpthread -lboost_thread -lboost_date_time -lfftw3 -ljsoncpp -lmosquitto -lcurl
-CFLAGS = -O2 #-Wall -Werror
+CFLAGS = -O0 -fpermissive #-Wall -Werror
LINKFLAGS =
AllDirs :=$(shell ls -R | grep '^\./.*:' | awk '{if( \
diff --git a/calculation/Calculation.cpp b/calculation/Calculation.cpp
index 38f9aa5..7893857 100644
--- a/calculation/Calculation.cpp
+++ b/calculation/Calculation.cpp
@@ -60,7 +60,46 @@ void Calculation::iFFT(int n, fftw_complex* in, fftw_complex* out)
fftw_destroy_plan(p);
fftw_cleanup();
}
+void Calculation::_iFFT( std::vector & vecrealData,std::vector & vecimageData,std::vector & veciFFTData)
+{
+ fftw_complex *inFFt, *outFFt;
+ int N = vecrealData.size();
+ inFFt = (fftw_complex *)fftw_malloc(sizeof(fftw_complex) * N);
+ outFFt = (fftw_complex *)fftw_malloc(sizeof(fftw_complex) * N);
+ for (int j = 0; j < N; j++) {
+ inFFt[j][0] = (double)vecrealData[j];
+ inFFt[j][1] = (double)vecimageData[j];
+ }
+ iFFT(N,inFFt, outFFt);
+ for (int i = 0; i < N; i++) {
+ outFFt[i][0] *= 1./N;
+ outFFt[i][1] *= 1./N;
+ veciFFTData.push_back(outFFt[i][0]);
+ }
+ fftw_free(inFFt);
+ fftw_free(outFFt);
+}
+void Calculation::_FFT(std::vector & vecData, std::vector & vecFFTrealData,std::vector & vecFFTimageData)
+{
+ fftw_complex *inHilFFt, *outHilFFt;
+ inHilFFt = (fftw_complex *)fftw_malloc(sizeof(fftw_complex) * vecData.size());
+ outHilFFt = (fftw_complex *)fftw_malloc(sizeof(fftw_complex) * vecData.size());
+
+ for (int j = 0; j < vecData.size(); j++) {
+ inHilFFt[j][0] = (double)vecData[j];
+ inHilFFt[j][1] = 0;
+ }
+
+ FFT(vecData.size(), inHilFFt, outHilFFt);
+ fftShift(outHilFFt, vecData.size());
+ for (int i = 0; i < vecData.size(); i++) {
+ vecFFTrealData.push_back(outHilFFt[i][0]);
+ vecFFTimageData.push_back(outHilFFt[i][1]);
+ }
+ fftw_free(inHilFFt);
+ fftw_free(outHilFFt);
+}
//************************************
// Method: caculateAmp_Pha
// FullName: Calculation::caculateAmp_Pha
@@ -155,6 +194,22 @@ float Calculation::rms(std::vector & vecData)
}
+
+float Calculation::getSample_variance(std::vector a)
+{
+ float ss = 0;
+ float s = 0;
+ float mx = mean(a);
+ int len = a.size();
+ for (int i = 0; i < len; i++) {
+ s = a[i] - mx;
+ ss += pow(s, 2);
+ }
+ return ss / (len - 1);
+}
+
+
+
float Calculation::variance(std::vector & vecDropMeanData)
{
double varianceTemp = 0;
@@ -187,7 +242,43 @@ float Calculation::kurtosis(std::vector & vecDropMeanData, float fVarianc
tempkurtosis = tempkurtosis / pow(fVariance, 2);
return tempkurtosis;
}
+void Calculation::Hanning(std::vector & vecData,std::vector & vecHanningData)
+{
+ int N = vecData.size();
+ float* w = NULL;
+ w = (float*)calloc(N, sizeof(float));
+ int half, i, idx;
+ if (N % 2 == 0)
+ {
+ half = N / 2;
+ for (i = 0; i < half; i++) //CALC_HANNING Calculates Hanning window samples.
+ w[i] = 0.5 * (1 - cos(2 * pi * (i + 1) / (N + 1)));
+
+
+ idx = half - 1;
+ for (i = half; i < N; i++) {
+ w[i] = w[idx];
+ idx--;
+ }
+ }
+ else
+ {
+ half = (N + 1) / 2;
+ for (i = 0; i < half; i++) //CALC_HANNING Calculates Hanning window samples.
+ w[i] = 0.5 * (1 - cos(2 * pi * (i + 1) / (N + 1)));
+
+ idx = half - 2;
+ for (i = half; i < N; i++) {
+ w[i] = w[idx];
+ idx--;
+ }
+ }
+ for(int j = 0; j < N;j++){
+ vecHanningData.push_back(w[j]);
+ }
+ free(w);
+}
void Calculation::hilbert(std::vector & vecData, std::vector & vecHilbertData, int N)
{
@@ -253,6 +344,7 @@ void Calculation::hilbert(std::vector & vecData, std::vector & vec
vecHilbertData.push_back(amp);
// printf("%d %f\n",n,vecHilbertData[n]);
}
+ fftw_free(out);
}
@@ -289,9 +381,9 @@ void Calculation::FFTSpec(std::vector & vecData, std::vector & vec
}
-void Calculation::envSpec(std::vector & vecData, std::vector & vecEnvSpecData)
+void Calculation::envSpec(std::vector & vecData, std::vector & vecEnvSpecData,int StartFrequency,int EndFrequency)
{
- std::vector vecDropMeanData;
+ /*std::vector vecDropMeanData;
drop_mean(vecDropMeanData, vecData);
std::vector vecHilbertData;
@@ -313,5 +405,42 @@ void Calculation::envSpec(std::vector & vecData, std::vector & vec
for (int i = vecHilbertData.size() / 2 + 1; i < vecHilbertData.size(); i++) {
float ftemp = 2 * sqrt(outHilFFt[i][0] * outHilFFt[i][0] + outHilFFt[i][1] * outHilFFt[i][1]) / vecHilbertData.size();
vecEnvSpecData.push_back(ftemp);
- }
+ }*/
+ std::vector vecFFTrealData,vecFFTimageData;
+ std::vector vecRealData,vecImageData;
+ std::vector veciFFtData;
+ std::vector veciFFtData2;
+ std::vector vecHilbertData;
+ _FFT(vecData,vecFFTrealData,vecFFTimageData);
+ for(int i = 0; i < vecFFTrealData.size();i++){
+ if(i > StartFrequency && i < EndFrequency){
+ vecRealData.push_back(vecFFTrealData.at(i));
+ vecImageData.push_back(vecFFTimageData.at(i));
+ }else{
+ vecRealData.push_back(0);
+ vecImageData.push_back(0);
+ }
+ }
+ _iFFT(vecRealData,vecImageData,veciFFtData);
+ for(int j = 0; j < veciFFtData.size();j++){
+ veciFFtData2.push_back(veciFFtData[j]*2);
+ }
+ hilbert(veciFFtData2,vecHilbertData,veciFFtData2.size());
+ FFTSpec(vecHilbertData, vecEnvSpecData);
+}
+
+
+void Calculation::GenerateSin(std::vector & vecData)
+{
+ int i;
+ int ft = 1; /* 周期 hz */
+ int fs = 12800; /* 采样频率*/
+
+ /* generate data */
+ int data_len = (8*1024);
+
+ for (i = 0; i < data_len; i++) {
+ vecData.push_back(sin(1000 * 2 *3.1415926*ft*i/fs));
+ }
+
}
diff --git a/calculation/Calculation.hpp b/calculation/Calculation.hpp
index 3e26611..6d888be 100644
--- a/calculation/Calculation.hpp
+++ b/calculation/Calculation.hpp
@@ -75,7 +75,8 @@ public:
float rms(std::vector & vecData);
-
+ //获取样本方差
+ float getSample_variance(std::vector a);
//去数据的直流分量
@@ -105,7 +106,8 @@ public:
float kurtosis(std::vector & vecDropMeanData, float fVariance);
-
+ //hanning 窗
+ void Hanning(std::vector & vecData,std::vector & vecHanningData);
//快速傅里叶变换函数
@@ -122,8 +124,8 @@ public:
//快速傅里叶逆变换
void iFFT(int n, fftw_complex* in, fftw_complex* out);
-
-
+ void _iFFT(std::vector & vecData, std::vector & vecFFTSpecData,std::vector & veciFFTData);
+ void _FFT(std::vector & vecData, std::vector & vecFFTrealData,std::vector & vecFFTimageData);
//通道幅值和相位提取
@@ -139,7 +141,8 @@ public:
-
+ //生成正弦信号
+ void GenerateSin(std::vector & vecData);
//FFT shift
@@ -147,7 +150,7 @@ public:
//频谱图数据
void FFTSpec(std::vector & vecData, std::vector & vecFFTSpecData);
//包络图谱数据
- void envSpec(std::vector & vecData, std::vector & vecEnvSpecData);
+ void envSpec(std::vector & vecData, std::vector & vecEnvSpecData,int StartFrequency,int EndFrequency);
};
diff --git a/common/Mutex.h b/common/Mutex.h
new file mode 100644
index 0000000..ece4f02
--- /dev/null
+++ b/common/Mutex.h
@@ -0,0 +1,20 @@
+#ifndef _MY_COMM_H_
+#define _MY_COMM_H_
+#include
+
+class Mutex {
+private:
+ pthread_mutex_t mutex;
+public:
+ Mutex() { mutex = PTHREAD_MUTEX_INITIALIZER;pthread_mutex_init(&mutex,NULL); /*printf("\n pthread_mutex_init \n");*/}
+ virtual ~Mutex() {pthread_mutex_destroy(&mutex); /*printf("\n pthread_mutex_destroy \n");*/}
+ void Lock() {pthread_mutex_lock(&mutex); /*printf("\n mutex lock \n");*/}
+ void UnLock() {pthread_mutex_unlock(&mutex); /*printf("\n mutex unlock \n");*/}
+};
+//Mutex g_Mutex;
+
+
+
+
+
+#endif //_MY_COMM_H_
diff --git a/common/SH_CommonFunc.cpp b/common/SH_CommonFunc.cpp
index 016dd81..ab7e782 100644
--- a/common/SH_CommonFunc.cpp
+++ b/common/SH_CommonFunc.cpp
@@ -3,9 +3,353 @@
#include "SH_global.h"
#include "SH_CommonFunc.hpp"
#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include "../dbaccess/SH_SqlDB.hpp"
+#define ETHTOOL_GLINK 0x0000000a /* Get link status (ethtool_value) */
+#define MAX_WAIT_TIME 1
+#define MAX_NO_PACKETS 1
+#define ICMP_HEADSIZE 8
+#define PACKET_SIZE 4096
+struct timeval tvsend,tvrecv;
+struct sockaddr_in dest_addr,recv_addr;
+int sockfd;
+pid_t pid;
+char sendpacket[PACKET_SIZE];
+char recvpacket[PACKET_SIZE];
static boost::mutex s_config_mu;
+Mutex g_tDbMutex;
+string GetLocalTimeWithMs(void)
+{
+ string defaultTime = "19700101000000000";
+ try
+ {
+ struct timeval curTime;
+ gettimeofday(&curTime, NULL);
+ int milli = curTime.tv_usec / 1000;
+
+ char buffer[80] = {0};
+ struct tm nowTime;
+ localtime_r(&curTime.tv_sec, &nowTime);//把得到的值存入临时分配的内存中,线程安全
+ strftime(buffer, sizeof(buffer), "%Y%m%d%H%M%S", &nowTime);
+
+ char currentTime[84] = {0};
+ snprintf(currentTime, sizeof(currentTime), "%s%03d", buffer, milli);
+
+ return currentTime;
+ }
+ catch(const std::exception& e)
+ {
+ return defaultTime;
+ }
+ catch (...)
+ {
+ return defaultTime;
+ }
+}
+int code_convert(const char *from_charset, const char *to_charset, char *inbuf, size_t inlen,
+ char *outbuf, size_t outlen) {
+ iconv_t cd;
+ char **pin = &inbuf;
+ char **pout = &outbuf;
+
+ cd = iconv_open(to_charset, from_charset);
+ if (cd == 0)
+ return -1;
+
+ memset(outbuf, 0, outlen);
+
+ if ((int)iconv(cd, pin, &inlen, pout, &outlen) == -1)
+ {
+ iconv_close(cd);
+ return -1;
+ }
+ iconv_close(cd);
+ *pout = '\0';
+
+ return 0;
+}
+
+int u2g(char *inbuf, size_t inlen, char *outbuf, size_t outlen) {
+ return code_convert("utf-8", "gb2312", inbuf, inlen, outbuf, outlen);
+}
+
+int g2u(char *inbuf, size_t inlen, char *outbuf, size_t outlen) {
+ return code_convert("gb2312", "utf-8", inbuf, inlen, outbuf, outlen);
+}
+
+std::string GBKToUTF8(const std::string& strGBK)
+{
+ int length = strGBK.size()*2+1;
+
+ char *temp = (char*)malloc(sizeof(char)*length);
+
+ if(g2u((char*)strGBK.c_str(),strGBK.size(),temp,length) >= 0)
+ {
+ std::string str_result;
+ str_result.append(temp);
+ free(temp);
+ return str_result;
+ }else
+ {
+ free(temp);
+ return "";
+ }
+}
+
+std::string UTFtoGBK(const char* utf8)
+{
+ int length = strlen(utf8);
+
+ char *temp = (char*)malloc(sizeof(char)*length);
+
+ if(u2g((char*)utf8,length,temp,length) >= 0)
+ {
+ std::string str_result;
+ str_result.append(temp);
+ free(temp);
+
+ return str_result;
+ }else
+ {
+ free(temp);
+ return "";
+ }
+}
+
+
+void InitGpio(unsigned int gpioN,unsigned int inout)
+{
+ int fd = 0;
+ char tmp[100] = {0};
+ //打开gpio设备文件
+ fd = open("/sys/class/gpio/export", O_WRONLY);
+ if(-1 == fd)
+ {
+ printf("[%s]:[%d] open gpio export file error\r\n", __FUNCTION__, __LINE__);
+ }
+ //申请gpio
+ sprintf(tmp,"%d",gpioN);
+ if(write(fd, tmp, strlen(tmp)) < 0)
+ {
+ printf("write file operation error %s\r\n",tmp);
+
+ }
+ close(fd);
+ sleep(1);
+ //配置gpio方向
+#ifdef G2UL_GATEWAY
+ char tmp2[100] = {0};
+ if(gpioN == 507)
+ memcpy(tmp2,"P18_3",5);
+ else if(gpioN == 499)
+ memcpy(tmp2,"P17_3",5);
+ else if(gpioN == 496)
+ memcpy(tmp2,"P17_0",5);
+ else if(gpioN == 130)
+ memcpy(tmp2,"P9_0",4);
+ else if(gpioN == 408)
+ memcpy(tmp2,"P6_0",4);
+ else if(gpioN == 363)
+ memcpy(tmp2,"P0_3",4);
+ else if(gpioN == 498)
+ memcpy(tmp2,"P17_2",5);
+ else if(gpioN == 466)
+ memcpy(tmp2,"P13_2",5);
+ else if(gpioN == 488)
+ memcpy(tmp2,"P16_0",5);
+ else if(gpioN == 474)
+ memcpy(tmp2,"P14_2",5);
+ else if(gpioN == 497)
+ memcpy(tmp2,"P17_1",5);
+ else if(gpioN == 409)
+ memcpy(tmp2,"P6_1",4);
+ else if(gpioN == 410)
+ memcpy(tmp2,"P6_2",4);
+ else if(gpioN == 449)
+ memcpy(tmp2,"P11_1",5);
+ else if(gpioN == 489)
+ memcpy(tmp2,"P16_1",5);
+ sprintf(tmp,"/sys/class/gpio/%s/direction",tmp2);
+#else if IMX6UL_GATEWAY
+ sprintf(tmp,"/sys/class/gpio/gpio%d/direction",gpioN);
+#endif
+
+ print_info("open GPIO = %s\n",tmp);
+ fd = open(tmp, O_WRONLY);
+ if(-1 == fd)
+ {
+ printf("[%s]:[%d] open gpio direction file error\r\n", __FUNCTION__, __LINE__);
+ }
+
+ if(inout == 0)
+ {
+ print_info("=====InitGpio=====in\n");
+ if(-1 == write(fd, "in", sizeof("in")))
+ {
+ print_info("[%s]:[%d] [%d]write operation direction error\r\n", __FUNCTION__, __LINE__,gpioN);
+ close(fd);
+ }
+ }
+ else if( inout == 1)
+ {
+ print_info("=====InitGpio=====out\n");
+ if(-1 == write(fd, "out", sizeof("out")))
+ {
+ print_info("[%s]:[%d] [%d]write operation direction error\r\n", __FUNCTION__, __LINE__,gpioN);
+ close(fd);
+ }
+ }
+ close(fd);
+// printf("gpio%d init %d\r\n",gpioN,inout);
+}
+int gpio_set(unsigned int gpioN,char x)
+{
+ int fd = 0;
+ char tmp[100] = {0};
+#ifdef G2UL_GATEWAY
+ char tmp2[100] = {0};
+ if(gpioN == 507)
+ memcpy(tmp2,"P18_3",5);
+ else if(gpioN == 499)
+ memcpy(tmp2,"P17_3",5);
+ else if(gpioN == 496)
+ memcpy(tmp2,"P17_0",5);
+ else if(gpioN == 130)
+ memcpy(tmp2,"P9_0",4);
+ else if(gpioN == 408)
+ memcpy(tmp2,"P6_0",4);
+ else if(gpioN == 363)
+ memcpy(tmp2,"P0_3",4);
+ else if(gpioN == 498)
+ memcpy(tmp2,"P17_2",5);
+ else if(gpioN == 466)
+ memcpy(tmp2,"P13_2",5);
+ else if(gpioN == 488)
+ memcpy(tmp2,"P16_0",5);
+ else if(gpioN == 474)
+ memcpy(tmp2,"P14_2",5);
+ else if(gpioN == 497)
+ memcpy(tmp2,"P17_1",5);
+ else if(gpioN == 409)
+ memcpy(tmp2,"P6_1",4);
+ else if(gpioN == 410)
+ memcpy(tmp2,"P6_2",4);
+ else if(gpioN == 449)
+ memcpy(tmp2,"P11_1",5);
+ else if(gpioN == 489)
+ memcpy(tmp2,"P16_1",5);
+ sprintf(tmp,"/sys/class/gpio/%s/value",tmp2);
+#else if IMX6UL_GATEWAY
+ sprintf(tmp,"/sys/class/gpio/gpio%d/value",gpioN);
+#endif
+// printf("%s\r\n",tmp);
+ //print_info("set GPIO = %s\n",tmp);
+ //打开gpio value文件
+ fd = open(tmp, O_WRONLY);
+ if(-1 == fd)
+ {
+ print_red("[%s]:[%d] open gpio export file error\r\n", __FUNCTION__, __LINE__);
+ return (-1);//exit(1);
+ }
+ //设置电平
+ if(x)
+ {
+ if(-1 == write(fd, "1", sizeof("1")))
+ {
+ print_red("[%s]:[%d] %d write operation value error\r\n", __FUNCTION__, __LINE__,gpioN);
+ close(fd);
+ return (-1);//exit(1);
+ }
+ }
+ else
+ {
+ if(-1 == write(fd, "0", sizeof("0")))
+ {
+ print_red("[%s]:[%d] %d write operation value error\r\n", __FUNCTION__, __LINE__,gpioN);
+ close(fd);
+ return (-1);//exit(1);
+ }
+ }
+// printf("gpio%d set %d ok\r\n",gpioN,x);
+ close(fd);
+ return 0;
+}
+int gpio_read(unsigned int gpioN)
+{
+ int fd = 0;
+ char value;
+
+ char tmp[100] = {0};
+
+#ifdef G2UL_GATEWAY
+ char tmp2[100] = {0};
+ if(gpioN == 507)
+ memcpy(tmp2,"P18_3",5);
+ else if(gpioN == 499)
+ memcpy(tmp2,"P17_3",5);
+ else if(gpioN == 496)
+ memcpy(tmp2,"P17_0",5);
+ else if(gpioN == 130)
+ memcpy(tmp2,"P9_0",4);
+ else if(gpioN == 408)
+ memcpy(tmp2,"P6_0",4);
+ else if(gpioN == 363)
+ memcpy(tmp2,"P0_3",4);
+ else if(gpioN == 498)
+ memcpy(tmp2,"P17_2",5);
+ else if(gpioN == 466)
+ memcpy(tmp2,"P13_2",5);
+ else if(gpioN == 488)
+ memcpy(tmp2,"P16_0",5);
+ else if(gpioN == 474)
+ memcpy(tmp2,"P14_2",5);
+ else if(gpioN == 497)
+ memcpy(tmp2,"P17_1",5);
+ else if(gpioN == 409)
+ memcpy(tmp2,"P6_1",4);
+ else if(gpioN == 410)
+ memcpy(tmp2,"P6_2",4);
+ else if(gpioN == 449)
+ memcpy(tmp2,"P11_1",5);
+ else if(gpioN == 489)
+ memcpy(tmp2,"P16_1",5);
+ sprintf(tmp,"/sys/class/gpio/%s/value",tmp2);
+#else if IMX6UL_GATEWAY
+ sprintf(tmp,"/sys/class/gpio/gpio%d/value",gpioN);
+#endif
+ //打开gpio value文件
+ fd = open(tmp, O_RDONLY);
+ if(-1 == fd)
+ {
+ print_red("[%s]:[%d] %d open gpio export file error\r\n", __FUNCTION__, __LINE__,gpioN);
+ return (-1);//exit(1);
+ }
+ //读取 value文件
+ if(-1 == read(fd, &value, sizeof(value)))
+ {
+ print_red("[%s]:[%d] %d read gpiovalue is fail\r\n", __FUNCTION__, __LINE__,gpioN);
+ close(fd);
+ return (-1);//exit(1);
+ }
+ close(fd);
+ //printf("gpio%d get %d\r\n",gpioN,value);
+ return value;
+}
int CheckFileVersion(int argc, char** argv)
{
@@ -36,8 +380,81 @@ int CheckFileVersion(int argc, char** argv)
}
return 0;
}
+int config_uart(const char* Port,speed_t speed)
+{
+ int iFd = open(Port,O_RDWR | O_NOCTTY);
+ if(iFd < 0) {
+ return -1;
+ }
+ struct termios opt;
+ tcgetattr(iFd, &opt);
+ cfsetispeed(&opt, speed);
+ cfsetospeed(&opt, speed);
+ if (tcgetattr(iFd, &opt)<0) {
+ return -1;
+ }
+ opt.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG);
+ opt.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON);
+ opt.c_oflag &= ~(OPOST);
+ opt.c_cflag &= ~(CSIZE | PARENB | CBAUD);
+ opt.c_cflag |= (CS8 | speed);
+ opt.c_cc[VMIN] = 255;
+ opt.c_cc[VTIME] = 5;
+ if (tcsetattr(iFd, TCSANOW, &opt)<0) {
+ return -1;
+ }
+ tcflush(iFd,TCIOFLUSH);
+ return iFd;
+}
+int write_data(int fd, char *buff, int len)
+{
+ int ret;
+ char buf[100];
+ ret = write(fd, buff, len);
+ if (ret < 0) {
+ return -1;
+ }
+ return ret;
+}
+int read_data(int fd, char *buff, int len, int timeout)
+{
+ int ret;
+ struct timeval to;
+ fd_set rdfds;
+
+ to.tv_sec = 0;
+ to.tv_usec = timeout;
+
+ FD_ZERO(&rdfds);
+ FD_SET(fd, &rdfds);
+
+ if (timeout > 0) {
+ ret = select(fd+1, &rdfds, NULL, NULL, &to);
+ if (ret <= 0) {
+ // printf("zigbee doesn't respond!\n");
+ return ret;
+ }
+ }
+
+ ret = read(fd,buff,len);
+ if(ret < 0) {
+ perror("read_data");
+ return -1;
+ }
+ buff[ret] = '\0';
+ return ret;
+}
+int ModifyMac(char* buff)
+{
+ FILE *fp = fopen("/opt/system/mac", "w");
+ fprintf(fp, buff);
+ fprintf(fp, "\n");
+ fclose(fp);
+ system("cp /opt/system/mac /opt/system/macbak");
+ system("/opt/Cidn/init.sh");
+}
std::string GetCurrentTime()
{
struct tm nowtime;
@@ -114,7 +531,50 @@ void GetTimeNet(char* timebuf,int type)
}
}
+// 获取RTC时间
+std::string GetRTC(char* timestamp,int& millisecond)
+{
+ time_t rtc_timestamp;
+ struct tm tm;
+ struct timespec ts;
+ char rtcTime[100]={0x00};
+ int fd = open("/dev/rtc0", O_RDONLY);
+ if (fd < 0) {
+ perror("open /dev/rtc0");
+ } else {
+ struct rtc_time rtc_tm;
+ if (ioctl(fd, RTC_RD_TIME, &rtc_tm) < 0) {
+ perror("ioctl RTC_RD_TIME");
+ } else {
+ clock_gettime(CLOCK_REALTIME, &ts);
+ millisecond = (int)(ts.tv_nsec / 1000000);
+ printf("RTC date/time is %d-%d-%d, %02d:%02d:%02d\n",
+ rtc_tm.tm_year + 1900, rtc_tm.tm_mon + 1, rtc_tm.tm_mday,
+ rtc_tm.tm_hour, rtc_tm.tm_min, rtc_tm.tm_sec);
+ sprintf(rtcTime,"%d-%d-%d, %02d:%02d:%02d",rtc_tm.tm_year + 1900, rtc_tm.tm_mon + 1, rtc_tm.tm_mday,
+ rtc_tm.tm_hour, rtc_tm.tm_min, rtc_tm.tm_sec);
+ // 将rtc_time结构体转换为time_t时间戳
+ tm.tm_year = rtc_tm.tm_year;
+ tm.tm_mon = rtc_tm.tm_mon;
+ tm.tm_mday = rtc_tm.tm_mday;
+ tm.tm_hour = rtc_tm.tm_hour;
+ tm.tm_min = rtc_tm.tm_min;
+ tm.tm_sec = rtc_tm.tm_sec;
+ tm.tm_isdst = -1; // 不使用夏令时
+
+ rtc_timestamp = mktime(&tm);
+
+ if (rtc_timestamp == -1) {
+ perror("mktime");
+ }
+ printf("RTC timestamp is %ld,millisecond = %d\n", rtc_timestamp,millisecond);
+ sprintf(timestamp,"%ld",rtc_timestamp);
+ }
+ }
+ close(fd);
+ return std::string(rtcTime);
+}
void GetTime_(char time_buff[],TIME_SIZE len)
{
int i = sizeof(time_buff);
@@ -142,24 +602,218 @@ std::string ReadStrByOpt(std::string filename, std::string config, std::string o
is.close();
return value;
}
-std::vector ReadStrByOpt(std::string filename,std::string& strUpdataFileName)
+std::vector ReadStrUpdate(std::string filename)
{
boost::mutex::scoped_lock lock(s_config_mu);
Json::Value root,hwVersion;
Json::Reader reader;
std::vector value;
+ std::vector vecDataNodeUpdate;
+ DataNodeUpdate datanodeUpdate;
std::fstream is;
is.open(filename.c_str(), std::ios::in);
if (reader.parse(is, root)) {
- hwVersion = root["hw_vesion"];
- strUpdataFileName = root["fw_name"].asString();
- }
- for(int i = 0; i < hwVersion.size();i++){
- value.push_back(hwVersion[i].asString());
- }
+ print_info("root = %d\n",root.size());
+ for(int i = 0; i < root.size();i++){
+ hwVersion = root[i]["hw_vesion"];
+ for(int i = 0; i < hwVersion.size();i++){
+ datanodeUpdate.hwVersion.push_back(hwVersion[i].asString());
+ }
+ datanodeUpdate.strUpdataFileName = root[i]["fw_name"].asString();
+ datanodeUpdate.strSoftVersion = root[i]["sf_vesion"].asString();
+ print_info("strUpdataFileName = %s,strSoftVersion = %s\n",datanodeUpdate.strUpdataFileName.c_str(),\
+ datanodeUpdate.strSoftVersion.c_str());
+ vecDataNodeUpdate.push_back(datanodeUpdate);
+ }
+ }
is.close();
- return value;
+
+ return vecDataNodeUpdate;
+}
+void ReadStrConfig(std::string filename)
+{
+ Json::Value root,gateWay,dataNode;
+ std::fstream is;
+ Json::Reader reader;
+ is.open(filename.c_str(), std::ios::in);
+ string zigbeeChannel;
+ if (reader.parse(is, root)) {
+ gateWay = root["gateWay"];
+ dataNode = root["dataNodeArray"];
+ print_info("dataNode = %d\n",dataNode.size());
+ for(int i = 0; i < dataNode.size();i++){
+ string softVersion = dataNode[i]["softVersion"].asString();
+ string bpNo = dataNode[i]["bpNo"].asString();
+ print_info("bpNo = %s\n",bpNo.c_str());
+ string wakeupTime = dataNode[i]["wakeupTime"].asString();
+ int viff = dataNode[i]["viff"].asInt();
+ string StaticTime = dataNode[i]["StaticTime"].asString();
+ int configFlag = dataNode[i]["configFlag"].asInt();
+ int rangeValue = dataNode[i]["range"].asInt();
+ int updateValue = dataNode[i]["update"].asInt();
+ string zigbeeLongAddr = dataNode[i]["zigbeeLongAddr"].asString();
+ int accFlag = dataNode[i]["accFlag"].asInt();
+ print_info("accFlag = %d\n",accFlag);
+ int temTopFlag = dataNode[i]["temTopFlag"].asInt();
+ string startBrands = dataNode[i]["startBrands"].asString();
+ int waveInterVal = dataNode[i]["waveInterVal"].asInt();
+ string zigbeePanId = dataNode[i]["zigbeePanId"].asString();
+ int waveTime = dataNode[i]["waveTime"].asInt();
+ int zigbeePower = dataNode[i]["zigbeePower"].asInt();
+ int zigbeeRetry = dataNode[i]["zigbeeRetry"].asInt();
+ string stopBrands = dataNode[i]["stopBrands"].asString();
+ int featureInterVal = dataNode[i]["featureInterVal"].asInt();
+ int zigbeeFlag = dataNode[i]["zigbeeFlag"].asInt();
+ string zigbeeDesAddr = dataNode[i]["zigbeeDesAddr"].asString();
+ print_info("zigbeeDesAddr = %s\n",zigbeeDesAddr.c_str());
+ int ZigbeeRetryGap = dataNode[i]["zigbeeRetryGap"].asInt();
+ string dataNodeNo = dataNode[i]["dataNodeNo"].asString();
+ int initFlag = dataNode[i]["initFlag"].asInt();
+ string faultFrequency = dataNode[i]["faultFrequency"].asString();
+ int temBotFlag = dataNode[i]["temBotFlag"].asInt();
+ string bateryV = dataNode[i]["bateryV"].asString();
+ int ACCSampleTime = dataNode[i]["ACCSampleTime"].asInt();
+ print_info("ACCSampleTime = %d\n",ACCSampleTime);
+ string firstPowerTime = dataNode[i]["firstPowerTime"].asString();
+ string serialNo = dataNode[i]["serialNo"].asString();
+ string zigbeeAddr = dataNode[i]["zigbeeAddr"].asString();
+ string productNo = dataNode[i]["productNo"].asString();
+ string timeStamp = dataNode[i]["timeStamp"].asString();
+ zigbeeChannel = dataNode[i]["zigbeeChannel"].asString();
+ int RSSI = dataNode[i]["RSSI"].asInt();
+ print_info("RSSI = %d\n",RSSI);
+ string hardVersion = dataNode[i]["hardVersion"].asString();
+ string envelopeBandPass = dataNode[i]["envelopeBandPass"].asString();
+ int samplingRate = dataNode[i]["samplingRate"].asInt();
+ string dataNodeName = dataNode[i]["dataNodeName"].asString();
+ int status = dataNode[i]["status"].asInt();
+ int EquipSta = dataNode[i]["equipSta"].asInt();
+ char insertSql[1024] = { 0 };
+ char whereCon[100]={0x00};
+ sprintf(whereCon,"dataNodeNo = '%s'",dataNodeNo.c_str());
+ int rows = sql_ctl->GetTableRows(T_SENSOR_INFO(TNAME), whereCon);
+ if(rows > 0)
+ continue;
+ sprintf(insertSql, "'%s','%s','%d','%d','%d','%d','%d','%d',\
+ '%s','%s','%s','%s','%s','%d',\
+ '%d','%d','%d','%s','%d','%s',\
+ '%s','%d','%d','%d','%s','%d','%s','%s',\
+ '%s','%d','%s','%s','%s',\
+ '%d','%d','%d','%d','%d','%s','%d','%d','%d','0','0,0'",
+ dataNodeNo.c_str(), dataNodeName.c_str(), initFlag, accFlag, zigbeeFlag, temTopFlag, temBotFlag,EquipSta,\
+ hardVersion.c_str(), softVersion.c_str(), bpNo.c_str(), serialNo.c_str(), firstPowerTime.c_str(), atoi(wakeupTime.c_str()),\
+ atoi(StaticTime.c_str()),waveTime,atoi(bateryV.c_str()),productNo.c_str(),configFlag, startBrands.c_str(), \
+ stopBrands.c_str(), featureInterVal, waveInterVal, samplingRate,"",rangeValue, envelopeBandPass.c_str(), faultFrequency.c_str(),\
+ zigbeePanId.c_str(), atoi(zigbeeChannel.c_str()), zigbeeAddr.c_str(), zigbeeLongAddr.c_str(), zigbeeDesAddr.c_str(), \
+ zigbeePower,zigbeeRetry,ZigbeeRetryGap,ACCSampleTime,status, timeStamp.c_str(),viff,RSSI,updateValue);
+ sql_ctl->InsertData(T_SENSOR_INFO(TNAME), insertSql);
+ }
+
+ /*WriteStr2Config(SERVERCONFIG, "Server", "localServerIpAddress", gateWay["Server"]["localServerIpAddress"].asString());
+ WriteStr2Config(SERVERCONFIG, "Server", "localServerPort", gateWay["Server"]["localServerPort"].asString());
+ WriteStr2Config(SERVERCONFIG, "Server", "CommMode", gateWay["Server"]["CommMode"].asString());
+ WriteStr2Config(SERVERCONFIG, "Server", "UserName", gateWay["Server"]["UserName"].asString());
+ WriteStr2Config(SERVERCONFIG, "Server", "Password", gateWay["Server"]["Password"].asString());
+
+ WriteStr2Config(NETWORKCONFIG, "Net", "dnsName", gateWay["Net"]["dnsName"].asString());
+ WriteStr2Config(NETWORKCONFIG, "Net", "networkPortStatus", gateWay["Net"]["networkPortStatus"].asString());
+ WriteStr2Config(NETWORKCONFIG, "Net", "gateway", gateWay["Net"]["gateway"].asString());
+ WriteStr2Config(NETWORKCONFIG, "Net", "subnetMask", gateWay["Net"]["subnetMask"].asString());
+ WriteStr2Config(NETWORKCONFIG, "Net", "ipAddress", gateWay["Net"]["ipAddress"].asString());
+ WriteStr2Config(NETWORKCONFIG, "Net", "hostName", gateWay["Net"]["hostName"].asString());
+
+ WriteStr2Config(ZIGBEECONFIG, "Zigbee", "channel", zigbeeChannel);*/
+ }else{
+ print_info("parse error\n");
+ }
+ is.close();
+}
+int UpdataDataNodeConfig(std::string filename)
+{
+ vector vecDataNode; //声明一个字符串向量
+ //以读入方式打开文件
+ ifstream csv_data(filename, ios::in);
+ int iRet = 0;
+ if (!csv_data.is_open())
+ {
+ cout << "Error: opening file fail" << endl;
+ return -1;
+ }
+ else {
+ string line;
+
+ vector words; //声明一个字符串向量
+ string word;
+
+ DataNodeInfo dataNode;
+ // ------------读取数据-----------------
+ // 读取标题行
+ getline(csv_data, line);
+
+
+ istringstream sin;
+ // 按行读取数据
+ while (getline(csv_data, line))
+ {
+ words.clear();
+ sin.clear();
+ sin.str(line);
+ while (getline(sin, word, ','))
+ {
+ cout << word << endl;
+ words.push_back(word);
+
+ }
+ string mac = words[1];
+ if(mac != GlobalConfig::MacAddr_G){
+ iRet = -2;
+ break;
+ }
+ dataNode.ZigbeeLongAddr = words[7];
+ dataNode.FeatureInterVal = atoi(words[14].c_str());
+ dataNode.WaveInterVal = atoi(words[15].c_str());
+ dataNode.SamplingRate = atoi(words[16].c_str());
+ print_info("words[17] = %s\n",words[17].c_str());
+
+ if(words[17].find("8g") != string::npos){
+ dataNode.Range = 0;
+ }else if(words[17].find("16g") != string::npos){
+ dataNode.Range = 1;
+ }else if(words[17].find("32g") != string::npos){
+ dataNode.Range = 2;
+ }else if(words[17].find("64g") != string::npos){
+ dataNode.Range = 3;
+ }else if(words[17].find("50g") != string::npos){
+ dataNode.Range = 0;
+ }
+
+ dataNode.ACCSampleTime = atoi(words[18].c_str());
+ int update = atoi(words[20].c_str());
+ if(update == 1)
+ vecDataNode.push_back(dataNode);
+ }
+ csv_data.close();
+ }
+
+ char whereCon[1024] = {0};
+ char updateSql[1024] = { 0 };
+ if(vecDataNode.size() > 0){
+ for(int i = 0; i < vecDataNode.size();i++){
+ sprintf(updateSql, "featureInterVal='%d',waveInterVal='%d',range='%d',samplingRate='%d',AccSampleTime = '%d',UpdateFlag = 0",
+ vecDataNode[i].FeatureInterVal, vecDataNode[i].WaveInterVal,vecDataNode[i].Range,\
+ vecDataNode[i].SamplingRate,vecDataNode[i].ACCSampleTime);
+ sprintf(whereCon, "dataNodeNo='%s'", vecDataNode[i].ZigbeeLongAddr.c_str());
+
+ int iRet = sql_ctl->UpdateTableData(T_SENSOR_INFO(TNAME), updateSql, whereCon);
+ memset(whereCon,0x00,sizeof(whereCon));
+ memset(updateSql,0x00,sizeof(updateSql));
+ }
+ iRet = vecDataNode.size() ;
+ }else{
+ iRet = -3;
+ }
+ return iRet;
}
int WriteStr2Config(std::string filename, std::string config, std::string option, std::string value, bool listable)
{
@@ -197,7 +851,7 @@ int WriteStr2Config(std::string filename, std::string config, std::string option
}
-std::string GetLocalMac()
+std::string GetLocalMac(const char* net)
{
int sock_mac;
struct ifreq ifr_mac;
@@ -208,7 +862,7 @@ std::string GetLocalMac()
return "";
}
memset(&ifr_mac,0,sizeof(ifr_mac));
- strncpy(ifr_mac.ifr_name, "eth0", sizeof(ifr_mac.ifr_name)-1);
+ strncpy(ifr_mac.ifr_name, net, sizeof(ifr_mac.ifr_name)-1);
if( (ioctl( sock_mac, SIOCGIFHWADDR, &ifr_mac)) < 0) {
printf("mac ioctl error/n");
return "";
@@ -219,9 +873,10 @@ std::string GetLocalMac()
(unsigned char)ifr_mac.ifr_hwaddr.sa_data[2],
(unsigned char)ifr_mac.ifr_hwaddr.sa_data[3],
(unsigned char)ifr_mac.ifr_hwaddr.sa_data[4],
- (unsigned char)ifr_mac.ifr_hwaddr.sa_data[5]);
+ (unsigned char)ifr_mac.ifr_hwaddr.sa_data[5]);
printf("local mac:%s /n",mac_addr);
close( sock_mac );
+ LOG_INFO("net : %s,mac:%s\n",net,mac_addr);
return std::string( mac_addr );
}
@@ -238,7 +893,7 @@ std::string GetGwIp_(const char *eth_name)
bzero(&req, sizeof(struct ifreq));
strcpy(req.ifr_name, eth_name);
- print_info("eth_name = %s\n",eth_name);
+ //print_info("eth_name = %s\n",eth_name);
ioctl(sockfd, SIOCGIFADDR, &req);
host = (struct sockaddr_in*) &req.ifr_addr;
close(sockfd);
@@ -250,14 +905,43 @@ std::string GetGwIp_(const char *eth_name)
std::string IpAddrInit()
{
+ const char *WLAN2 = "wlan2";
const char *WLAN0 = "wlan0";
const char *ETH0 = "eth0";
- std::string strip;
- strip = GetGwIp_(ETH0);
- if (strip.compare("0.0.0.0") == 0) {
- strip = GetGwIp_(WLAN0);
+ const char *USB0 = "usb0";
+ const char *WWAN0 = "wwan0";
+ const char *ETH1 = "eth1";
+ const char *ETH2 = "eth2";
+ std::string strip = "";
+ strip = GetGwIp_(WLAN0);
+ if (strip.compare("0.0.0.0") != 0) {
+ return strip;
}
- return strip;
+ strip = GetGwIp_(WLAN2);
+ if (strip.compare("0.0.0.0") != 0) {
+ return strip;
+ }
+ strip = GetGwIp_(ETH1);
+ if (strip.compare("0.0.0.0") != 0) {
+ return strip;
+ }
+ strip = GetGwIp_(ETH2);
+ if (strip.compare("0.0.0.0") != 0) {
+ return strip;
+ }
+ strip = GetGwIp_(ETH0);
+ if (strip.compare("0.0.0.0") != 0) {
+ return strip;
+ }
+ strip = GetGwIp_(USB0);
+ if (strip.compare("0.0.0.0") != 0) {
+ return strip;
+ }
+ strip = GetGwIp_(WWAN0);
+ if (strip.compare("0.0.0.0") != 0) {
+ return strip;
+ }
+ //return strip;
}
std::string GetWorkNic()
@@ -308,8 +992,8 @@ std::string GetSysInfo()
system_custom(getMemFree, chRes);
std::string MemFree = std::string(chRes);
- float a = boost::lexical_cast(MemFree);
- float b = boost::lexical_cast(MemTotal);
+ float a = atof(MemFree.c_str());
+ float b = atof(MemTotal.c_str());
float c = (1 - a/b)*100;
const char * getEmmcInfo = "df -h | grep /dev/root";
@@ -323,7 +1007,7 @@ std::string GetSysInfo()
Emmcinfo = ClearAllSpace(Emmcinfo);
char sysinfo[128] = {0};
- sprintf(sysinfo, "%-13s%-13s%-13s%-13s ", boost::lexical_cast(c).substr(0,4).c_str(), CpuSys.c_str(), CpuUse.c_str(), Emmcinfo.c_str());
+ sprintf(sysinfo, "%-13s%-13s%-13s%-13s ", to_string(c).substr(0,4).c_str(), CpuSys.c_str(), CpuUse.c_str(), Emmcinfo.c_str());
return std::string(sysinfo);
}
@@ -443,10 +1127,8 @@ std::string GetFileContent(std::string filename, int line)
//BOOST用正则表达式验证ip地址合法
bool CheckIP(const char *ip)
{
- using namespace boost::xpressive;
- /* 定义正则表达式 */
- cregex reg_ip = cregex::compile("(25[0-5]|2[0-5][0-9]|1[0-9][0-9]|[1-9][0-9]|[1-9])[.](25[0-5]|2[0-5][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])[.](25[0-5]|2[0-5][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])[.](25[0-5]|2[0-5][0-9]|1[0-9][0-9]|[1-9][0-9]|[1-9])");
- return regex_match(ip, reg_ip);
+ boost::xpressive::cregex reg_ip = boost::xpressive::cregex::compile("(25[0-4]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[1-9])[.](25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])[.](25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])[.](25[0-4]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[1-9])");
+ return boost::xpressive::regex_match(ip, reg_ip);
}
bool IsValidMask(std::string mask) {
@@ -542,13 +1224,13 @@ bool IsValidMask(std::string mask) {
// jsData["memoryTotal"] = (int)mem_total;
// jsData["memoryFree"] = (int)mem_free;
// jsData["memoryUse"] = fMemRate * 100;
-// jsData["hardDiskTotal"] = boost::lexical_cast(strhardTotal.substr(0,strhardTotal.length() - 1));
-// jsData["hardDiskFree"] = boost::lexical_cast(strhardFree.substr(0,strhardFree.length() - 1));
+// jsData["hardDiskTotal"] = atof(strhardTotal.substr(0,strhardTotal.length() - 1));
+// jsData["hardDiskFree"] = atof(strhardFree.substr(0,strhardFree.length() - 1));
-// double total = boost::lexical_cast(strhardTotal.substr(0,strhardTotal.length() - 1));
-// double free = boost::lexical_cast(strhardFree.substr(0,strhardFree.length() - 1));
+// double total = atof(strhardTotal.substr(0,strhardTotal.length() - 1));
+// double free = atof(strhardFree.substr(0,strhardFree.length() - 1));
// double use = ((total - free) / free) * 100;
-// // jsData["hardDiskUse"] = boost::lexical_cast(strrateHardUse.substr(0,strrateHardUse.length() - 1));
+// // jsData["hardDiskUse"] = atof(strrateHardUse.substr(0,strrateHardUse.length() - 1));
// jsData["hardDiskUse"] = use;
// jsData["cpuSystemUse"] = rateSys;
// jsData["temperature"] = temperature;
@@ -566,7 +1248,40 @@ bool IsValidMask(std::string mask) {
// return 0;
// }
+double GetHardDiskFree()
+{
+ char hardName[32];
+ char hardTotal[32];
+ char hardUse[32];
+ char hardFree[32];
+ char rateHardUse[32];
+ const char * getEmmcInfo = "df -h | grep /opt";
+ char chRes[100];
+ memset(chRes, 0, 100);
+ system_custom(getEmmcInfo, chRes);
+ sscanf(chRes,"%s%s%s%s%s",hardName, hardTotal, hardUse, hardFree, rateHardUse);
+ std::string strhardTotal(hardTotal);
+ std::string strhardFree(hardFree);
+ std::string strrateHardUse(rateHardUse);
+ double freeDisk = atof(strhardFree.substr(0,strhardFree.length() - 1).c_str());
+ return freeDisk;
+}
+int getSysIntValue(char *key)
+{
+ FILE *fp = NULL;
+ int value = 0;
+ if(key == NULL)return 0;
+ fp = fopen(key, "r");
+ if (fp == NULL) {
+ printf("Error: could not open %s file\n",key);
+ return 1;
+ }
+
+ fscanf(fp, "%d", &value);
+ fclose(fp);fp = NULL;
+ return value;
+}
std::string GetSysStatus()
{
long mem_used = -1;
@@ -618,13 +1333,24 @@ std::string GetSysStatus()
const char * getEmmcInfo = "df -h | grep /opt";
char chRes[100];
memset(chRes, 0, 100);
+#ifdef IMX6UL_GATEWAY
system_custom(getEmmcInfo, chRes);
sscanf(chRes,"%s%s%s%s%s",hardName, hardTotal, hardUse, hardFree, rateHardUse);
+#endif
+#ifdef G2UL_GATEWAY
+ getDiskInfo(hardTotal,hardFree);
+#endif
+
std::string strhardTotal(hardTotal);
std::string strhardFree(hardFree);
std::string strrateHardUse(rateHardUse);
-
+ char key[128] = {0};
+ memset(key,0,sizeof(key));
+ sprintf(key,"/sys/class/thermal/thermal_zone0/temp");
+ int temp = getSysIntValue(key);
+
+ print_info("rateUser = %f,mem_total = %d,mem_free = %d,fMemRate = %f\n",rateUser,mem_total,mem_free,fMemRate);
Json::Value jsData;
Json::FastWriter fw;
jsData["dataNodeGatewayNo"] = GlobalConfig::MacAddr_G;
@@ -632,13 +1358,15 @@ std::string GetSysStatus()
jsData["memoryTotal"] = (int)mem_total;
jsData["memoryFree"] = (int)mem_free;
jsData["memoryUse"] = fMemRate * 100;
- jsData["hardDiskTotal"] = boost::lexical_cast(strhardTotal.substr(0,strhardTotal.length() - 1));
- jsData["hardDiskFree"] = boost::lexical_cast(strhardFree.substr(0,strhardFree.length() - 1));
+ jsData["hardDiskTotal"] = atof(strhardTotal.substr(0,strhardTotal.length() - 1).c_str());
+ jsData["hardDiskFree"] = atof(strhardFree.substr(0,strhardFree.length() - 1).c_str());
+ jsData["temperature"] = temp/1000.0;
+ jsData["temperatureNR5G"] = atoi(GlobalConfig::NR5GTemp.c_str());
- double total = boost::lexical_cast(strhardTotal.substr(0,strhardTotal.length() - 1));
- double free = boost::lexical_cast(strhardFree.substr(0,strhardFree.length() - 1));
+ double total = atof(strhardTotal.substr(0,strhardTotal.length() - 1).c_str());
+ double free = atof(strhardFree.substr(0,strhardFree.length() - 1).c_str());
double use = ((total - free) / total) * 100;
- // jsData["hardDiskUse"] = boost::lexical_cast(strrateHardUse.substr(0,strrateHardUse.length() - 1));
+ // jsData["hardDiskUse"] = atof(strrateHardUse.substr(0,strrateHardUse.length() - 1));
jsData["hardDiskUse"] = use;
jsData["cpuSystemUse"] = rateSys;
@@ -650,6 +1378,48 @@ std::string GetSysStatus()
return strJson;
}
+
+unsigned char ch2hex(char ch)
+{
+ static const char *hex="0123456789ABCDEF";
+ for(unsigned char i=0;i!=16;++i)
+ if(ch==hex[i])
+ return i;
+ return 0;
+}
+string tohex(const string& str)
+{
+ string ret;
+ static const char *hex="0123456789ABCDEF";
+ for(int i=0;i!=str.size();++i)
+ {
+ ret.push_back(hex[(str[i]>>4)&0xf]);
+ ret.push_back( hex[str[i]&0xf]);
+ }
+ return ret;
+}
+char* solve(char *dest,const char *src)
+{
+ int i=0;
+ int cnt=0;
+ unsigned char*d=(unsigned char*)dest;
+ while(*src)
+ {
+ if(i&1)
+ {
+ d[cnt++]|=ch2hex(*src);
+ }
+ else
+ {
+ d[cnt]=ch2hex(*src)<<4;
+ }
+ src++;
+ i++;
+ }
+ return dest;
+}
+
+
void swap(char *data)
{
int tmp;
@@ -657,6 +1427,928 @@ void swap(char *data)
data[1] = data[0];
data[0] = tmp;
}
+int OpenWatchDog()
+{
+ int fd = -1;
+ InitGpio(GlobalConfig::GPIO_G.hardWatchDog,1);
+ gpio_set(GlobalConfig::GPIO_G.hardWatchDog,1);//高电平有效
+ if(0 >(fd = open("/dev/watchdog",O_WRONLY))){
+ print_info("Failed:Open /dev/watchdog");
+ }
+ return fd;
+
+}
+int WriteWatchDog(int fd)
+{
+ if(1 != write(fd,"0",1)){
+ print_info("Failed:feeding watchdog");
+ }
+}
+int CloseWatchDog(int fd)
+{
+ close(fd);
+}
+string TrimStringLeft(const char* szData, const char* szTargets)
+{
+ string strData = szData;
+ int nPos = 0;
+ nPos = strData.find(szTargets);
+ while (nPos == 0)
+ {
+ strData.erase(nPos, 1);
+ nPos = strData.find(szTargets);
+ }
+ return strData;
+}
+
+string TrimStringRight(const char* szData, const char* szTargets)
+{
+ string strData = szData;
+ int nPos = 0;
+ nPos = strData.rfind(szTargets);
+ while ((nPos == (int)(strData.size() - 1)) && (nPos >= 0))
+ {
+ strData.erase(nPos, 1);
+ nPos = strData.rfind(szTargets);
+ }
+ return strData;
+}
+string GetOneContent(const char* szData, int nRow, const char* szSeparate)
+{
+ string strParam = "";
+ string strTemp = szData;
+ int nFirstPos = -1;
+ for (int i = 0; i < nRow; i++)
+ {
+ nFirstPos = strTemp.find(szSeparate, nFirstPos + 1);
+ if (nFirstPos < 0)
+ return strParam.c_str();
+ }
+
+ int nSecondPos = strTemp.find(szSeparate, nFirstPos + 1);
+ if (nSecondPos < 0)
+ {
+ strParam = strTemp.substr(nFirstPos + 1);
+ }
+ else
+ {
+ strParam = strTemp.substr(nFirstPos + 1, nSecondPos - nFirstPos - 1);
+ }
+
+ {
+ strParam = TrimStringRight(strParam.c_str(), " ");
+ strParam = TrimStringLeft(strParam.c_str(), " ");
+ }
+ return strParam.c_str();
+}
+int set_opt(int fd,int nSpeed, int nBits, char nEvent, int nStop)
+{
+ struct termios newtio,oldtio;
+ if ( tcgetattr( fd,&oldtio) != 0) { //检测串口是否可用
+ perror("SetupSerial 1");
+ return -1;
+ }
+ bzero( &newtio, sizeof( newtio ) );
+ newtio.c_cflag |= CLOCAL | CREAD;
+ newtio.c_cflag &= ~CSIZE;
+
+ switch( nBits ) //设置数据位
+ {
+ case 7:
+ newtio.c_cflag |= CS7;
+ break;
+ case 8:
+ newtio.c_cflag |= CS8;
+ break;
+ }
+
+ switch( nEvent )//设置检验位
+ {
+ case 'O':
+ newtio.c_cflag |= PARENB;
+ newtio.c_cflag |= PARODD;
+ newtio.c_iflag |= (INPCK | ISTRIP);
+ break;
+ case 'E':
+ newtio.c_iflag |= (INPCK | ISTRIP);
+ newtio.c_cflag |= PARENB;
+ newtio.c_cflag &= ~PARODD;
+ break;
+ case 'N':
+ newtio.c_cflag &= ~PARENB;
+ break;
+ }
+
+ switch( nSpeed ) //设置波特率
+ {
+ case 2400:
+ cfsetispeed(&newtio, B2400);
+ cfsetospeed(&newtio, B2400);
+ break;
+ case 4800:
+ cfsetispeed(&newtio, B4800);
+ cfsetospeed(&newtio, B4800);
+ break;
+ case 9600:
+ cfsetispeed(&newtio, B9600);
+ cfsetospeed(&newtio, B9600);
+ break;
+ case 115200:
+ cfsetispeed(&newtio, B115200);
+ cfsetospeed(&newtio, B115200);
+ break;
+ case 460800:
+ cfsetispeed(&newtio, B460800);
+ cfsetospeed(&newtio, B460800);
+ break;
+ default:
+ cfsetispeed(&newtio, B9600);
+ cfsetospeed(&newtio, B9600);
+ break;
+ }
+ if( nStop == 1 )//设置停止位
+ newtio.c_cflag &= ~CSTOPB;
+ else if ( nStop == 2 )
+ newtio.c_cflag |= CSTOPB;
+ newtio.c_cc[VTIME] = 0;
+ newtio.c_cc[VMIN] = 0;
+ tcflush(fd,TCIFLUSH);
+ if((tcsetattr(fd,TCSANOW,&newtio))!=0) //设置串口参数
+ {
+ perror("com set error");
+ return -1;
+ }
+ return 0;
+}
+
+int getcsq()
+{
+ /*int fd = config_uart("/dev/ttyUSB2",115200);
+ print_info("fd = %d\n",fd);
+ if(fd < 0){
+ printf("config_uart error\n");
+ }
+ int len = write_data(fd,"AT+QENG=\"servingcell\"\r\n",27);
+
+ sleep(1);
+ unsigned char rbuf[128]={0x00};
+ len = read_data(fd,(char*)rbuf,100,10);
+ if(len < 0) {
+ print_info("Can't get /dev/ttyUSBx Serial Port data!\n");
+ }
+ print_info("rbuf = %s\n",(char*)rbuf);
+ close(fd);*/
+
+ int ret = 0;
+ char csq[128] = {0};
+
+ int fd = 0, sig = 0;
+
+ if((fd = open("/dev/ttyUSB2", O_RDWR | O_NOCTTY | O_NDELAY))<0){
+
+ //LOG_ERROR("open %s is FAILED\n\n","/dev/ttyUSB2");
+ }
+ else{
+ set_opt(fd, 9600, 8, 'N', 1);
+ }
+ set_opt(fd, 115200, 8, 'N', 1);
+
+ //write(fd,"AT+QENG=\"servingcell\"\r\n",27);//开启定位
+ write(fd,"AT+CSQ",6);
+ sleep(1);
+ unsigned char rbuf[128]={0x00};
+ int len = read(fd, rbuf, sizeof(rbuf)); // 在串口读入字符串
+
+ print_info("rbuf = %s,len = %d\n",rbuf,len);
+ sleep(1);
+ if(len < 0) {
+ print_info("Can't get /dev/ttyUSBx Serial Port data!\n");
+ }
+
+ const char *str2 = "+QENG: ";
+ char *pdata = strstr((char*)rbuf, str2);
+ if(pdata)
+ strncpy(csq, pdata+7, sizeof(csq));
+ else {
+ return -1;
+ }
+ //printf("SIM-CSQ: %s\n", csq);
+ GlobalConfig::NetStatus = GetOneContent(csq,1,",");
+ string signal = GetOneContent(csq,13,",");
+ GlobalConfig::NetSignal = atoi(signal.c_str());
+ print_info("NetStatus = %s,NetSignal = %d\n",GlobalConfig::NetStatus.c_str(),GlobalConfig::NetSignal);
+ // ret = csq
+ close(fd);
+ /*if(csq[0] == ',')
+ ret = 0;
+ else if(csq[1] == ',')
+ ret = (int)csq[0] - '0';
+ else if(csq[2] == ',')
+ ret = ((int)csq[0] - '0')*10 + (int)csq[1] - '0';
+
+ print_info("sig = %d\n", ret);*/
+ return atoi(signal.c_str());
+
+/*
+ int level;
+ char *str = NULL;
+ if (strstr(csq, "99,") || strstr(csq, "199,") ){
+ printf("No signal ..\n");
+ level = 0;
+ }
+ else {
+ char rssi_str[4];
+ int rssi;
+ memset(rssi_str, 0, sizeof(rssi_str));
+ if (*(csq+2) == ',') {
+ rssi_str[0] = *(csq+0+0);
+ rssi_str[1] = *(csq+0+1);
+ }
+ else if (isdigit(*(csq+2)) && isdigit(*(csq+3) == ',')) {
+ rssi_str[0] = *(csq+0+0);
+ rssi_str[1] = *(csq+0+1);
+ rssi_str[2] = *(csq+0+2);
+ }
+ rssi = atoi(rssi_str);
+
+printf("rssi = %d\n", rssi);
+
+ int signal = -113 + (2 * rssi);
+ if(signal > -91)
+ level = 5;
+ else if (signal <= -91 && signal > -101)
+ level = 4;
+ else if(signal <= -101 && signal > -103)
+ level = 3;
+ else if(signal <= -103 && signal > -107)
+ level = 2;
+ else if(signal <= -107 && signal > -113)
+ level = 1;
+ else
+ level = 0;
+ printf("level = %d, signal: %d\n", rssi, signal);
+ }
+*/
+
+}
+void IniReadValue(char* section, char* key, char* val, const char* file)
+{
+ FILE* fp;
+ int i = 0;
+ int lineContentLen = 0;
+ int position = 0;
+ char lineContent[LINE_CONTENT_MAX_LEN];
+ bool bFoundSection = false;
+ bool bFoundKey = false;
+ fp = fopen(file, "r");
+ if(fp == NULL)
+ {
+ printf("%s: Opent file %s failed.\n", __FILE__, file);
+ return;
+ }
+ while(feof(fp) == 0)
+ {
+ memset(lineContent, 0, LINE_CONTENT_MAX_LEN);
+ fgets(lineContent, LINE_CONTENT_MAX_LEN, fp);
+ if((lineContent[0] == ';') || (lineContent[0] == '\0') || (lineContent[0] == '\r') || (lineContent[0] == '\n'))
+ {
+ continue;
+ }
+
+ //check section
+ if(strncmp(lineContent, section, strlen(section)) == 0)
+ {
+ bFoundSection = true;
+ //printf("Found section = %s\n", lineContent);
+ while(feof(fp) == 0)
+ {
+ memset(lineContent, 0, LINE_CONTENT_MAX_LEN);
+ fgets(lineContent, LINE_CONTENT_MAX_LEN, fp);
+ //check key
+ if(strncmp(lineContent, key, strlen(key)) == 0)
+ {
+ bFoundKey = true;
+ lineContentLen = strlen(lineContent);
+ //find value
+ for(i = strlen(key); i < lineContentLen; i++)
+ {
+ if(lineContent[i] == '=')
+ {
+ position = i + 1;
+ break;
+ }
+ }
+ if(i >= lineContentLen) break;
+ strncpy(val, lineContent + position, strlen(lineContent + position));
+ lineContentLen = strlen(val);
+ for(i = 0; i < lineContentLen; i++)
+ {
+ if((lineContent[i] == '\0') || (lineContent[i] == '\r') || (lineContent[i] == '\n'))
+ {
+ val[i] = '\0';
+ break;
+ }
+ }
+ }
+ else if(lineContent[0] == '[')
+ {
+ break;
+ }
+ }
+ break;
+ }
+ }
+ if(!bFoundSection){printf("No section = %s\n", section);}
+ else if(!bFoundKey){printf("No key = %s\n", key);}
+ fclose(fp);
+}
+
+int readStringValue(const char* section, char* key, char* val, const char* file)
+{
+ char sect[SECTION_MAX_LEN];
+ //printf("section = %s, key = %s, file = %s\n", section, key, file);
+ if (section == NULL || key == NULL || val == NULL || file == NULL)
+ {
+ printf("%s: input parameter(s) is NULL!\n", __func__);
+ return -1;
+ }
+
+ memset(sect, 0, SECTION_MAX_LEN);
+ sprintf(sect, "[%s]", section);
+ //printf("reading value...\n");
+ IniReadValue(sect, key, val, file);
+
+ return 0;
+}
+
+int readIntValue(const char* section, char* key, const char* file)
+{
+ char strValue[STRVALUE_MAX_LEN];
+ memset(strValue, '\0', STRVALUE_MAX_LEN);
+ if(readStringValue(section, key, strValue, file) != 0)
+ {
+ printf("%s: error", __func__);
+ return 0;
+ }
+ return(atoi(strValue));
+}
+
+void IniWriteValue(const char* section, char* key, char* val, const char* file)
+{
+ FILE* fp;
+ int i = 0, n = 0, err = 0;
+ int lineContentLen = 0;
+ int position = 0;
+ char lineContent[LINE_CONTENT_MAX_LEN];
+ char strWrite[LINE_CONTENT_MAX_LEN];
+ bool bFoundSection = false;
+ bool bFoundKey = false;
+
+ memset(lineContent, '\0', LINE_CONTENT_MAX_LEN);
+ memset(strWrite, '\0', LINE_CONTENT_MAX_LEN);
+ n = sprintf(strWrite, "%s=%s\n", key, val);
+ fp = fopen(file, "r+");
+ if(fp == NULL)
+ {
+ printf("%s: Opent file %s failed.\n", __FILE__, file);
+ return;
+ }
+ while(feof(fp) == 0)
+ {
+ memset(lineContent, 0, LINE_CONTENT_MAX_LEN);
+ fgets(lineContent, LINE_CONTENT_MAX_LEN, fp);
+ if((lineContent[0] == ';') || (lineContent[0] == '\0') || (lineContent[0] == '\r') || (lineContent[0] == '\n'))
+ {
+ continue;
+ }
+ //check section
+ if(strncmp(lineContent, section, strlen(section)) == 0)
+ {
+ bFoundSection = true;
+ while(feof(fp) == 0)
+ {
+ memset(lineContent, 0, LINE_CONTENT_MAX_LEN);
+ fgets(lineContent, LINE_CONTENT_MAX_LEN, fp);
+ //check key
+ if(strncmp(lineContent, key, strlen(key)) == 0)
+ {
+ bFoundKey = true;
+ printf("%s: %s=%s\n", __func__, key, val);
+ fseek(fp, (0-strlen(lineContent)),SEEK_CUR);
+ err = fputs(strWrite, fp);
+ if(err < 0){printf("%s err.\n", __func__);}
+ break;
+ }
+ else if(lineContent[0] == '[')
+ {
+ break;
+ }
+ }
+ break;
+ }
+ }
+ if(!bFoundSection){printf("No section = %s\n", section);}
+ else if(!bFoundKey){printf("No key = %s\n", key);}
+ fclose(fp);
+}
+
+int writeStringVlaue(const char* section, char* key, char* val, const char* file)
+{
+ char sect[SECTION_MAX_LEN];
+ //printf("section = %s, key = %s, file = %s\n", section, key, file);
+ if (section == NULL || key == NULL || val == NULL || file == NULL)
+ {
+ printf("%s: input parameter(s) is NULL!\n", __func__);
+ return -1;
+ }
+ memset(sect, '\0', SECTION_MAX_LEN);
+ sprintf(sect, "[%s]", section);
+ IniWriteValue(sect, key, val, file);
+}
+
+int writeIntValue(const char* section, char* key, int val, const char* file)
+{
+ char strValue[STRVALUE_MAX_LEN];
+ memset(strValue, '\0', STRVALUE_MAX_LEN);
+ sprintf(strValue, "%-4d", val);
+
+ writeStringVlaue(section, key, strValue, file);
+}
+
+int getDiskInfo(char* diskTotal,char* diskFree)
+{
+ DISK diskInfo;
+// pDISK pDiskInfo;
+// char dpath[100]="/";//设置默认位置
+// int flag=0;
+// if(NULL!=path)
+// {
+// strcpy(dpath,path);
+// }
+// if(-1==(flag=statfs("/tmp",pDiskInfo)))//获取包含磁盘空间信息的结构体
+// {
+// perror("getDiskInfo statfs fail");
+// return 0;
+// }
+// unsigned long long total=0,avail=0,free=0,blockSize=0;
+//
+// blockSize=pDiskInfo->f_bsize;//每块包含字节大小
+// total=pDiskInfo->f_blocks*blockSize;//磁盘总空间
+// avail=pDiskInfo->f_bavail*blockSize;//非超级用户可用空间
+// free=pDiskInfo->f_bfree*blockSize;//磁盘所有剩余空间
+// //字符串转换
+// char diskTotal[30],diskAvail[30],diskFree[30];
+// flag=sprintf(diskTotal,"%llu",total>>20);
+// flag=sprintf(diskAvail,"%llu",avail>>20);
+// flag=sprintf(diskFree,"%llu",free>>20);
+// print_info("diskTotal = %s,diskAvail = %s,diskFree = %s\n",diskTotal,diskAvail,diskFree);
+// if(-1==flag)
+// {
+// return 0;
+// }
+ /* 1.获取/home/下面的总容量 */
+ statfs("/", &diskInfo);
+ unsigned long long blocksize = diskInfo.f_bsize; //每个block里包含的字节数
+ unsigned long long totalsize = blocksize * diskInfo.f_blocks;//总的字节数,f_blocks为block的数目
+ //printf("Total_size=%llu B =%llu KB =%llu MB = %llu GB\n",\
+ totalsize,totalsize>>10,totalsize>>20, totalsize>>30);
+
+ /* 2.获取一下剩余空间和可用空间的大小 */
+ unsigned long long freeDisk = diskInfo.f_bfree * blocksize; //剩余空间的大小
+ unsigned long long availableDisk = diskInfo.f_bavail * blocksize; //可用空间大小
+ //printf("Disk_free=%llu MB =%llu GB Disk_available=%llu MB = %llu GB\n",\
+ freeDisk>>20,freeDisk>>30,availableDisk>>20, availableDisk>>30);
+ sprintf(diskTotal,"%llu",totalsize>>20);
+ sprintf(diskFree,"%llu",freeDisk>>20);
+ return 1;
+}
+bool NetIsOk()
+{
+
+ double rtt;
+ struct hostent *host;
+ struct protoent *protocol;
+ int i,recv_status;
+
+#ifdef _USE_DNS //如果定义该宏,则可以使用域名进行判断网络连接,例如www.baidu.com
+ /* 设置目的地址信息 */
+ char hostname[32];
+ sprintf(hostname,"%s","www.baidu.com")
+ bzero(&dest_addr, sizeof(dest_addr));
+ dest_addr.sin_family = AF_INET;
+
+ if((host=gethostbyname(hostname))==NULL)
+ {
+ LOG_ERROR("[NetStatus] error : Can't get serverhost info!\n");
+ return false;
+ }
+
+ bcopy((char*)host->h_addr,(char*)&dest_addr.sin_addr,host->h_length);
+#else //如果不使用域名,则只能用ip地址直接发送icmp包,
+ dest_addr.sin_addr.s_addr = inet_addr(GlobalConfig::ServerIP.c_str());
+#endif
+
+
+ if ((sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP)) < 0)
+ { /* 创建原始ICMP套接字 */
+ LOG_ERROR("[NetStatus] error : socket %d\n",sockfd);
+ return false;
+ }
+
+ int iFlag;
+ if(iFlag = fcntl(sockfd,F_GETFL,0)<0)
+ {
+ LOG_ERROR("[NetStatus] error : fcntl(sockfd,F_GETFL,0)");
+ _CloseSocket();
+ return false;
+ }
+ iFlag |= O_NONBLOCK;
+ if(iFlag = fcntl(sockfd,F_SETFL,iFlag)<0)
+ {
+ LOG_ERROR("[NetStatus] error : fcntl(sockfd,F_SETFL,iFlag )");
+ _CloseSocket();
+ return false;
+ }
+ print_info("================NetIsOk check=============\n");
+ pid=getpid();
+ for(i=0;i0)
+ {
+ _CloseSocket();
+ return true;
+ }
+
+ }
+ _CloseSocket();
+ return false;
+}
+
+
+
+int send_packet(int pkt_no,char *sendpacket)
+{
+ int packetsize;
+ packetsize=pack(pkt_no,sendpacket);
+ gettimeofday(&tvsend,NULL);
+ print_info("================NetIsOk send_packet=============\n");
+ if(sendto(sockfd,sendpacket,packetsize,0,(struct sockaddr *)&dest_addr,sizeof(dest_addr) )<0)
+ {
+ LOG_ERROR("[NetStatus] error : sendto error");
+ return -1;
+ }
+ return 1;
+}
+
+
+int pack(int pkt_no,char*sendpacket)
+{
+ int i,packsize;
+ struct icmp *icmp;
+ struct timeval *tval;
+ icmp=(struct icmp*)sendpacket;
+ icmp->icmp_type=ICMP_ECHO; //设置类型为ICMP请求报文
+ icmp->icmp_code=0;
+ icmp->icmp_cksum=0;
+ icmp->icmp_seq=pkt_no;
+ icmp->icmp_id=pid; //设置当前进程ID为ICMP标示符
+ packsize=ICMP_HEADSIZE+sizeof(struct timeval);
+ tval= (struct timeval *)icmp->icmp_data;
+ gettimeofday(tval,NULL);
+ icmp->icmp_cksum=cal_chksum( (unsigned short *)icmp,packsize);
+ return packsize;
+}
+
+
+unsigned short cal_chksum(unsigned short *addr,int len)
+{
+ int nleft=len;
+ int sum=0;
+ unsigned short *w=addr;
+ unsigned short answer=0;
+ while(nleft>1) //把ICMP报头二进制数据以2字节为单位累加起来
+ {
+ sum+=*w++;
+ nleft-=2;
+ }
+ if( nleft==1) //若ICMP报头为奇数个字节,会剩下最后一字节.把最后一个字节视为一个2字节数据的高字节,这个2字节数据的低字节为0,继续累加
+ {
+ *(unsigned char *)(&answer)=*(unsigned char *)w;
+ sum+=answer;
+ }
+ sum=(sum>>16)+(sum&0xffff);
+ sum+=(sum>>16);
+ answer=~sum;
+ return answer;
+}
+
+
+int recv_packet(int pkt_no,char *recvpacket)
+{
+ int n;
+ fd_set rfds;
+ FD_ZERO(&rfds);
+ FD_SET(sockfd,&rfds);
+ signal(SIGALRM,timeout);
+ unsigned int fromlen=sizeof(recv_addr);
+ alarm(MAX_WAIT_TIME);
+ print_info("================NetIsOk recv_packet=============\n");
+ while(1)
+ {
+ select(sockfd+1, &rfds, NULL, NULL, NULL);
+ if (FD_ISSET(sockfd,&rfds))
+ {
+ if( (n=recvfrom(sockfd,recvpacket,PACKET_SIZE,0,(struct sockaddr *)&recv_addr,&fromlen)) <0)
+ {
+ print_info("================NetIsOk recvfrom=============errno = %d\n",errno);
+ if(errno==EINTR){
+ return -1;
+ LOG_ERROR("recvfrom error");
+ return -2;
+ }
+ }
+ }
+ gettimeofday(&tvrecv,NULL);
+ if(unpack(pkt_no,recvpacket,n)==-1)
+ continue;
+ return 1;
+ }
+}
+
+int unpack(int cur_seq,char *buf,int len)
+{
+ int iphdrlen;
+ struct ip *ip;
+ struct icmp *icmp;
+ ip=(struct ip *)buf;
+ iphdrlen=ip->ip_hl<<2; //求ip报头长度,即ip报头的长度标志乘4
+ icmp=(struct icmp *)(buf+iphdrlen); //越过ip报头,指向ICMP报头
+ len-=iphdrlen; //ICMP报头及ICMP数据报的总长度
+ if( len<8)
+ return -1;
+ if( (icmp->icmp_type==ICMP_ECHOREPLY) && (icmp->icmp_id==pid) && (icmp->icmp_seq==cur_seq))
+ return 0;
+ else return -1;
+}
+
+
+void timeout(int signo)
+{
+ LOG_ERROR("Request Timed Out\n");
+ _CloseSocket();
+}
+
+void tv_sub(struct timeval *out,struct timeval *in)
+{
+ if( (out->tv_usec-=in->tv_usec)<0)
+ {
+ --out->tv_sec;
+ out->tv_usec+=1000000;
+ }
+ out->tv_sec-=in->tv_sec;
+}
+
+void _CloseSocket()
+{
+ close(sockfd);
+ sockfd = 0;
+}
+
+int socketHeart(const char* pSendData)
+{
+ print_info("socketHeart\n");
+ int sockfd; // Socket文件描述符
+ struct sockaddr_in serverAddr{}; // Server地址结构体
+
+ // 创建Socket
+ if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
+ std::cerr << "Failed to create socket." << std::endl;
+ return 1;
+ }
+
+ // 设置Server地址信息
+ serverAddr.sin_family = AF_INET;
+ serverAddr.sin_port = htons(18393); // TCP默认端口号为80
+ inet_pton(AF_INET, /*GlobalConfig::ServerIP.c_str()*/"192.168.1.147", &serverAddr.sin_addr);
+
+ // 连接到Server
+ if (connect(sockfd, reinterpret_cast(&serverAddr), sizeof(serverAddr)) == -1) {
+ std::cerr << "Failed to connect to the server." << std::endl;
+ close(sockfd);
+ return 1;
+ }
+
+ // 发送心跳数据包
+ const char heartbeat[] = "Heartbeat";
+ ssize_t bytesSent = send(sockfd, pSendData, strlen(pSendData), MSG_NOSIGNAL);
+ if (bytesSent == -1) {
+ std::cerr << "Failed to send heartbeat packet." << std::endl;
+ close(sockfd);
+ return 1;
+ } else if (static_cast(bytesSent) != strlen(pSendData)) {
+ std::cerr << "Partially sent heartbeat packet." << std::endl;
+ close(sockfd);
+ return 1;
+ }
+
+ // 关闭Socket连接
+ close(sockfd);
+
+ return 0;
+}
+//unsigned short cal_chksum(unsigned short *addr, int len)
+//{
+// int nleft=len;
+// int sum=0;
+// unsigned short *w=addr;
+// unsigned short answer=0;
+//
+// while(nleft > 1)
+// {
+// sum += *w++;
+// nleft -= 2;
+// }
+//
+// if( nleft == 1)
+// {
+// *(unsigned char *)(&answer) = *(unsigned char *)w;
+// sum += answer;
+// }
+//
+// sum = (sum >> 16) + (sum & 0xffff);
+// sum += (sum >> 16);
+// answer = ~sum;
+//
+// return answer;
+//}
+
+// Ping函数,timeout为超时时间,单位是ms,10000 毫秒=10 秒
+//成功:返回0,失败:返回1或-1
+int Ping( const char *ips, int timeout)
+{
+ struct timeval *tval;
+ int maxfds = 0;
+ fd_set readfds;
+
+ int iRet = 0;
+ struct sockaddr_in addr;
+ struct sockaddr_in from;
+ // 设定Ip信息
+ bzero(&addr,sizeof(addr));
+ addr.sin_family = AF_INET;
+
+ addr.sin_addr.s_addr = inet_addr(ips);
+
+ int sockfd;
+ // 取得socket 。 如果没加sudo 这里会报错
+ sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
+ if (sockfd < 0)
+ {
+ print_error("ip:%s,socket error\n",ips);
+ return -1;
+ }
+
+ struct timeval timeo;
+ // 设定TimeOut时间
+ timeo.tv_sec = timeout / 1000;
+ timeo.tv_usec = timeout % 1000;
+
+ if (setsockopt(sockfd, SOL_SOCKET, SO_SNDTIMEO, &timeo, sizeof(timeo)) == -1)
+ {
+ print_error("ip:%s,setsockopt error\n",ips);
+ close(sockfd);
+ return -1;
+ }
+
+ char sendpacket[2048];
+ char recvpacket[2048];
+ // 设定Ping包
+ memset(sendpacket, 0, sizeof(sendpacket));
+
+ pid_t pid;
+ // 取得PID,作为Ping的Sequence ID
+ pid=getpid();
+
+ struct ip *iph;
+ struct icmp *icmp;
+
+
+ icmp=(struct icmp*)sendpacket;
+ icmp->icmp_type=ICMP_ECHO; //回显请求
+ icmp->icmp_code=0;
+ icmp->icmp_cksum=0;
+ icmp->icmp_seq=0;
+ icmp->icmp_id=pid;
+ tval= (struct timeval *)icmp->icmp_data;
+ gettimeofday(tval,NULL);
+ icmp->icmp_cksum=cal_chksum((unsigned short *)icmp,sizeof(struct icmp)); //校验
+
+ int n = sendto(sockfd, (char *)&sendpacket, sizeof(struct icmp), 0, (struct sockaddr *)&addr, sizeof(addr));
+ if (n < 1)
+ {
+ print_error("ip:%s,sendto error\n",ips);
+ close(sockfd);
+ return -1;
+ }
+
+ // 接受
+ // 由于可能接受到其他Ping的应答消息,所以这里要用循环
+ int cnt=0;
+ while(1)
+ {
+ // 设定TimeOut时间,这次才是真正起作用的
+ FD_ZERO(&readfds);
+ FD_SET(sockfd, &readfds);
+ maxfds = sockfd + 1;
+ n = select(maxfds, &readfds, NULL, NULL, &timeo);
+ if (n <= 0)
+ {
+ print_info("ip:%s,Time out error\n",ips);
+ close(sockfd);
+ iRet = -1;
+ break;
+ }
+
+ // 接受
+ memset(recvpacket, 0, sizeof(recvpacket));
+ int fromlen = sizeof(from);
+ n = recvfrom(sockfd, recvpacket, sizeof(recvpacket), 0, (struct sockaddr *)&from, (socklen_t *)&fromlen);
+ print_info("recvfrom Len:%d\n",n);
+ if (n < 1)
+ {
+ close(sockfd);
+ iRet = 1;
+ break;
+ }
+
+ char *from_ip = (char *)inet_ntoa(from.sin_addr);
+ // 判断是否是自己Ping的回复
+ if (strcmp(from_ip,ips) != 0)
+ {
+ print_info("NowPingip:%s Fromip:%s NowPingip is not same to Fromip,so ping wrong!\n",ips,from_ip);
+ close(sockfd);
+ iRet = 1;
+ break;
+
+ }
+
+ iph = (struct ip *)recvpacket;
+
+ icmp=(struct icmp *)(recvpacket + (iph->ip_hl<<2));
+
+ print_info("ip:%s,icmp->icmp_type:%d,icmp->icmp_id:%d\n",ips,icmp->icmp_type,icmp->icmp_id);
+ // 判断Ping回复包的状态
+ if (icmp->icmp_type == ICMP_ECHOREPLY && icmp->icmp_id == pid) //ICMP_ECHOREPLY回显应答
+ {
+ // 正常就退出循环
+ print_info("icmp succecss ............. \n");
+ break;
+ }
+ else if(cnt<3)
+ {
+ // 否则继续等
+ cnt++;
+ continue;
+ }
+ else
+ {
+ close(sockfd);
+ iRet = -1;
+ break;
+ }
+ }
+ close(sockfd);
+ return iRet;
+}
+int get_netlink_status(const char *if_name)
+{
+ int skfd;
+ struct ifreq ifr;
+ struct ethtool_value edata;
+ edata.cmd = ETHTOOL_GLINK;
+ edata.data = 0;
+ memset(&ifr, 0, sizeof(ifr));
+ strncpy(ifr.ifr_name, if_name, sizeof(ifr.ifr_name) - 1);
+ ifr.ifr_data = (char *)&edata;
+ if ((skfd = socket(AF_INET, SOCK_DGRAM, 0)) == 0)
+ return -1;
+ if (ioctl(skfd, SIOCETHTOOL, &ifr) == -1)
+ {
+ close(skfd);
+ return -1;
+ }
+ close(skfd);
+ return edata.data;
+}
+
static const char* JSON_FIELD_CMD = "cmd";//协议: 命令字段
static const char* JSON_FIELD_NAME = "dataWatchName";//协议: 终端名称
diff --git a/common/SH_CommonFunc.hpp b/common/SH_CommonFunc.hpp
index 12bb465..b3bb258 100644
--- a/common/SH_CommonFunc.hpp
+++ b/common/SH_CommonFunc.hpp
@@ -26,10 +26,19 @@
#include //ipc
#include
#include "dirent.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include "Mutex.h"
+typedef struct statfs DISK,*pDISK;
-
-
+#define SECTION_MAX_LEN 256
+#define STRVALUE_MAX_LEN 256
+#define LINE_CONTENT_MAX_LEN 256
//配置文件位置
#define NETWORK "/etc/network/interfaces"
#define SYSTEMINFOFILE "/opt/configenv/SystemInfo.json" //系统信息
@@ -43,6 +52,7 @@
#define SN "/opt/system/sn" //设备序列号
#define SYSTEMSTART "/opt/system/start" //系统启动类型标志 0:正常启动 1:重启 2:
#define BUILD_UINT16(x,y) (((x & 0x00FFu) << 8u) | (y & 0x00FFu))
+#define BUILD_UINT2(x,y) (((x) << 2u) | (y))
// 生成UINT32 数据
#define BUILD_UINT32(u,v,x,y) (((u & 0x00FFu) << 24u) | (v & 0x00FFu) << 16u) | (((x & 0x00FFu) << 8u) | (y & 0x00FFu))
// 获取UINT32的高低字节
@@ -50,16 +60,18 @@
#define UINT32_HIGH_2(x) ((x & 0x00FF0000u) >> 16u)
#define UINT32_LOW_1(x) ((x & 0x0000FF00u) >> 8u)
#define UINT32_LOW_2(x) ((x & 0x000000FFu))
-
+#define GET_BIT(x, bit) ((x & (1 << bit)) >> bit) /* 获取第bit位 */
// 获取UINT32的高低字节
#define UINT16_HIGH(x) ((x & 0xFF00u) >> 8u)
#define UINT16_LOW(x) ((x & 0x00FFu))
-#define onlineCheck 21600
#define GENERAL_BUF_SIZE 128*1024*10
using namespace std;
+
+
+
enum TIME_SIZE{
TIME_MINUTE=5,
TIME_SECEOND=8
@@ -108,6 +120,8 @@ struct ZigbeeInfo {
std::string PanID;
std::string MyAddr;
std::string DstAddr;
+ std::string RetryNum;
+ std::string TranTimeout;
};
struct ZIGBEE {
@@ -183,7 +197,9 @@ struct DataNodeInfo {
std::string ConfigDate;//配置时间
int VIntegralFilterFrequency;//速度积分滤波频率
-
+ DataNodeInfo(){
+ FeatureInterVal = 0;WaveInterVal = 0;
+ }
};
@@ -205,6 +221,7 @@ struct DataRecvDym {
float Amp3;
float Amp4;
float Amp5;
+ long Time;
float Phase1;
float Phase2;
float Phase3;
@@ -221,6 +238,7 @@ struct TopicList{
std::string mPubWaveSecondData; //原始数据发布主题
std::string mPubCmd; //命令控制发布主题
std::string mPubRep;
+ std::string mPubTiming; //校时
std::string mPubLocalWifi;
std::string mPubLocalWaveServer;
@@ -263,6 +281,25 @@ typedef struct {
} WAVE_GENERAL;
+typedef struct{
+ int zigAckrep;
+ int zigAckreset;
+ int zigReset;
+ int zigDef;
+ int alarmLight;
+ int commPower;//4G,5G 电源开关
+ int vol3_8;//5G 3.8v电源
+ int commRest;//4G,5G复位
+ int wifiPower;//WiFi 电源开关
+ int wifiReset;//WiFi 复位
+ int hardWatchDog;
+ int power;
+ int runLed;
+ int errorLed;
+ int netResetNet0;
+ int netResetNet1;
+} GPIOInfo;
+
struct Param_01 {
int mMode; //0:登陆 1:更改密码
std::string mUserName;
@@ -302,7 +339,10 @@ struct Param_23 {
std::string mServerIp;
std::string mPort;
std::string mCommMode; // 通信模式,有线通信模式 = 1;4G LTE 无线通信模式 = 2
- Param_23():mMode(0),mCmdSerial(""), mServerIp(""),mPort(""),mCommMode(""){};
+ std::string mUserName;
+ std::string mPassword;
+ std::string mAPN;
+ Param_23():mMode(0),mCmdSerial(""), mServerIp(""),mPort(""),mCommMode(""),mUserName("chaos"),mPassword("HSD272*#xkd"),mAPN(""){};
};
@@ -317,6 +357,7 @@ struct Param_24 {
struct Param_25 {
int mMode;
+ std::string mNet;
std::string mCmdSerial;
std::string mDnsName;
std::string mNetworkPortStatus;
@@ -327,12 +368,29 @@ struct Param_25 {
Param_25():mMode(0),mCmdSerial(""), mDnsName(""),mGateway(""),mSubnetMask(""),mIp(""),mHostName(""){};
};
-
+struct Param_09 {
+ int mPackageFlag;
+ Param_09():mPackageFlag(0){};
+};
+struct Param_10 {
+ std::string strDataNode;
+ std::string strStatic;
+ std::string straxis;
+ std::string timeStart;
+ std::string timeEnd;
+ int mPackageFlag;
+ Param_10():strDataNode(""),strStatic(""),mPackageFlag(0){};
+};
+struct Param_11 {
+ std::string DataNodeNo;
+ Param_11():DataNodeNo(""){};
+};
struct Param_26 {
int mMode;
std::string mCmdSerial;
std::string mDataNodeNo;
- Param_26():mMode(0),mCmdSerial(""),mDataNodeNo(""){};
+ int mPackageFlag;
+ Param_26():mMode(0),mCmdSerial(""),mDataNodeNo(""),mPackageFlag(0){};
};
@@ -368,6 +426,34 @@ struct Param_30 {
int mPackageFlag;
Param_30():mMode(0),mChannelId(""),mDataNodeNo(""),mPackageFlag(0){};
};
+struct Param_40 {
+ int mMode;
+ std::string mChannelId;
+ std::string mDataNodeNo;
+ int mPackageFlag;
+ int StartFrequency;
+ int EndFrequency;
+ Param_40():mMode(0),mChannelId(""),mDataNodeNo(""),mPackageFlag(0),StartFrequency(0),EndFrequency(0){};
+};
+struct Param_41 {
+ std::string mdataNodeNo;
+ int mfeatureInterVal;
+ int mwaveInterVal;
+ int msamplingRate;
+ int mrange;
+ int mAccSampleTime;
+ std::string mstartBrands;
+ std::string mstopBrands;
+ std::string menvelopeBandPass;
+ int mviff;
+ std::string mfaultFrequency;
+ Param_41():mdataNodeNo(""),mfeatureInterVal(0),mwaveInterVal(0),msamplingRate(0),mrange(0),mAccSampleTime(0),\
+ mstartBrands(""),mstopBrands(""),menvelopeBandPass(""),mviff(0),mfaultFrequency(""){};
+};
+struct Param_42 {
+ string fileName;
+ Param_42():fileName(""){};
+};
struct Param_31 {
int mMode;
@@ -376,13 +462,13 @@ struct Param_31 {
Param_31():mMode(0),mChannelId(""){};
};
+
struct Param_32 {
- int mMode;
- std::string mChannelId;
+ int mMode;
+ std::string mChannelId;
int mPackageFlag;
Param_32():mMode(0),mChannelId(""),mPackageFlag(0){};
};
-
struct Param_33 {
int mMode;
std::string mUnit;
@@ -443,11 +529,53 @@ struct Param_47 {
std::string mFileName;
Param_47():mMode(0),mFileName(""){};
};
+struct Param_51 {
+ int mMode;
+ string strGateWayMAC;
+ string strGateWayLocation;
+ Param_51():mMode(-1),strGateWayLocation(""){};
+};
+struct Param_52 {
+ int mMode;
+ std::string mCmdSerial;
+ string mSsid;
+ string mPassWord;
+};
+struct Param_53 {
+ int mMode;
+ string mdataNodeNo;
+ string mUpdateKey;
+ string mUpdateValue;
+ string mUpdateKey2;
+ string mUpdateValue2;
+ string mUpdateKey3;
+ string mUpdateValue3;
+ Param_53():mUpdateKey2(""),mUpdateValue2(""),mUpdateKey3(""),mUpdateValue3(""){};
+};
+
+typedef struct DataNodeUpdate{
+ std::string strUpdataFileName;
+ std::string strSoftVersion;
+ std::vector hwVersion;
+};
+struct ethtool_value {
+ unsigned int cmd;
+ unsigned int data;
+};
-
-
+extern std::string GBKToUTF8(const std::string& strGBK);
+extern std::string UTFtoGBK(const char* utf8);
+extern string GetLocalTimeWithMs(void);
+extern void InitGpio(unsigned int gpioN,unsigned int inout);
+extern int gpio_set(unsigned int gpioN,char x);
+extern int gpio_read(unsigned int gpioN);
+extern int config_uart(const char* Port,speed_t speed);
+extern int write_data(int fd, char *buff, int len);
+extern int read_data(int fd, char *buff, int len, int timeout);
+extern int ModifyMac(char* buff);
+//extern int str_recv(int fd, char srcshow,char* buffer);
/**
* @brief 系统运行时输入入参进行系统软件版本查询
* @param argv 输入参数 -vV版本查询 --debugmode日志调试模式
@@ -477,7 +605,6 @@ extern int system_custom(const char *cmd, char *buf);
*/
extern void WriteMemoryInfo();
-
/**
* @brief 获取当前日期
* @return 当前日期的string
@@ -497,7 +624,7 @@ extern void GetTime_(char * time_buff,TIME_SIZE len) ;
* @return void
*/
extern void GetTimeNet(char* timebuf, int type);
-
+extern std::string GetRTC(char* timebuf, int& millisecond);
/**
* @brief 从配置文件中读取数据
* @param filename 配置文件名
@@ -521,7 +648,7 @@ extern int WriteStr2Config(std::string filename, std::string config, std::string
* @brief 获取设备的MAC地址做为设备的唯一标识
* @return std::string Mac地址
*/
-extern std::string GetLocalMac();
+extern std::string GetLocalMac(const char* net);
/**
* @brief 获取设备IP
@@ -597,14 +724,45 @@ extern void ZoneConfig(std::string zoneid);
* @return std::string CPU MEM DISK info
*/
extern std::string GetSysStatus();
-
+double GetHardDiskFree();
extern bool CheckIP(const char *ip);
bool IsValidMask(std::string mask);
//read update config file
-extern std::vector ReadStrByOpt(std::string filename,std::string& strUpdataFileName);
+extern std::vector ReadStrUpdate(std::string filename);
+extern void ReadStrConfig(std::string filename);
+extern int UpdataDataNodeConfig(std::string filename);
+extern char* solve(char *dest,const char *src);
extern void swap(char *data);
+extern int OpenWatchDog();
+extern int WriteWatchDog(int fd);
+extern int CloseWatchDog(int fd);
+//获取4G信号强度
+extern int getcsq();
+extern std::string GetGwIp_(const char *eth_name);
+extern string GetOneContent(const char* szData, int nRow, const char* szSeparate);
+extern int readStringValue(const char* section, char* key, char* val, const char* file);
+extern int writeStringVlaue(const char* section, char* key, char* val, const char* file);
+extern int readIntValue(const char* section, char* key, const char* file);
+extern int writeIntValue(const char* section, char* key, int val, const char* file);
+int getDiskInfo(char* diskTotal,char* diskFree);
+
+void timeout(int signo);
+unsigned short cal_chksum(unsigned short *addr,int len);
+int pack(int pkt_no,char *sendpacket);
+int send_packet(int pkt_no,char *sendpacket);
+int recv_packet(int pkt_no,char *recvpacket);
+int unpack(int cur_seq,char *buf,int len);
+void tv_sub(struct timeval *out,struct timeval *in);
+void _CloseSocket();
+
+int socketHeart(const char* pSendData);
+
+extern bool NetIsOk();
+extern int Ping( const char *ips, int timeout);
+extern int get_netlink_status(const char *if_name);
+extern Mutex g_tDbMutex;
#endif
diff --git a/common/SH_global.h b/common/SH_global.h
index c89673c..ed934cf 100644
--- a/common/SH_global.h
+++ b/common/SH_global.h
@@ -10,6 +10,8 @@
#include "SH_CommonFunc.hpp"
#include "../mqttclient/SH_MqttClient.h"
+
+#define SECTION_MAX_LEN 1024
//******************** 全局变量**********************
enum enumZigBeeTransmitStatus {
NO_ENTER_TRANSMITTING_STATUS = 0,
@@ -17,6 +19,13 @@ enum enumZigBeeTransmitStatus {
};
+//#define NR5G_MODULE
+//#define Q4G_MODULE
+//#define WIFI_MODULE
+//#define NR5G_MEIGE
+#define G2UL_GATEWAY
+//#define IMX6UL_GATEWAY
+
class GlobalConfig
{
public :
@@ -24,17 +33,25 @@ public :
static int QuitFlag_G; //程序退出标志
static int LinkStatus_G; //和服务器连接状态
static int LinkCount;
+ static int NetSignal;
+ static int serverStatus;
+ static int net0Status;
+ static std::string NR5GTemp;
+ static std::string NetStatus;
+ static std::string NetType;
static std::string Version; //软件版本号
static std::string MacAddr_G; //设备MAC地址
+ static std::string MacAddr_G2; //设备光纤MAC地址
static std::string IpAddr_G; //设备IP
static std::string DbName_G; //数据库名字
+ static std::string Config_G; //配置文件
static std::string ServerIP; //服务器地址
static int ServerPort; //服务器端口
static std::string UartName_G;
static TopicList Topic_G; //发布的主题
static ZigbeeInfo ZigbeeInfo_G; //gateway zigbee info
static ZIGBEE Zigbee_G;
-
+ static GPIOInfo GPIO_G;
static enumZigBeeTransmitStatus EnterZigBeeWaveTransmittingFlag_G; // 进入ZigBee网络原始数据传输状态标志
static int EnterZigBeeWaveTransmittingCnt_G; // 进入ZigBee网络原始数据传输状态计数器,以秒为单位进行计数
};
@@ -56,6 +73,17 @@ public :
#define LIGHT_GRAY "\033[0;37m"
#define WHITE "\033[1;37m"
+#ifdef IMX6UL_GATEWAY
+#define SAVE_COUNT 2058 //2058,4800
+#define OneWeek 259359//259359,604800
+#endif
+#ifdef G2UL_GATEWAY
+#define SAVE_COUNT 4800*4
+#define OneWeek 604800*7
+#endif
+
+
+
#define perror_info(info) { \
if (GlobalConfig::RUN_MODE) { \
perror(info); \
diff --git a/datatransfer/SH_Datatrans.cpp b/datatransfer/SH_Datatrans.cpp
index c032ace..7c44c71 100644
--- a/datatransfer/SH_Datatrans.cpp
+++ b/datatransfer/SH_Datatrans.cpp
@@ -54,6 +54,7 @@ static size_t OnWriteData(void* buffer, size_t size, size_t nmemb, void* lpVoid)
static size_t my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream)
{
+ printf("size = %d\n",size);
struct DowloadFile *out=(struct DowloadFile *)stream;
if(out && !out->stream) {
out->stream=fopen(out->filename, "wb");//打开文件进行写入
@@ -116,6 +117,73 @@ int DataTrans::download(char* pFilename,string& strUrl,string& strResponse,bool
curl_global_cleanup();
return 0;
}
+//下载文件数据接收函数
+
+size_t writedata2file(void *ptr, size_t size, size_t nmemb, FILE *stream) {
+ size_t written = fwrite(ptr, size, nmemb, stream);
+ return written;
+}
+//http POST请求文件下载
+int DataTrans::dl_curl_post_req(const string &url, const string &postParams, string& filename)
+{
+ CURL *curl;
+ FILE *fp;
+ CURLcode res;
+ /* 调用curl_global_init()初始化libcurl */
+ res = curl_global_init(CURL_GLOBAL_ALL);
+ if (CURLE_OK != res)
+ {
+ printf("init libcurl failed.");
+ curl_global_cleanup();
+ return -1;
+ }
+ /* 调用curl_easy_init()函数得到 easy interface型指针 */
+ curl = curl_easy_init();
+ if (curl) {
+ fp = fopen(filename.c_str(),"wb");
+
+ /* 调用curl_easy_setopt()设置传输选项 */
+ res = curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
+ if (res != CURLE_OK)
+ {
+ fclose(fp);
+ curl_easy_cleanup(curl);
+ return -1;
+ }
+ /* 根据curl_easy_setopt()设置的传输选项,实现回调函数以完成用户特定任务 */
+ res = curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writedata2file);
+ if (res != CURLE_OK){
+ fclose(fp);
+ curl_easy_cleanup(curl);
+ return -1;
+ }
+ /* 根据curl_easy_setopt()设置的传输选项,实现回调函数以完成用户特定任务 */
+ res = curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);
+ if (res != CURLE_OK)
+ {
+ fclose(fp);
+ curl_easy_cleanup(curl);
+ return -1;
+ }
+
+ res = curl_easy_perform(curl);
+ // 调用curl_easy_perform()函数完成传输任务
+ fclose(fp);
+ /* Check for errors */
+ if(res != CURLE_OK){
+ fprintf(stderr, "curl_easy_perform() failed: %s\n",curl_easy_strerror(res));
+ curl_easy_cleanup(curl);
+ return -1;
+ }
+
+ /* always cleanup */
+ curl_easy_cleanup(curl);
+ // 调用curl_easy_cleanup()释放内存
+
+ }
+ curl_global_cleanup();
+ return 0;
+}
int DataTrans::Post(const std::string & strUrl, const std::string & strPost, std::string & strResponse)
{
diff --git a/datatransfer/SH_Datatrans.hpp b/datatransfer/SH_Datatrans.hpp
index c7caea6..d2439b5 100644
--- a/datatransfer/SH_Datatrans.hpp
+++ b/datatransfer/SH_Datatrans.hpp
@@ -95,7 +95,7 @@ public:
int Send_Dir_socket(const char *dirname);
int download(char* pFilename,string& strUrl,string& strResponse,bool bDownload);
-
+ int dl_curl_post_req(const string &url, const string &postParams, string& filename);
public:
void SetDebug(bool bDebug);
private:
diff --git a/dbaccess/SH_SqlDB.cpp b/dbaccess/SH_SqlDB.cpp
index 10e7335..11b0423 100644
--- a/dbaccess/SH_SqlDB.cpp
+++ b/dbaccess/SH_SqlDB.cpp
@@ -2,6 +2,7 @@
#include "../API_log/SH_log.h"
#include "../common/SH_global.h"
#include
+#include "../calculation/Calculation.hpp"
bool SqlSwitch()
{
@@ -12,6 +13,7 @@ bool SqlSwitch()
}
SqliteDB *sql_ctl = SqliteDB::instance();
+Calculation *pCalculation = Calculation::instance();
SqliteDB::SqliteDB()
{
@@ -28,7 +30,7 @@ void SqliteDB::SqliteInit(const char *pDbName, bool isDB2)
//创建传感器信息存储表
memset(sql_exec, 0, 2048);
- sprintf(sql_exec, "create table if not exists %s(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s);",
+ sprintf(sql_exec, "create table if not exists %s(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s);",
T_SENSOR_INFO(TNAME),
T_SENSOR_INFO(DATANODENO),
T_SENSOR_INFO(DATANODENAME),
@@ -43,6 +45,11 @@ void SqliteDB::SqliteInit(const char *pDbName, bool isDB2)
T_SENSOR_INFO(BPNO),
T_SENSOR_INFO(SERIALNO),
T_SENSOR_INFO(FIRSTPOWERNO),
+ "WakeupTime",
+ "StaticTime",
+ "WaveTime",
+ "BateryV",
+ "ProductNo",
T_SENSOR_INFO(CONFIGFLAG),
T_SENSOR_INFO(STARTBRANDS),
T_SENSOR_INFO(STOPBRANDS),
@@ -58,15 +65,32 @@ void SqliteDB::SqliteInit(const char *pDbName, bool isDB2)
T_SENSOR_INFO(ZIGBEESHORTADDR),
T_SENSOR_INFO(ZIGBEELONGADDR),
T_SENSOR_INFO(ZIGBEEDESADDR),
+ "ZigbeePower",
+ "ZigbeeRetry",
+ "ZigbeeRetryGap",
+ "ACCSampleTime",
T_SENSOR_INFO(STATUS),
T_SENSOR_INFO(TIMESTAMP),
T_SENSOR_INFO(VIFF),
- T_SENSOR_INFO(RSSI)),
+ T_SENSOR_INFO(RSSI),
+ "UpdateFlag",
+ "LooseValue",
+ "batteryPower"),
CreateTable(sql_exec, isDB2);
+ int iRet = GetTableRows(" sqlite_master "," name = 't_sensor_info' and sql LIKE '%LooseValue%' ");
+ if(iRet == 0){
+ CreateTable("ALTER TABLE t_sensor_info ADD COLUMN 'LooseValue'");
+ }
+
+ iRet = GetTableRows(" sqlite_master "," name = 't_sensor_info' and sql LIKE '%batteryPower%' ");
+ if(iRet == 0){
+ CreateTable("ALTER TABLE t_sensor_info ADD COLUMN 'batteryPower'");
+ }
+
//创建传感器数据存储表
memset(sql_exec, 0, 2048);
- sprintf(sql_exec, "create table if not exists %s(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s);",
+ sprintf(sql_exec, "create table if not exists %s(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s integer,%s,%s);",
T_DATA_INFO(TNAME),
T_DATA_INFO(DATANODENO),
T_DATA_INFO(CHANNELID),
@@ -84,14 +108,20 @@ void SqliteDB::SqliteInit(const char *pDbName, bool isDB2)
T_DATA_INFO(PHASE2),
T_DATA_INFO(PHASE3),
T_DATA_INFO(PHASE4),
- T_DATA_INFO(TIMESTAMP));
+ T_DATA_INFO(STATICINDEX),
+ T_DATA_INFO(TIMESTAMP),
+ T_DATA_INFO(SENDMSG),
+ T_DATA_INFO(NODERESEND));
CreateTable(sql_exec, isDB2);
-
+ iRet = GetTableRows(" sqlite_master "," name = 't_data_info' and sql LIKE '%nodeResend%' ");
+ if(iRet == 0){
+ CreateTable("ALTER TABLE t_data_info ADD COLUMN 'nodeResend'");
+ }
//创建传感器静态数据存储表
memset(sql_exec, 0, 2048);
- sprintf(sql_exec, "create table if not exists %s(%s,%s,%s,%s,%s,%s,%s);",
+ sprintf(sql_exec, "create table if not exists %s(%s,%s,%s,%s,%s,%s,%s,%s integer,%s,%s);",
T_DATASTATIC_INFO(TNAME),
T_DATASTATIC_INFO(DATANODENO),
T_DATASTATIC_INFO(CHANNELID),
@@ -99,10 +129,152 @@ void SqliteDB::SqliteInit(const char *pDbName, bool isDB2)
T_DATASTATIC_INFO(TEMBOT),
T_DATASTATIC_INFO(DIP),
T_DATASTATIC_INFO(VOLTAGE),
- T_DATASTATIC_INFO(TIMESTAMP));
- CreateTable(sql_exec, isDB2);
+ "Battery",
+ T_DATASTATIC_INFO(STATICINDEX),
+ T_DATASTATIC_INFO(TIMESTAMP),
+ T_DATASTATIC_INFO(SENDMSG),
+ T_DATASTATIC_INFO(NODERESEND));
+ CreateTable(sql_exec, isDB2);
+ iRet = GetTableRows(" sqlite_master "," name = 't_datastatic_info' and sql LIKE '%nodeResend%' ");
+ if(iRet == 0){
+ CreateTable("ALTER TABLE t_datastatic_info ADD COLUMN 'nodeResend'");
+ }
+
+ memset(sql_exec, 0, 2048);
+ sprintf(sql_exec, "create table if not exists %s(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s);",
+ T_GATEWAY_INFO(TNAME),
+ T_GATEWAY_INFO(GATEWAYMAC),
+ T_GATEWAY_INFO(SENSORVER),
+ T_GATEWAY_INFO(GATEWAYLOCATION),
+ T_GATEWAY_INFO(ZIGBEEPANID),
+ T_GATEWAY_INFO(ZIGBEECHANNEL),
+ T_GATEWAY_INFO(COMMUNICATIONTYPE),
+ T_GATEWAY_INFO(SIGNAL),
+ T_GATEWAY_INFO(LOCALIP),
+ T_GATEWAY_INFO(SYSTEMVERSION),
+ T_GATEWAY_INFO(PROGRAMVERSION),
+ T_GATEWAY_INFO(WEBVERSION),
+ T_GATEWAY_INFO(SERVERIP),
+ T_GATEWAY_INFO(SERVERPORT),
+ T_GATEWAY_INFO(STATUS),
+ T_GATEWAY_INFO(GATEWAYUPDATE),
+ T_GATEWAY_INFO(MAC2));
+ CreateTable(sql_exec, isDB2);
+
+ memset(sql_exec, 0, 2048);
+ sprintf(sql_exec, "create table if not exists %s(%s,%s,%s,%s,%s);",
+ "t_data_waveSend","channelID","waveName","timeStamp","sendMsg","save");
+ CreateTable(sql_exec, isDB2);
+
+ iRet = GetTableRows(" sqlite_master "," name = 't_data_waveSend' and sql LIKE '%sendMsg%' ");
+ if(iRet == 0){
+ CreateTable("ALTER TABLE t_data_waveSend ADD COLUMN 'sendMsg'");
+ }
+ iRet = GetTableRows(" sqlite_master "," name = 't_data_waveSend' and sql LIKE '%save%' ");
+ if(iRet == 0){
+ CreateTable("ALTER TABLE t_data_waveSend ADD COLUMN 'save'");
+ }
+ /*memset(sql_exec, 0, 2048);
+ sprintf(sql_exec, "create table if not exists %s(%s,%s,%s,%s,%s integer,%s integer ,%s integer ,%s integer,%s integer);",
+ T_DATANODE_TIME(TNAME),
+ T_DATANODE_TIME(DATANODENO),
+ T_DATANODE_TIME(SHORTADDR),
+ T_DATANODE_TIME(STATICCYCLE),
+ T_DATANODE_TIME(WAVECYCLE),
+ T_DATANODE_TIME(NODEGROUP),
+ T_DATANODE_TIME(NODEINDEX),
+ T_DATANODE_TIME(NODEWAVEINDEX),
+ T_DATANODE_TIME(STATICTIME),
+ T_DATANODE_TIME(STATICSTARTTIME));
+ CreateTable(sql_exec, isDB2);*/
+
+}
+void SqliteDB::Createtable(const char *ptableName)
+{
+ char sql_exec[2048];
+ //创建传感器数据存储表
+ memset(sql_exec, 0, 2048);
+ sprintf(sql_exec, "create table if not exists %s(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s integer,%s,%s,%s);",
+ ptableName,
+ T_DATA_INFO(DATANODENO),
+ T_DATA_INFO(CHANNELID),
+ T_DATA_INFO(DIAGNOSISEAK),
+ T_DATA_INFO(INTEGRATPK),
+ T_DATA_INFO(INTEGRATRMS),
+ T_DATA_INFO(RMSVALUES),
+ T_DATA_INFO(ENVELOPNERGY),
+ T_DATA_INFO(AMP1),
+ T_DATA_INFO(AMP2),
+ T_DATA_INFO(AMP3),
+ T_DATA_INFO(AMP4),
+ T_DATA_INFO(AMP5),
+ T_DATA_INFO(PHASE1),
+ T_DATA_INFO(PHASE2),
+ T_DATA_INFO(PHASE3),
+ T_DATA_INFO(PHASE4),
+ "StaticIndex",
+ T_DATA_INFO(TIMESTAMP),
+ "sendMsg",
+ "nodeResend");
+ CreateTable(sql_exec, 0);
+ memset(sql_exec, 0, 2048);
+ sprintf(sql_exec,"CREATE INDEX %s_1 \
+ ON %s (%s)",ptableName,ptableName,T_DATA_INFO(DATANODENO));
+ CreateTable(sql_exec, 0);
}
+void SqliteDB::SqliteInitDel(const char *pDbName)
+{
+ Deletetable(T_DATA_INFO(TNAME));
+ Deletetable(T_DATASTATIC_INFO(TNAME));
+ vec_t vecResult = GetDataMultiLineOfOneColumn(T_SENSOR_INFO(TNAME),T_SENSOR_INFO(ZIGBEELONGADDR),NULL);
+ for(int i = 0; i < vecResult.size() && vecResult.size() > 0;i++)
+ {
+ char sztableName[100]={0x00};
+ sprintf(sztableName,"t_data_%s",vecResult[i].c_str());
+ Deletetable(sztableName);
+ sprintf(sztableName,"t_dataStatic_%s",vecResult[i].c_str());
+ Deletetable(sztableName);
+ }
+}
+void SqliteDB::Deletetable(const char *ptableName)
+{
+ char sql_exec[2048];
+ //创建传感器数据存储表
+ memset(sql_exec, 0, 2048);
+ sprintf(sql_exec,"DROP TABLE %s ;",ptableName);
+ int iRet = sqlite3_exec(GetDbHandle(false), sql_exec, 0, 0, NULL);
+ if (iRet != SQLITE_OK) {
+ perror_info("sqlite3_exec");
+ }
+
+}
+void SqliteDB::CreatedataStatictable(const char *ptableName)
+{
+ char sql_exec[2048];
+ //创建传感器数据存储表
+ memset(sql_exec, 0, 2048);
+ sprintf(sql_exec, "create table if not exists %s(%s,%s,%s,%s,%s,%s,%s,%s integer,%s,%s,%s);",
+ ptableName,
+ T_DATASTATIC_INFO(DATANODENO),
+ T_DATASTATIC_INFO(CHANNELID),
+ T_DATASTATIC_INFO(TEMTOP),
+ T_DATASTATIC_INFO(TEMBOT),
+ T_DATASTATIC_INFO(DIP),
+ T_DATASTATIC_INFO(VOLTAGE),
+ "zigbeeSignal",
+ "StaticIndex",
+ T_DATASTATIC_INFO(TIMESTAMP),
+ "sendMsg",
+ "nodeResend"
+ //"zigbeeRSSIType"
+ );
+ CreateTable(sql_exec, 0);
+ memset(sql_exec, 0, 2048);
+ sprintf(sql_exec,"CREATE INDEX %s_1 \
+ ON %s (%s)",ptableName,ptableName,T_DATA_INFO(DATANODENO));
+ CreateTable(sql_exec, 0);
+}
bool SqliteDB::OpenDB(const char *pDbName, bool isDB2)
{
if (isDB2 == false) {
@@ -255,11 +427,36 @@ vec_t SqliteDB::GetDataSingleLine(const char *tablename, const char *column, con
return vecResult;
}
-
+char* SqliteDB::GetDataChar(const char *tablename, const char *column, const char *whereCon)
+{
+ char szRes[100]={0x00};
+ std::string strSql = "select ";
+ if (whereCon != NULL) {
+ strSql = strSql + column + " from " + tablename + " where " + whereCon + ";";
+ }
+ else {
+ strSql = strSql + column + " from " + tablename + ";";
+ }
+ print_light_green("%s\n", strSql.c_str());
+ // if (SqlSwitch()) log_system->log_write_system("[info]","%s\n", strSql.c_str());
+ sqlite3_stmt *stmt;
+ if (sqlite3_prepare_v2(mDBAcess, strSql.c_str(), -1, &stmt, 0) != SQLITE_OK) {
+ print_error("sqlite3_prepare_v2:%s\n", sqlite3_errmsg(mDBAcess));
+ sqlite3_finalize(stmt);
+ return NULL;
+ }
+ int retStep = sqlite3_step(stmt);
+ if (retStep == SQLITE_ROW) {
+ char *columninfo = (char*)sqlite3_column_text(stmt, 0);
+ memcpy(szRes,columninfo,sizeof(szRes));
+ }
+ sqlite3_finalize(stmt);
+ return szRes;
+}
std::string SqliteDB::GetData(const char *tablename, const char *column, const char *whereCon)
{
- std::string strRes;
+ std::string strRes = "";
std::string strSql = "select ";
if (whereCon != NULL) {
strSql = strSql + column + " from " + tablename + " where " + whereCon + ";";
@@ -270,9 +467,11 @@ std::string SqliteDB::GetData(const char *tablename, const char *column, const c
print_light_green("%s\n", strSql.c_str());
// if (SqlSwitch()) log_system->log_write_system("[info]","%s\n", strSql.c_str());
sqlite3_stmt *stmt;
+ g_tDbMutex.Lock();
if (sqlite3_prepare_v2(mDBAcess, strSql.c_str(), -1, &stmt, 0) != SQLITE_OK) {
print_error("sqlite3_prepare_v2:%s\n", sqlite3_errmsg(mDBAcess));
sqlite3_finalize(stmt);
+ g_tDbMutex.UnLock();
return strRes;
}
int retStep = sqlite3_step(stmt);
@@ -281,6 +480,7 @@ std::string SqliteDB::GetData(const char *tablename, const char *column, const c
strRes = columninfo != NULL ? columninfo : "";
}
sqlite3_finalize(stmt);
+ g_tDbMutex.UnLock();
return strRes;
}
@@ -294,12 +494,15 @@ array_t SqliteDB::GetDataMultiLine(const char *tablename, const char *column, co
else {
strSql = strSql + column + " from " + tablename + ";";
}
+
print_light_green("%s\n", strSql.c_str());
// if (SqlSwitch()) log_system->log_write_system("[info]","%s\n", strSql.c_str());
sqlite3_stmt *stmt;
+ g_tDbMutex.Lock();
if (sqlite3_prepare_v2(mDBAcess, strSql.c_str(), -1, &stmt, 0) != SQLITE_OK) {
print_error("sqlite3_prepare_v2:%s\n", sqlite3_errmsg(mDBAcess));
sqlite3_finalize(stmt);
+ g_tDbMutex.UnLock();
return arrResult;
}
int retStep = sqlite3_step(stmt);
@@ -315,9 +518,47 @@ array_t SqliteDB::GetDataMultiLine(const char *tablename, const char *column, co
retStep = sqlite3_step(stmt);
}
sqlite3_finalize(stmt);
+ g_tDbMutex.UnLock();
return arrResult;
}
+array_t SqliteDB::GetDataMultiLineTransaction(const char *tablename, const char *column, const char *whereCon)
+{
+ array_t arrResult;
+ std::string strSql = "select ";
+ if (whereCon != NULL) {
+ strSql = strSql + column + " from " + tablename + " where " + whereCon + ";";
+ }
+ else {
+ strSql = strSql + column + " from " + tablename + ";";
+ }
+ print_light_green("%s\n", strSql.c_str());
+// if (SqlSwitch()) log_system->log_write_system("[info]","%s\n", strSql.c_str());
+ sqlite3_exec(mDBAcess, "BEGIN", 0, 0, NULL);
+ sqlite3_stmt *stmt;
+ if (sqlite3_prepare_v2(mDBAcess, strSql.c_str(), -1, &stmt, 0) != SQLITE_OK) {
+ print_error("sqlite3_prepare_v2:%s\n", sqlite3_errmsg(mDBAcess));
+ sqlite3_finalize(stmt);
+ return arrResult;
+ }
+ sqlite3_reset(stmt);
+ sqlite3_bind_int(stmt, 1, 0);
+ int retStep = sqlite3_step(stmt);
+ int column_count = sqlite3_column_count(stmt);
+ while (retStep == SQLITE_ROW) {
+ vec_t vecResult;
+ for (int iCol = 0; iCol < column_count; iCol++) {
+ char *columninfo = (char*)sqlite3_column_text(stmt, iCol);
+ std::string str = columninfo != NULL ? columninfo : "";
+ vecResult.push_back(str);
+ }
+ arrResult.push_back(vecResult);
+ retStep = sqlite3_step(stmt);
+ }
+ sqlite3_finalize(stmt);
+ sqlite3_exec(mDBAcess, "COMMIT", 0, 0, NULL);
+ return arrResult;
+}
vec_t SqliteDB::GetDataMultiLineOfOneColumn(const char *tablename, const char *column, const char *whereCon)
{
vec_t vecResult;
@@ -346,7 +587,33 @@ vec_t SqliteDB::GetDataMultiLineOfOneColumn(const char *tablename, const char *c
sqlite3_finalize(stmt);
return vecResult;
}
-
+vec_Value SqliteDB::GetDataMultiLineOfOneColumnDouble(const char *tablename, const char *column, const char *whereCon)
+{
+ vec_Value vecResult;
+ std::string strSql = "select ";
+ if (whereCon != NULL) {
+ strSql = strSql + column + " from " + tablename + " where " + whereCon + ";";
+ }
+ else {
+ strSql = strSql + column + " from " + tablename + ";";
+ }
+ print_light_green("%s\n", strSql.c_str());
+ // if (SqlSwitch()) log_system->log_write_system("[info]","%s\n", strSql.c_str());
+ sqlite3_stmt *stmt;
+ if (sqlite3_prepare_v2(mDBAcess, strSql.c_str(), -1, &stmt, 0) != SQLITE_OK) {
+ print_error("sqlite3_prepare_v2:%s\n", sqlite3_errmsg(mDBAcess));
+ sqlite3_finalize(stmt);
+ return vecResult;
+ }
+ int retStep = sqlite3_step(stmt);
+ while (retStep == SQLITE_ROW) {
+ double columninfo = sqlite3_column_double(stmt, 0);
+ vecResult.push_back(columninfo);
+ retStep = sqlite3_step(stmt);
+ }
+ sqlite3_finalize(stmt);
+ return vecResult;
+}
int SqliteDB::DeleteTableData(const char* tablename, const char* whereCond, bool isDB2)
@@ -358,6 +625,7 @@ int SqliteDB::DeleteTableData(const char* tablename, const char* whereCond, bool
else {
strSql = strSql + tablename + ";";
}
+ // LOG_INFO("strSql = %s",strSql.c_str());
print_light_green("%s\n", strSql.c_str());
// if (SqlSwitch()) log_system->log_write_system("[info]","%s\n", strSql.c_str());
char *msg;
@@ -390,7 +658,34 @@ int SqliteDB::DeleteTableDataOneConditon(const char* tablename, const char* cond
}
return iRet;
}
+int SqliteDB::UpdateNodeNameData(const char* tablename, const char* updateColumn, const char* whereCond, bool isDB2)
+{
+ std::string strSql = "update ";
+ char szSql[1024] = {0x00};
+ strcat(szSql,"update ");
+ if (whereCond != NULL) {
+ strcat(szSql,tablename);
+ strcat(szSql," set ");
+ strcat(szSql,updateColumn);
+ strcat(szSql," where ");
+ strcat(szSql,whereCond);
+ strcat(szSql,";");
+ strSql = strSql + tablename + " set " + updateColumn + " where " + whereCond + ";";
+ }
+ else {
+ strSql = strSql + tablename + " set " + updateColumn + ";";
+ }
+ print_light_green("%s\n", strSql.c_str());
+ // if (SqlSwitch()) log_system->log_write_system("[info]","%s\n", strSql.c_str());
+ char *msg;
+ int iRet = sqlite3_exec(GetDbHandle(isDB2), szSql, 0, 0, &msg);
+ if (iRet != SQLITE_OK) {
+ print_error("sqlite3 error: code=%d msg=%s\n", iRet, msg);
+ sqlite3_free(msg);
+ }
+ return iRet;
+}
int SqliteDB::UpdateTableData(const char* tablename, const char* updateColumn, const char* whereCond, bool isDB2)
{
std::string strSql = "update ";
@@ -403,12 +698,14 @@ int SqliteDB::UpdateTableData(const char* tablename, const char* updateColumn, c
print_light_green("%s\n", strSql.c_str());
// if (SqlSwitch()) log_system->log_write_system("[info]","%s\n", strSql.c_str());
char *msg;
+ g_tDbMutex.Lock();
int iRet = sqlite3_exec(GetDbHandle(isDB2), strSql.c_str(), 0, 0, &msg);
if (iRet != SQLITE_OK) {
print_error("sqlite3 error: code=%d msg=%s\n", iRet, msg);
sqlite3_free(msg);
}
+ g_tDbMutex.UnLock();
return iRet;
}
@@ -484,7 +781,357 @@ int SqliteDB::InsertData(const char* tablename, const char* insertValues, int re
}
return iRet;
}
+int SqliteDB::InsertData(const char* insertSql)
+{
+ char *msg;
+ int iRet = sqlite3_exec(GetDbHandle(false), insertSql, 0, 0, &msg);
+ if (iRet != SQLITE_OK) {
+ print_error("sqlite3 error: code=%d msg=%s\n", iRet, msg);
+ sqlite3_free(msg);
+ }
+ return iRet;
+}
+int SqliteDB::CalculateBattery()
+{
+ float dayStaticPower = 6.5,dayWavePower = 237;//
+ char whereCon[1024] = {0};
+ char selectSql[1024] = { 0 };
+ memset(whereCon,0x00,sizeof(whereCon));
+ memset(selectSql,0x00,sizeof(selectSql));
+ sprintf(selectSql," DataNodeNo,StaticTime,WaveTime,featureInterVal,waveInterVal,samplingRate ");
+ array_t vecRes ;
+ vecRes = GetDataMultiLine(T_SENSOR_INFO(TNAME), selectSql, NULL);
+ if(vecRes.size() > 0){
+ for(int i = 0; i < vecRes.size(); i++){
+ if(vecRes[i][5] == "12800"){
+ }else if(vecRes[i][5] == "3200"){
+
+ }
+ float dayStaticTime = 0.0;
+ float dayWaveTime = 0.0;
+ if(atoi(vecRes[i][3].c_str()) == 0){
+ dayStaticTime = 0;
+ }else{
+ dayStaticTime = 24*60/atoi(vecRes[i][3].c_str());
+ }
+ if(atoi(vecRes[i][4].c_str()) == 0){
+ dayWaveTime = 0;
+ }else{
+ dayWaveTime = 24*60/atoi(vecRes[i][4].c_str());
+ }
+
+ float dayPower = dayStaticTime * dayStaticPower + dayWaveTime * dayWavePower + 24*3.26;//static + wave + sleep
+ float usePower = atoi(vecRes[i][1].c_str()) * dayStaticPower + atoi(vecRes[i][2].c_str()) * dayWavePower;
+ if(dayPower == 0)
+ dayPower = 1;
+ float remainDay = (19000000*0.5 - usePower)/dayPower;
+ float bateryProportion = remainDay/(19000000*0.5/dayPower);
+ char updateSql[1024] = { 0x00 };
+ char tmpParam[1024] = {0x00};
+ memset(whereCon,0x00,sizeof(whereCon));
+ memset(updateSql,0x00,sizeof(updateSql));
+ sprintf(whereCon,"dataNodeNo = '%s' ",vecRes[i][0].c_str());
+ sprintf(updateSql,"batteryPower = '%f,%f' ",bateryProportion,remainDay);
+ int iRet = UpdateTableData(T_SENSOR_INFO(TNAME), updateSql, whereCon);
+ print_info("iRet = %d\n",iRet);
+ string strData = sql_ctl->GetNodeConfigureInfor(whereCon);
+ data_publish(strData.c_str(), GlobalConfig::Topic_G.mPubConfig.c_str());
+ }
+ }
+
+ print_info("CalculateBattery \n");
+ return 0;
+}
+int SqliteDB::CalculateDip()
+{
+ char whereCon[1024] = {0};
+ char selectSql[1024] = { 0 };
+ char updateSql[1024] = { 0 };
+ memset(whereCon,0x00,sizeof(whereCon));
+ memset(selectSql,0x00,sizeof(selectSql));
+ sprintf(selectSql," DataNodeNo");
+ array_t vecRes ;
+ vecRes = GetDataMultiLine(T_SENSOR_INFO(TNAME), selectSql, NULL);
+ for(int i = 0 ; i < vecRes.size(); i++){
+ char szTablename[32]={0x00};
+ sprintf(szTablename,"t_dataStatic_%s",vecRes[i][0].c_str());
+ vec_Value vecResDip = GetDataMultiLineOfOneColumnDouble(szTablename," Dip ", NULL);
+ float sample_variance = pCalculation->getSample_variance(vecResDip);
+ print_info("sample_variance = %f\n",sample_variance);
+ memset(whereCon,0x00,sizeof(whereCon));
+ memset(updateSql,0x00,sizeof(updateSql));
+ sprintf(whereCon,"dataNodeNo = '%s' ",vecRes[i][0].c_str());
+ sprintf(updateSql,"LooseValue = '%f' ",sample_variance);
+ UpdateTableData(T_SENSOR_INFO(TNAME),updateSql,whereCon);
+ }
+}
+int SqliteDB::InintGateway()
+{
+ //更新网关配置表
+ string strIP = GetGwIp_("eth0");
+ string strServerIP = ReadStrByOpt(SERVERCONFIG, "Server", "localServerIpAddress");
+ string strServerPort = ReadStrByOpt(SERVERCONFIG, "Server", "localServerPort");
+ string strwebVersion = ReadStrByOpt(SYSTEMINFOFILE, "Version", "WebVersion");
+ string strsystemVersion = ReadStrByOpt(SYSTEMINFOFILE, "Version", "SystemVersion");
+ string strGatewayVersion = ReadStrByOpt(SYSTEMINFOFILE, "Version", "GateWayVersion");
+ std::string strchan = ReadStrByOpt(ZIGBEECONFIG, "Zigbee", "channel");
+ if(0 == sql_ctl->GetTableRows(T_GATEWAY_INFO(TNAME), NULL)){
+
+ char strSql[1024] = { 0 };
+ sprintf(strSql,"insert into t_gateway_info(gatewayMAC,zigbeePanID,zigbeeChannel,\
+ localIP,systemVersion,programVersion,webVersion,serverIP,serverPort,MAC2)\
+ values('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s');",GlobalConfig::MacAddr_G.c_str(),GlobalConfig::MacAddr_G.substr(8).c_str(),strchan.c_str(),strIP.c_str(),\
+ strsystemVersion.c_str(),strGatewayVersion.c_str(),strwebVersion.c_str(),strServerIP.c_str(),strServerPort.c_str(),GlobalConfig::MacAddr_G2.c_str());
+ sql_ctl->InsertData(strSql);
+ print_info("strSql = %s\n",strSql);
+ }else{
+ char whereCon[1024] = {0};
+ char updateSql[1024] = { 0 };
+ sprintf(updateSql, "zigbeePanID = '%s',zigbeeChannel = '%s',localIP = '%s',systemVersion='%s',programVersion='%s',webVersion='%s',serverIP='%s',serverPort='%s'",\
+ GlobalConfig::MacAddr_G.substr(8).c_str(),strchan.c_str(),strIP.c_str(),\
+ strsystemVersion.c_str(),strGatewayVersion.c_str(),strwebVersion.c_str(),strServerIP.c_str(),strServerPort.c_str());
+ sprintf(whereCon, "gatewayMAC='%s'", GlobalConfig::MacAddr_G.c_str());
+ sql_ctl->UpdateTableData(T_GATEWAY_INFO(TNAME), updateSql, whereCon);
+ }
+
+ //上传网关配置到MQTT
+ Json::Value jsSystemSetting;
+ Json::Value jsBody;
+ Json::FastWriter showValue;
+ Json::Value jsonVal;
+ jsonVal.clear();
+
+ jsonVal["cmd"] = "23";
+ jsonVal["dataNodeGatewayNo"] = GlobalConfig::MacAddr_G;
+ jsSystemSetting["WebVersion"] = strwebVersion;
+ jsSystemSetting["SystemVersion"] = strsystemVersion;
+ jsSystemSetting["GateWayVersion"] = strGatewayVersion;
+ jsBody["localServerIpAddress"] = ReadStrByOpt(SERVERCONFIG, "Server", "localServerIpAddress");
+ jsBody["localServerPort"] = atoi(ReadStrByOpt(SERVERCONFIG, "Server", "localServerPort").c_str());
+ jsBody["CommMode"] = atoi(ReadStrByOpt(SERVERCONFIG, "Server", "CommMode").c_str());
+ jsBody["Password"] = (ReadStrByOpt(SERVERCONFIG, "Server", "Password"));
+ jsBody["UserName"] = (ReadStrByOpt(SERVERCONFIG, "Server", "UserName"));
+ std::string dataBody = showValue.write(jsBody);
+ jsonVal["cmdBody"] = dataBody;
+ data_publish(showValue.write(jsonVal).c_str(), GlobalConfig::Topic_G.mPubConfig.c_str());
+
+ jsBody.clear();
+ jsonVal["cmd"] = "25";
+ jsBody["dnsName"] = ReadStrByOpt(NETWORKCONFIG, "Net", "dnsName");
+ jsBody["networkPortStatus"] = ReadStrByOpt(NETWORKCONFIG, "Net", "networkPortStatus");
+ jsBody["gateway"] = ReadStrByOpt(NETWORKCONFIG, "Net", "gateway");
+ jsBody["subnetMask"] = ReadStrByOpt(NETWORKCONFIG, "Net", "subnetMask");
+ jsBody["dataWatchIpAddress"] = ReadStrByOpt(NETWORKCONFIG, "Net", "ipAddress");
+ jsBody["hostName"] = ReadStrByOpt(NETWORKCONFIG, "Net", "hostName");
+
+ dataBody = showValue.write(jsBody);
+ jsonVal["cmdBody"] = dataBody;
+ data_publish(showValue.write(jsonVal).c_str(), GlobalConfig::Topic_G.mPubConfig.c_str());
+}
+
+std::string SqliteDB::GetNodeConfigureInfor(const char* whereCon)
+{
+ vec_t vecRes = GetDataSingleLine(T_SENSOR_INFO(TNAME), "*", whereCon);
+ printf("vecRes = %d\n",vecRes.size());
+ if(vecRes.size() < 1)
+ return "";
+ Json::Value jsSensorData;
+ Json::Value jsonVal;
+ jsonVal.clear();
+ jsonVal["dataNodeGatewayNo"] = GlobalConfig::MacAddr_G;
+ jsonVal["cmd"] = "26";
+ jsSensorData["dataNodeNo"] = vecRes[0];
+ jsSensorData["dataNodeName"] = vecRes[1];
+ jsSensorData["initFlag"] = atoi(vecRes[2].c_str());
+ jsSensorData["accFlag"] = atoi(vecRes[3].c_str());
+ jsSensorData["zigbeeFlag"] = atoi(vecRes[4].c_str());
+ jsSensorData["temTopFlag"] = atoi(vecRes[5].c_str());
+ jsSensorData["temBotFlag"] = atoi(vecRes[6].c_str());
+ jsSensorData["hardVersion"] = vecRes[8];
+ jsSensorData["softVersion"] = vecRes[9];
+ jsSensorData["bpNo"] = vecRes[10];
+ jsSensorData["serialNo"] = vecRes[11];
+ jsSensorData["firstPowerTime"] = vecRes[12];
+ jsSensorData["WakeupTime"] = atoi(vecRes[13].c_str());
+ jsSensorData["StaticTime"] = atoi(vecRes[14].c_str());
+ jsSensorData["WaveTime"] = atoi(vecRes[15].c_str());
+ jsSensorData["BateryV"] = vecRes[16];
+ jsSensorData["ProductNo"] = vecRes[17];
+ jsSensorData["configFlag"] = atoi(vecRes[18].c_str());
+ jsSensorData["startBrands"] = vecRes[19];
+ jsSensorData["stopBrands"] = vecRes[20];
+ jsSensorData["featureInterVal"] = (vecRes[21]);
+ jsSensorData["waveInterVal"] = atoi(vecRes[22].c_str());
+ jsSensorData["samplingRate"] = atoi(vecRes[23].c_str());
+ jsSensorData["range"] = atoi(vecRes[25].c_str());
+ jsSensorData["envelopeBandPass"] = vecRes[26];
+ jsSensorData["faultFrequency"] = vecRes[27];
+ jsSensorData["zigbeePanId"] = vecRes[28];
+ jsSensorData["zigbeeChannel"] = (vecRes[29]);
+ jsSensorData["zigbeeAddr"] = vecRes[30];
+ jsSensorData["zigbeeLongAddr"] = vecRes[31];
+ jsSensorData["zigbeeDesAddr"] = vecRes[32];
+ jsSensorData["ZigbeePower"] = atoi(vecRes[33].c_str());
+ jsSensorData["ZigbeeRetry"] = atoi(vecRes[34].c_str());
+ jsSensorData["ZigbeeRetryGap"] = atoi(vecRes[35].c_str());
+ jsSensorData["ACCSampleTime"] = atoi(vecRes[36].c_str());
+ jsSensorData["status"] = atoi(vecRes[37].c_str());
+ jsSensorData["timeStamp"] = vecRes[38];
+ jsSensorData["viff"] = atoi(vecRes[39].c_str());
+ jsSensorData["RSSI"] = atoi(vecRes[40].c_str());
+ jsSensorData["Update"] = atoi(vecRes[41].c_str());
+ jsSensorData["LooseValue"] = (vecRes[42].c_str());
+ jsSensorData["batteryPower"] = (vecRes[43].c_str());
+
+ Json::FastWriter showValue;
+ Json::Value jsBody;
+ jsBody["dataNodeGatewayNo"] = GlobalConfig::MacAddr_G;
+ jsBody["dataNodeData"] = jsSensorData;
+ std::string dataBody = showValue.write(jsBody);
+ jsonVal["cmdBody"] = dataBody;
+ return showValue.write(jsonVal);
+}
+
+int SqliteDB::QueryofflineData()
+{
+ vec_t vecRet = GetDataMultiLineOfOneColumn(T_SENSOR_INFO(TNAME),T_SENSOR_INFO(DATANODENO),NULL);
+ for(int i = 0; i < vecRet.size();i++){
+ char StaticTableName[50]={0x00};
+ sprintf(StaticTableName,"t_dataStatic_%s",vecRet[i].c_str());
+
+ array_t arrRetData = GetDataMultiLine(StaticTableName, "*","sendMsg = '0' order by timeStamp asc");
+ LOG_INFO("mqttresend check datanodeNo %s,data count %d\n",vecRet[i].c_str(),arrRetData.size());
+ if(arrRetData.size() < 1)
+ continue;
+ for(int j = 0; j < arrRetData.size();j++){
+ char dataTableName[50]={0x00};
+ sprintf(dataTableName,"t_data_%s",vecRet[i].c_str());
+ char tmpWhere[128]={0x00};
+ sprintf(tmpWhere,"sendMsg = '0' and timeStamp = '%s'",arrRetData[j][8].c_str());
+ array_t arrRet = GetDataMultiLine(dataTableName, "*","sendMsg = '0'");
+ if(arrRet.size() > 0){
+ Json::Value valNodeData;
+ Json::Value valNodeFeature;
+ for(int k = 0; k < arrRet.size();k++){
+
+ valNodeFeature["dataNodeNo"] = arrRet[k][0].c_str();
+ valNodeFeature["ChannelId"] = arrRet[k][1].c_str();
+ valNodeFeature["diagnosisPk"] = atof(arrRet[k][2].c_str());
+ valNodeFeature["integratPk"] = atof(arrRet[k][3].c_str());
+ valNodeFeature["integratRMS"] = atof(arrRet[k][4].c_str());
+ valNodeFeature["rmsValues"] = atof(arrRet[k][5].c_str());
+ valNodeFeature["envelopEnergy"] = atof(arrRet[k][6].c_str());
+ valNodeFeature["Amp1"] = atof(arrRet[k][7].c_str());
+ valNodeFeature["Amp2"] = atof(arrRet[k][8].c_str());
+ valNodeFeature["Amp3"] = atof(arrRet[k][9].c_str());
+ valNodeFeature["Amp4"] = atof(arrRet[k][10].c_str());
+ valNodeFeature["Amp5"] = atof(arrRet[k][1].c_str());
+ valNodeFeature["Phase1"] = atof(arrRet[k][12].c_str());
+ valNodeFeature["Phase2"] = atof(arrRet[k][13].c_str());
+ valNodeFeature["Phase3"] = atof(arrRet[k][14].c_str());
+ valNodeFeature["Phase4"] = atof(arrRet[k][15].c_str());
+ valNodeFeature["timeStamp"] = atoi(arrRet[k][17].c_str());
+ valNodeData.append(valNodeFeature);
+ }
+ }
+ //无线传感器信息
+ Json::Value root;
+ Json::Value valdatastatic;
+ Json::Value valNodeData;
+ valdatastatic["TemperatureTop"] = atof(arrRetData[j][2].c_str());
+ valdatastatic["TemperatureBot"] = atof(arrRetData[j][3].c_str());
+ valdatastatic["Dip"] = atof(arrRetData[j][4].c_str());
+ valdatastatic["Voltage"] = atof(arrRetData[j][5].c_str());
+ valdatastatic["ChannelType"] = "STATUS";
+ valdatastatic["ChannelId"] = (arrRetData[j][1].c_str());
+ valdatastatic["TimeStamp"] = atoi(arrRetData[j][8].c_str());
+
+ valdatastatic["dataNodeNo"] = arrRetData[j][0].c_str();
+ valNodeData.append(valdatastatic);
+
+ root["data"] = valNodeData;
+ root["TimeStamp"] = atoi(arrRetData[j][8].c_str());
+ root["dataNodeNo"] = arrRetData[j][0].c_str();
+ root["dataNodeGatewayNo"] = GlobalConfig::MacAddr_G;
+ root["status"] = "resend";
+ Json::FastWriter featureValue;
+ std::string strstatisticData = featureValue.write(root);
+
+ int iRet = data_publish(strstatisticData.c_str(), GlobalConfig::Topic_G.mPubData.c_str());
+ //print_info("dataNodeNo = '%s' and TimeStamp = '%s',MQTT ret = %d\n",arrRetData[j][0].c_str(),nowTimetamp.c_str(),iRet);
+ if(iRet == 0){
+ char updateSql[1024] = { 0 };
+ char whereCon[64] = { 0 };
+ memset(whereCon, 0, 64);
+ sprintf(whereCon, "dataNodeNo = '%s' and TimeStamp = '%s'", arrRetData[j][0].c_str(),arrRetData[j][8].c_str());
+ memcpy(updateSql, "sendMsg='1'",sizeof(updateSql));
+ sql_ctl->UpdateTableData(StaticTableName, updateSql, whereCon);
+ sql_ctl->UpdateTableData(dataTableName, updateSql, whereCon);
+ LOG_INFO("resend success dataNodeNo = %s,TimeStamp = '%s'\n",arrRetData[j][0].c_str(),arrRetData[j][8].c_str());
+ }
+ sleep(1);
+ }
+ }
+ char whereCon[1024] = {0x00};
+ sprintf(whereCon, " SendMsg = 0 ");
+ array_t arrRetData = GetDataMultiLine("t_data_waveSend", "*",whereCon);
+ LOG_INFO("mqttresend check wave count %d\n",arrRetData.size());
+ if(arrRetData.size() > 0){
+ for(int i = 0; i < arrRetData.size();i++){
+ std::string strWaveData = "";
+ if (access(arrRetData[i][1].c_str(), 0) >= 0)
+ {
+ std::vector vecWave;
+ char localtimestamp[32] = { 0 };
+ float fTemp = 0;
+ std::ifstream inFile(arrRetData[i][1].c_str(),ios::in|ios::binary);
+ inFile.read((char *)localtimestamp,sizeof(localtimestamp));
+ while(inFile.read((char *)&fTemp,sizeof(fTemp))){
+ vecWave.push_back(fTemp);
+ }
+
+ for (int i = 0; i < vecWave.size(); i++) {
+ char buf[33]={0x00};
+ memset(buf,0x00,sizeof(buf));
+ sprintf(buf, "%.2f", vecWave[i]);
+ std::string waveTemp(buf);
+ if(i == 0){
+ strWaveData = waveTemp;
+ }
+ strWaveData = strWaveData + "," + waveTemp;
+ }
+ inFile.close();
+ }
+ Json::Value valWaveData;
+ int length = strWaveData.length();
+ valWaveData["number"] = length;
+ valWaveData["channelId"] = arrRetData[i][0];
+ valWaveData["dataNodeNo"] = arrRetData[i][0];
+ valWaveData["dataNodeGatewayNo"] = GlobalConfig::MacAddr_G;
+ valWaveData["SensorEngineeringUnit"] = "";
+ valWaveData["timeStamp"] = arrRetData[i][2];
+ valWaveData["waveData"] = strWaveData;
+ Json::FastWriter WaveValue;
+ std::string WaveData = WaveValue.write(valWaveData);
+ int iRet = data_publish(WaveData.c_str(), GlobalConfig::Topic_G.mPubWaveData.c_str());
+ if(iRet == 0){
+ char whereCon[1024] = {0x00};
+ char updateSql[1024] = {0x00};
+ sprintf(whereCon, "channelID='%s' and timeStamp = '%s' ", arrRetData[i][0].c_str(),arrRetData[i][2].c_str());
+ sprintf(updateSql, "SendMsg = 1");
+ sql_ctl->UpdateTableData("t_data_waveSend", updateSql, whereCon);
+ //char whereCon[64]={0x00};
+ //sprintf(whereCon,"waveName = '%s'",arrRetData[i][1].c_str());
+ //DeleteTableData("t_data_waveSend", whereCon);
+ std::string strCmd = "rm " + arrRetData[i][1];
+ system(strCmd.c_str());
+ LOG_INFO("resend success waveName = %s\n",arrRetData[i][1].c_str());
+ }
+ }
+
+ }
+}
int SqliteDB::TransBegin()
{
return sqlite3_exec(mDBAcess, "begin;", 0, 0, 0);
diff --git a/dbaccess/SH_SqlDB.hpp b/dbaccess/SH_SqlDB.hpp
index 43f942e..afd1a7b 100644
--- a/dbaccess/SH_SqlDB.hpp
+++ b/dbaccess/SH_SqlDB.hpp
@@ -14,9 +14,12 @@ extern "C"{
#define T_SENSOR_INFO(x) T_SENSOR_INFO[T_SENSOR_INFO_##x]
#define T_DATA_INFO(x) T_DATA_INFO[T_DATA_INFO_##x]
#define T_DATASTATIC_INFO(x) T_DATASTATIC_INFO[T_DATASTATIC_INFO_##x]
+#define T_GATEWAY_INFO(x) T_GATEWAY_INFO[T_GATEWAY_INFO_##x]
+#define T_DATANODE_TIME(x) T_DATANODE_TIME[T_DATANODE_TIME_##x]
typedef std::map map_t;
typedef std::vector vec_t;
+typedef std::vector vec_Value;
typedef std::vector array_t;
class SqliteDB : public MySingleton < SqliteDB > {
@@ -25,6 +28,10 @@ public:
virtual ~SqliteDB();
bool OpenDB(const char *pDbName, bool isDB2=false);
void SqliteInit(const char *pDbName, bool isDB2=false);
+ void SqliteInitDel(const char *pDbName);
+ void Createtable(const char *ptableName);
+ void Deletetable(const char *ptableName);
+ void CreatedataStatictable(const char *ptableName);
int TransBegin();
int TransRollback();
int TransCommit();
@@ -34,14 +41,24 @@ public:
int AlterTable(const char *tablename, const char *column, bool isAdd = true, bool isDB2=false);
vec_t GetDataSingleLine(const char *tablename, const char *column, const char *whereCon);
std::string GetData(const char *tablename, const char *column, const char *whereCon);
+ char* GetDataChar(const char *tablename, const char *column, const char *whereCon);
array_t GetDataMultiLine(const char *tablename, const char *column, const char *whereCon);
+ array_t GetDataMultiLineTransaction(const char *tablename, const char *column, const char *whereCon);
vec_t GetDataMultiLineOfOneColumn(const char *tablename, const char *column, const char *whereCon);
+ vec_Value GetDataMultiLineOfOneColumnDouble(const char *tablename, const char *column, const char *whereCon);
int DeleteTableData(const char* tablename, const char* whereCond = NULL, bool isDB2=false);
int DeleteTableDataOneConditon(const char* tablename, const char* condColumnName, const char * condColumnValue, bool isDB2=false);
int UpdateTableData(const char* tablename, const char* updateColumn, const char* whereCond, bool isDB2 = false);
+ int UpdateNodeNameData(const char* tablename, const char* updateColumn, const char* whereCond, bool isDB2 = false);
int UpdateTableDataOneColumn(const char* tablename, const char* columnName, const char* columnValue, const char* whereColName = NULL, const char * whereColValue = NULL, bool isDB2 = false);
int UpdateTableData(const char* directSql, bool isDB2 = false);
int InsertData(const char* tablename, const char* insertValues, int replace = 0, bool expandalbe = false, bool isDB2 = false);
+ int InsertData(const char* insertSql);
+ int CalculateBattery();
+ int CalculateDip();
+ int InintGateway();
+ int QueryofflineData();
+ std::string GetNodeConfigureInfor(const char* whereCon);
int CloseDB();
private:
@@ -107,9 +124,12 @@ typedef enum {
T_DATA_INFO_PHASE2,
T_DATA_INFO_PHASE3,
T_DATA_INFO_PHASE4,
+ T_DATA_INFO_STATICINDEX,
T_DATA_INFO_TIMESTAMP,
+ T_DATA_INFO_SENDMSG,
+ T_DATA_INFO_NODERESEND
}T_DATA_INFO_Index;
-const static char* T_DATA_INFO[] = { "t_data_info", "dataNodeNo", "channelID", "diagnosisPk", "integratPk","integratRMS","rmsValues","envelopEnergy","Amp1","Amp2","Amp3","Amp4","Amp5","Phase1","Phase2","Phase3","Phase4","timeStamp"};
+const static char* T_DATA_INFO[] = { "t_data_info", "dataNodeNo", "channelID", "diagnosisPk", "integratPk","integratRMS","rmsValues","envelopEnergy","Amp1","Amp2","Amp3","Amp4","Amp5","Phase1","Phase2","Phase3","Phase4","StaticIndex","timeStamp","sendMsg","nodeResend"};
typedef enum {
@@ -120,8 +140,46 @@ typedef enum {
T_DATASTATIC_INFO_TEMBOT,
T_DATASTATIC_INFO_DIP,
T_DATASTATIC_INFO_VOLTAGE,
+ T_DATASTATIC_INFO_STATICINDEX,
T_DATASTATIC_INFO_TIMESTAMP,
+ T_DATASTATIC_INFO_SENDMSG,
+ T_DATASTATIC_INFO_NODERESEND
}T_DATASTATIC_INFO_Index;
-const static char* T_DATASTATIC_INFO[] = { "t_datastatic_info","dataNodeNo","channelID","temTop","temBot","dip","voltage","timeStamp"};
+const static char* T_DATASTATIC_INFO[] = { "t_datastatic_info","dataNodeNo","channelID","temTop","temBot","dip","voltage","StaticIndex","timeStamp","sendMsg","nodeResend"};
+typedef enum {
+ T_DATANODE_TIME_TNAME = 0,
+ T_DATANODE_TIME_DATANODENO,
+ T_DATANODE_TIME_SHORTADDR,
+ T_DATANODE_TIME_STATICCYCLE,
+ T_DATANODE_TIME_WAVECYCLE,
+ T_DATANODE_TIME_NODEGROUP,
+ T_DATANODE_TIME_NODEINDEX,
+ T_DATANODE_TIME_NODEWAVEINDEX,
+ T_DATANODE_TIME_STATICTIME,
+ T_DATANODE_TIME_STATICSTARTTIME
+}T_DATANODE_TIME_Index;
+const static char* T_DATANODE_TIME[] = { "t_datanode_time","dataNodeNo","shortaddr","staticcycle","wavecycle","nodegroup","nodeindex","nodewaveindex","statictime","staticstarttime"};
+
+
+typedef enum {
+ T_GATEWAY_INFO_TNAME = 0,
+ T_GATEWAY_INFO_GATEWAYMAC,
+ T_GATEWAY_INFO_SENSORVER,
+ T_GATEWAY_INFO_GATEWAYLOCATION,
+ T_GATEWAY_INFO_ZIGBEEPANID,
+ T_GATEWAY_INFO_ZIGBEECHANNEL,
+ T_GATEWAY_INFO_COMMUNICATIONTYPE,
+ T_GATEWAY_INFO_SIGNAL,
+ T_GATEWAY_INFO_LOCALIP,
+ T_GATEWAY_INFO_SYSTEMVERSION,
+ T_GATEWAY_INFO_PROGRAMVERSION,
+ T_GATEWAY_INFO_WEBVERSION,
+ T_GATEWAY_INFO_SERVERIP,
+ T_GATEWAY_INFO_SERVERPORT,
+ T_GATEWAY_INFO_STATUS,
+ T_GATEWAY_INFO_GATEWAYUPDATE,
+ T_GATEWAY_INFO_MAC2,
+}T_GATEWAY_INFO_Index;
+const static char* T_GATEWAY_INFO[] = { "t_gateway_info","gatewayMAC","sensorVersion","gatewayLocation","zigbeePanID","zigbeeChannel","communicationType","signal","localIP","systemVersion","programVersion","webVersion","serverIP","serverPort","status","gateWayUpdate","MAC2"};
#endif
diff --git a/dial5G/Dial.cpp b/dial5G/Dial.cpp
new file mode 100644
index 0000000..d1158f1
--- /dev/null
+++ b/dial5G/Dial.cpp
@@ -0,0 +1,296 @@
+/*
+ * Dial.cpp
+ *
+ * Created on: 2023年6月13日
+ * Author: chaos
+ */
+#include
+#include
+#include
+#include
+#include
+#include
+#include "../common/SH_CommonFunc.hpp"
+#include "Dial.h"
+
+
+Dial::Dial() {
+ // TODO Auto-generated constructor stub
+ m_fd = 0;
+ m_curState = CPIN;
+ m_dial = 0;
+ m_APN = 0;
+}
+
+Dial::~Dial() {
+ // TODO Auto-generated destructor stub
+}
+
+int Dial::openPort(const char* pPort)
+{
+ m_fd = config_uart(pPort,115200);
+ print_info("m_fd = %d\n",m_fd);
+ return m_fd;
+}
+int Dial::parseData(Event event,const char* pData)
+{
+ print_info("m_curState = %d,event = %d\n",m_curState,event);
+ string signal;
+ string ret;
+ std::string str;
+ int pos = 0;
+ switch(event){
+ case Event_CPIN:
+ if(!strncmp(pData,"READY",5)){
+ m_curState = QCFGNET;
+ }else if(!strncmp(pData,"NOT READY",9)){
+ m_curState = CPIN;
+ GlobalConfig::NetStatus = "\"LIMSRV\"";
+ }
+ break;
+ case Event_QCFGNET:
+ case Event_QCFGSMS:
+ /*ret = GetOneContent(pData,1,",");
+ if(ret == "0")
+ {
+ m_curState = QICSGPAPN;
+ }*/
+ break;
+ case Event_QICSGPAPN:
+ //if(!strcmp(pData,"OK"))
+ {
+ m_curState = QNETDEVCTL;
+ }
+ break;
+ case Event_QENG:
+ GlobalConfig::NetStatus = GetOneContent(pData,1,",");
+ GlobalConfig::NetType = GetOneContent(pData,2,",");
+ signal = GetOneContent(pData,12,",");
+ GlobalConfig::NetSignal = atoi(signal.c_str());
+ print_info("NetStatus = %s,NetSignal = %d\n",GlobalConfig::NetStatus.c_str(),GlobalConfig::NetSignal);
+ break;
+ case Event_QNETDEVCTL:
+ print_info("m_curState Event_QNETDEVCTL = %d\n",m_curState);
+ if(m_dial == 1){
+ m_curState = QNETDEVSTATUS;
+ }
+ break;
+ case Event_QNETDEVSTATUS:
+ ret = GetOneContent(pData,3,",");
+ if(ret == "0" || ret == "")
+ m_curState = QDCHPC;
+ else
+ m_curState = QNETDEVSTATUS;
+ break;
+ case Event_OK:
+ if(m_curState == QNETDEVCTL && m_dial == 1)
+ {
+ m_dial = 0;
+ m_curState = QNETDEVSTATUS;
+ }
+ if(m_curState == Event_QCFGNET){
+ m_curState = QNETDEVCTL;
+ }
+ if(m_curState == QICSGPAPN && m_APN == 1)
+ {
+ m_APN = 0;
+ m_curState = QNETDEVCTL;
+ }
+
+ break;
+ case Event_ERROR:
+ if(m_curState == CPIN && !strcmp(pData,"3")){
+ m_curState = CPIN;
+ GlobalConfig::NetStatus = "\"LIMSRV\"";
+ }
+ if(m_curState == QNETDEVCTL){
+ m_curState = QNETDEVSTATUS;
+ }
+ break;
+ case Event_TEMP:
+ str = string(pData);
+ pos = str.find("soc-thermal");
+ if(pos > 0){
+ std::string socTmp = str.substr(pos+14,2);
+ GlobalConfig::NR5GTemp = socTmp;
+ print_info("NR5GTemp = %s\n",GlobalConfig::NR5GTemp.c_str());
+ }
+
+
+ break;
+ default:
+ break;
+ }
+}
+int Dial::recvData()
+{
+
+ char szbuffer[200]={0x00};
+ int offSize = 0;
+ int timeoutflag = 0;
+ while(1)
+ {
+ char buff[1024]={0x00};
+
+ int ret = read_data(m_fd, buff, 1024, 10);
+ if(ret <= 0){
+ timeoutflag ++;
+ if(timeoutflag > 5)
+ {
+ timeoutflag = 0;
+ const char *strQENG = "+QENG: ";
+ const char *strQNETDEVCTL = "+QNETDEVCTL: ";
+ const char *strQICSGP = "+QICSGP: ";
+ const char *strQNETDEVSTATUS= "+QNETDEVSTATUS: ";
+ const char *strQCFG= "+QCFG: ";
+ const char *strCPIN= "+CPIN: ";
+ const char *strERROR= "+CME ERROR: ";
+ const char *strQTEMP= "+QTEMP: ";
+ const char *strOK= "OK";
+ char data[128] = {0};
+ char *pdata = strstr((char*)szbuffer, strQENG);
+ if(pdata){
+ strncpy(data, pdata+7, sizeof(data));
+ print_purple("strQENG = %s\n",data);
+ parseData(Event_QENG,data);
+ }
+ pdata = strstr((char*)szbuffer, strQNETDEVCTL);
+ if(pdata){
+ strncpy(data, pdata+13, sizeof(data));
+ print_purple("strQNETDEVCTL = %s\n",data);
+ parseData(Event_QNETDEVCTL,data);
+ }
+ pdata = strstr((char*)szbuffer, strQICSGP);
+ if(pdata){
+ strncpy(data, pdata+9, sizeof(data));
+ print_purple("strQICSGP = %s\n",data);
+ parseData(Event_QICSGPAPN,data);
+ }
+ pdata = strstr((char*)szbuffer, strQNETDEVSTATUS);
+ if(pdata){
+ strncpy(data, pdata+16, sizeof(data));
+ print_purple("strQNETDEVSTATUS = %s\n",data);
+ parseData(Event_QNETDEVSTATUS,data);
+ }
+ pdata = strstr((char*)szbuffer, strQCFG);
+ if(pdata){
+ strncpy(data, pdata+7, sizeof(data));
+ print_purple("strQCFG = %s\n",data);
+ parseData(Event_QCFGNET,data);
+ }
+ pdata = strstr((char*)szbuffer, strCPIN);
+ if(pdata){
+ strncpy(data, pdata+7, sizeof(data));
+ print_purple("strCPIN = %s\n",data);
+ parseData(Event_CPIN,data);
+ }
+ pdata = strstr((char*)szbuffer, strQTEMP);
+ if(pdata){
+ strncpy(data, pdata+8, sizeof(data));
+ print_purple("strQTEMP = %s\n",data);
+ parseData(Event_TEMP,data);
+ }
+ pdata = strstr((char*)szbuffer, strERROR);
+ if(pdata){
+ strncpy(data, pdata+12, sizeof(data));
+ print_purple("strERROR = %s\n",data);
+ parseData(Event_ERROR,data);
+ }
+ pdata = strstr((char*)szbuffer, strOK);
+ if(pdata){
+ parseData(Event_OK,data);
+ }
+ memset(szbuffer,0x00,sizeof(szbuffer));
+ offSize = 0;
+ }
+ usleep(100);
+ }else if(ret > 0){
+ print_info("ret = %d,buff = %s\n",ret,buff);
+ memcpy(szbuffer + offSize,buff,ret);
+ offSize = offSize + ret;
+ print_info("szbuffer = %s\n",szbuffer);
+ continue;
+ }
+ usleep(500000);
+ }
+}
+int Dial::queryPin()
+{
+ int iRet = write_data(m_fd,"AT+CPIN?\r\n",12);
+}
+int Dial::configNet()
+{
+ write_data(m_fd,"AT+QCFG=\"NAT\"\r\n",19);
+}
+int Dial::configApn()
+{
+ m_APN = 1;
+ std::string strAPN = ReadStrByOpt(SERVERCONFIG, "Server", "APN");
+ char szCmd[100]={0x00};
+ sprintf(szCmd,"AT+QICSGP=1,1,\"%s\",\"\",\"\",1\r\n",strAPN.c_str());
+ int iRet = write_data(m_fd,szCmd,strlen(strAPN.c_str()) + 34);
+ print_info("configApn = %d,data = %s\n",iRet,szCmd);
+}
+int Dial::getCsq()
+{
+ write_data(m_fd,"AT+QENG=\"servingcell\"\r\n",27);
+}
+int Dial::getTemp()
+{
+ write_data(m_fd,"AT+QTEMP\r\n",12);
+}
+int Dial::conncectUSB()
+{
+ int iRet = write_data(m_fd,"AT+QNETDEVCTL=1,1,1\r\n",23);
+ print_info("conncectUSB = %d\n",iRet);
+}
+int Dial::dial5G()
+{
+ while(1){
+
+ if(m_curState == CPIN){
+ queryPin();
+ }
+ if(m_curState == QCFGNET){
+ configNet();
+ //configims();
+ }
+ if(m_curState == QICSGPAPN){
+ configApn();
+ }
+ if(m_curState == QENG){
+ getCsq();
+
+ }
+ if(m_curState == QNETDEVCTL){
+ conncectUSB();
+ m_dial = 1;
+ }
+ if(m_curState == QNETDEVSTATUS){
+ write_data(m_fd,"AT+QNETDEVSTATUS=1\r\n",22);
+ }
+ if(m_curState == QDCHPC){
+ configdhcp();
+ m_curState = QENG;
+ }
+ sleep(5);
+ getTemp();
+ sleep(15);
+ }
+}
+int Dial::configims()
+{
+ write_data(m_fd,"AT+QCFG=\"ims\",0\r\n",21);
+}
+int Dial::configdhcp()
+{
+ system("busybox udhcpc -f -n -q -t 5 -i usb0");
+}
+int Dial::setState()
+{
+ m_curState = CPIN;
+}
+int Dial::closePort()
+{
+ close(m_fd);
+}
diff --git a/dial5G/Dial.h b/dial5G/Dial.h
new file mode 100644
index 0000000..e4b18cd
--- /dev/null
+++ b/dial5G/Dial.h
@@ -0,0 +1,70 @@
+/*
+ * Dial.h
+ *
+ * Created on: 2023年6月13日
+ * Author: chaos
+ */
+
+#ifndef DIAL5G_DIAL_H_
+#define DIAL5G_DIAL_H_
+#include
+#include "../common/SH_global.h"
+using namespace std;
+class Dial {
+public:
+ Dial();
+ virtual ~Dial();
+
+ //枚举所有状态
+ enum State
+ {
+ CPIN = 0,
+ QCFGNET,
+ QICSGPAPN,
+ QCFGSMS,
+ QENG,
+ QNETDEVCTL,
+ QNETDEVSTATUS,
+ QDCHPC,
+ NORMAL
+ };
+
+ //枚举所有事件
+ enum Event
+ {
+ Event_CPIN = 0,
+ Event_QCFGNET,
+ Event_QICSGPAPN,
+ Event_QCFGSMS,
+ Event_QENG,
+ Event_QNETDEVCTL,
+ Event_QNETDEVSTATUS,
+ Event_OK,
+ Event_ERROR,
+ Event_TEMP
+ };
+
+ State m_curState;
+ int m_fd;
+ int m_dial;
+ int m_APN;
+ int openPort(const char* pPort);
+ int closePort();
+ int recvData();
+ int queryPin();
+ int configNet();
+ int configApn();
+ int getCsq();
+ int getTemp();
+ int conncectUSB();
+ int dial5G();
+ int configims();
+ int configdhcp();
+ int parseData(Event event,const char* pData);
+ int setState();
+
+
+
+};
+
+#endif /* DIAL5G_DIAL_H_ */
diff --git a/jsonparse/SH_JsonCmd.cpp b/jsonparse/SH_JsonCmd.cpp
index 4484706..9d488d0 100644
--- a/jsonparse/SH_JsonCmd.cpp
+++ b/jsonparse/SH_JsonCmd.cpp
@@ -1,6 +1,8 @@
#include "SH_JsonCmd.hpp"
#include "../dbaccess/SH_SqlDB.hpp"
#include "../platform/SH_PlatformInit.hpp"
+#include "../MD5/md5.h"
+
namespace{
PlatformInit *platform = PlatformInit::instance();
@@ -35,7 +37,15 @@ std::string JsonData::JsonCmd_20(Param_20 ¶m)
Json::Value jsSystemInfo;
Json::Value jsBody;
-
+
+ string strwebVersion = ReadStrByOpt(SYSTEMINFOFILE, "Version", "WebVersion");
+ string strsystemVersion = ReadStrByOpt(SYSTEMINFOFILE, "Version", "SystemVersion");
+ string strGatewayVersion = ReadStrByOpt(SYSTEMINFOFILE, "Version", "GateWayVersion");
+
+ jsSystemInfo["WebVersion"] = strwebVersion;
+ jsSystemInfo["SystemVersion"] = strsystemVersion;
+ jsSystemInfo["GateWayVersion"] = strGatewayVersion;
+
jsSystemInfo[JSON_FIELD_NAME] = ReadStrByOpt(SYSTEMINFOFILE, "SystemInfo", "dataNodeGatewayName");
jsSystemInfo[JSON_FIELD_dataNodeGatewayNo] = GlobalConfig::MacAddr_G;
jsSystemInfo[JSON_FIELD_ASSETID] = ReadStrByOpt(SYSTEMINFOFILE, "SystemInfo", "dataNodeGatewayAssetId");
@@ -50,8 +60,8 @@ std::string JsonData::JsonCmd_20(Param_20 ¶m)
jsSystemInfo["zigbeeChannel"] = GlobalConfig::ZigbeeInfo_G.Channel;
jsSystemInfo["zigbeeAddr"] = GlobalConfig::ZigbeeInfo_G.MyAddr;
jsSystemInfo[JSON_FIELD_SERVERIP] = ReadStrByOpt(SERVERCONFIG, "Server", "localServerIpAddress");
- jsSystemInfo[JSON_FIELD_SERVERPORT] = boost::lexical_cast(ReadStrByOpt(SERVERCONFIG, "Server", "localServerPort"));
- jsSystemInfo[JSON_FIELD_CommMode] = boost::lexical_cast(ReadStrByOpt(SERVERCONFIG, "Server", "CommMode"));
+ jsSystemInfo[JSON_FIELD_SERVERPORT] = atoi(ReadStrByOpt(SERVERCONFIG, "Server", "localServerPort").c_str());
+ jsSystemInfo[JSON_FIELD_CommMode] = atoi(ReadStrByOpt(SERVERCONFIG, "Server", "CommMode").c_str());
jsBody["SystemInfo"] = jsSystemInfo;
std::string dataBody = showValue.write(jsBody);
@@ -96,11 +106,18 @@ std::string JsonData::JsonCmd_23(Param_23 ¶m)
WriteStr2Config(SERVERCONFIG, "Server", "localServerIpAddress", param.mServerIp);
WriteStr2Config(SERVERCONFIG, "Server", "localServerPort", param.mPort);
WriteStr2Config(SERVERCONFIG, "Server", "CommMode", param.mCommMode);
- printf("param.mCommMode = %s\n",param.mCommMode.c_str());
+ WriteStr2Config(SERVERCONFIG, "Server", "Password", param.mPassword);
+ WriteStr2Config(SERVERCONFIG, "Server", "UserName", param.mUserName);
+ print_info("param.mCommMode = %s\n",param.mCommMode.c_str());
if("1" == param.mCommMode){//有线连接
system("mv /etc/init.d/S91quectel-CM.sh /etc/init.d/wireless.sh");
- }else if("2" == param.mCommMode){//无线连接
- system("mv /etc/init.d/wireless.sh /etc/init.d/S91quectel-CM.sh");
+ system("mv /etc/init.d/S95check5G /etc/init.d/wireless5G");
+ }else if("2" == param.mCommMode){//无线连接 4G
+ system("mv /etc/init.d/wireless4G /etc/init.d/S91check4G");
+ system("mv /etc/init.d/S95check5G /etc/init.d/wireless5G");
+ }else if("3" == param.mCommMode){//无线连接 5G
+ system("mv /etc/init.d/wireless5G /etc/init.d/S95check5G");
+ system("mv /etc/init.d/S91check4G /etc/init.d/wireless4G");
}
sleep(1);
system("reboot");
@@ -114,9 +131,23 @@ std::string JsonData::JsonCmd_23(Param_23 ¶m)
Json::Value jsSystemSetting;
Json::Value jsBody;
+ Json::Value jsHeart;
+ Json::FastWriter fw;
+ jsHeart["dataNodeGatewayNo"] = GlobalConfig::MacAddr_G;
+ jsHeart["status"] = "online_V1.0.1";
+ std::string strJson = fw.write(jsHeart);
+ int iRet = data_publish(strJson.c_str(), GlobalConfig::Topic_G.mPubHeart.c_str());
+ if(iRet == 0){
+ jsBody["status"] = 0;
+ }else{
+ jsBody["status"] = -1;
+ }
+
jsBody[JSON_FIELD_SERVERIP] = ReadStrByOpt(SERVERCONFIG, "Server", "localServerIpAddress");
- jsBody[JSON_FIELD_SERVERPORT] = boost::lexical_cast(ReadStrByOpt(SERVERCONFIG, "Server", "localServerPort"));
- jsBody[JSON_FIELD_CommMode] = boost::lexical_cast(ReadStrByOpt(SERVERCONFIG, "Server", "CommMode"));
+ jsBody[JSON_FIELD_SERVERPORT] = atoi(ReadStrByOpt(SERVERCONFIG, "Server", "localServerPort").c_str());
+ jsBody[JSON_FIELD_CommMode] = atoi(ReadStrByOpt(SERVERCONFIG, "Server", "CommMode").c_str());
+ jsBody["Password"] = (ReadStrByOpt(SERVERCONFIG, "Server", "Password"));
+ jsBody["UserName"] = (ReadStrByOpt(SERVERCONFIG, "Server", "UserName"));
std::string dataBody = showValue.write(jsBody);
jsonVal["cmdBody"] = dataBody;
@@ -128,39 +159,62 @@ std::string JsonData::JsonCmd_23(Param_23 ¶m)
std::string JsonData::JsonCmd_25(Param_25 ¶m)
{
- Json::Value jsonVal;
- jsonVal.clear();
- jsonVal["success"] = true;
- jsonVal["message"] = "";
- if (0 == param.mMode) {
- WriteStr2Config(NETWORKCONFIG, "Net", "dnsName", param.mDnsName);
- WriteStr2Config(NETWORKCONFIG, "Net", "networkPortStatus", param.mNetworkPortStatus);
- WriteStr2Config(NETWORKCONFIG, "Net", "gateway", param.mGateway);
- WriteStr2Config(NETWORKCONFIG, "Net", "subnetMask", param.mSubnetMask);
- WriteStr2Config(NETWORKCONFIG, "Net", "ipAddress", param.mIp);
- WriteStr2Config(NETWORKCONFIG, "Net", "hostName", param.mHostName);
- system("reboot");
- }
+ Json::Value jsonVal;
+ jsonVal.clear();
+ jsonVal["success"] = true;
+ jsonVal["message"] = " ";
+ jsonVal["cmd"] = "25";
+ bool bFlag1 = CheckIP(param.mGateway.c_str());
+ bool bFlag2 = IsValidMask(param.mSubnetMask);
+ bool bFlag3 = CheckIP(param.mIp.c_str());
+ bool bFlag4 = false;
+ if(param.mDnsName.size()>0){
+ bFlag4 = CheckIP(param.mDnsName.c_str());
+ }else{
+ bFlag4 = true;
+ }
+ print_info("bFlag1 = %d,bFlag2 = %d,bFlag3 = %d,bFlag4 = %d\n",bFlag1,bFlag2,bFlag3,bFlag4);
- jsonVal["cmd"] = "25";
- jsonVal["dataNodeGatewayNo"] = GlobalConfig::MacAddr_G;
- jsonVal["cmdSerial"] = param.mCmdSerial;
+ if (0 == param.mMode &&(bFlag1 && bFlag2 && bFlag3 && bFlag4) && param.mNetworkPortStatus == "STATIC") {
+ WriteStr2Config(NETWORKCONFIG, param.mNet, "dnsName", param.mDnsName);
+ WriteStr2Config(NETWORKCONFIG, param.mNet, "networkPortStatus", param.mNetworkPortStatus);
+ WriteStr2Config(NETWORKCONFIG, param.mNet, "gateway", param.mGateway);
+ WriteStr2Config(NETWORKCONFIG, param.mNet, "subnetMask", param.mSubnetMask);
+ WriteStr2Config(NETWORKCONFIG, param.mNet, "ipAddress", param.mIp);
+ WriteStr2Config(NETWORKCONFIG, param.mNet, "hostName", param.mHostName);
- Json::Value jsSystemSetting;
- Json::Value jsBody;
+#ifdef IMX6UL_GATEWAY
+ char GateWay[100]={0x00};
+ sprintf(GateWay,"sed -i '7c route add default gw %s' /etc/init.d/S90start_userapp.sh",param.mGateway.c_str());
+ print_info("GateWay = %s\n",GateWay);
+ system(GateWay);
+#endif
+ platform->EquipIpInit(param.mNet);
+ }else if(0 == param.mMode && param.mNetworkPortStatus == "DHCP"){
+ WriteStr2Config(NETWORKCONFIG, param.mNet, "dnsName", "");
+ WriteStr2Config(NETWORKCONFIG, param.mNet, "networkPortStatus", param.mNetworkPortStatus);
+ WriteStr2Config(NETWORKCONFIG, param.mNet, "gateway", "");
+ WriteStr2Config(NETWORKCONFIG, param.mNet, "subnetMask", "");
+ WriteStr2Config(NETWORKCONFIG, param.mNet, "ipAddress", "");
+ WriteStr2Config(NETWORKCONFIG, param.mNet, "hostName", "");
- jsBody["dnsName"] = ReadStrByOpt(NETWORKCONFIG, "Net", "dnsName");
- jsBody["networkPortStatus"] = ReadStrByOpt(NETWORKCONFIG, "Net", "networkPortStatus");
- jsBody["gateway"] = ReadStrByOpt(NETWORKCONFIG, "Net", "gateway");
- jsBody["subnetMask"] = ReadStrByOpt(NETWORKCONFIG, "Net", "subnetMask");
- jsBody["dataWatchIpAddress"] = ReadStrByOpt(NETWORKCONFIG, "Net", "ipAddress");
- jsBody["hostName"] = ReadStrByOpt(NETWORKCONFIG, "Net", "hostName");
+#ifdef IMX6UL_GATEWAY
+ system("sed -i '7c udhcpc -i eth0 > /dev/null &' /etc/init.d/S90start_userapp.sh");
+#endif
+ platform->EquipIpInit(param.mNet);
- std::string dataBody = showValue.write(jsBody);
- jsonVal["cmdBody"] = dataBody;
+ }else if(0 == param.mMode &&(!bFlag1 || !bFlag2 || !bFlag3 || !bFlag4) && param.mNetworkPortStatus == "STATIC"){
+ jsonVal["success"] = false;
+ }
- return showValue.write(jsonVal);
+ jsonVal["content"]["dnsName"] = ReadStrByOpt(NETWORKCONFIG, param.mNet, "dnsName");
+ jsonVal["content"]["networkPortStatus"] = ReadStrByOpt(NETWORKCONFIG, param.mNet, "networkPortStatus");
+ jsonVal["content"]["gateway"] = ReadStrByOpt(NETWORKCONFIG, param.mNet, "gateway");
+ jsonVal["content"]["subnetMask"] = ReadStrByOpt(NETWORKCONFIG, param.mNet, "subnetMask");
+ jsonVal["content"]["dataWatchIpAddress"] = ReadStrByOpt(NETWORKCONFIG, param.mNet, "ipAddress");
+ jsonVal["content"]["hostName"] = ReadStrByOpt(NETWORKCONFIG, param.mNet, "hostName");
+ return showValue.write(jsonVal);
}
@@ -182,45 +236,46 @@ std::string JsonData::JsonCmd_26(Param_26 ¶m)
Json::Value jsSensorData;
jsSensorData["dataNodeNo"] = arrRes[j][0];
jsSensorData["dataNodeName"] = arrRes[j][1];
- jsSensorData["initFlag"] = boost::lexical_cast(arrRes[j][2]);
- jsSensorData["accFlag"] = boost::lexical_cast(arrRes[j][3]);
- jsSensorData["zigbeeFlag"] = boost::lexical_cast(arrRes[j][4]);
- jsSensorData["temTopFlag"] = boost::lexical_cast(arrRes[j][5]);
- jsSensorData["temBotFlag"] = boost::lexical_cast(arrRes[j][6]);
+ jsSensorData["initFlag"] = atoi(arrRes[j][2].c_str());
+ jsSensorData["accFlag"] = atoi(arrRes[j][3].c_str());
+ jsSensorData["zigbeeFlag"] = atoi(arrRes[j][4].c_str());
+ jsSensorData["temTopFlag"] = atoi(arrRes[j][5].c_str());
+ jsSensorData["temBotFlag"] = atoi(arrRes[j][6].c_str());
+ jsSensorData["equipsta"] = atoi(arrRes[j][7].c_str());
jsSensorData["hardVersion"] = arrRes[j][8];
jsSensorData["softVersion"] = arrRes[j][9];
jsSensorData["bpNo"] = arrRes[j][10];
jsSensorData["serialNo"] = arrRes[j][11];
jsSensorData["firstPowerTime"] = arrRes[j][12];
- jsSensorData["WakeupTime"] = boost::lexical_cast(arrRes[j][13]);
- jsSensorData["StaticTime"] = boost::lexical_cast(arrRes[j][14]);
- jsSensorData["WaveTime"] = boost::lexical_cast(arrRes[j][15]);
+ jsSensorData["WakeupTime"] = atoi(arrRes[j][13].c_str());
+ jsSensorData["StaticTime"] = atoi(arrRes[j][14].c_str());
+ jsSensorData["WaveTime"] = atoi(arrRes[j][15].c_str());
jsSensorData["BateryV"] = arrRes[j][16];
jsSensorData["ProductNo"] = arrRes[j][17];
- jsSensorData["configFlag"] = boost::lexical_cast(arrRes[j][18]);
+ jsSensorData["configFlag"] = atoi(arrRes[j][18].c_str());
jsSensorData["startBrands"] = arrRes[j][19];
jsSensorData["stopBrands"] = arrRes[j][20];
- jsSensorData["featureInterVal"] = boost::lexical_cast(arrRes[j][21]);
- jsSensorData["waveInterVal"] = boost::lexical_cast(arrRes[j][22]);
- jsSensorData["samplingRate"] = boost::lexical_cast(arrRes[j][23]);
- printf("stopBrands11111 = %s\n",arrRes[j][20].c_str());
- // jsSensorData["scope"] = boost::lexical_cast(arrRes[j][24]);
- jsSensorData["range"] = boost::lexical_cast(arrRes[j][25]);
+ jsSensorData["featureInterVal"] = (arrRes[j][21]);
+ jsSensorData["waveInterVal"] = atoi(arrRes[j][22].c_str());
+ jsSensorData["samplingRate"] = atoi(arrRes[j][23].c_str());
+ // jsSensorData["scope"] = atoi(arrRes[j][24]);
+ jsSensorData["range"] = atoi(arrRes[j][25].c_str());
jsSensorData["envelopeBandPass"] = arrRes[j][26];
jsSensorData["faultFrequency"] = arrRes[j][27];
jsSensorData["zigbeePanId"] = arrRes[j][28];
- jsSensorData["zigbeeChannel"] = boost::lexical_cast(arrRes[j][29]);
+ jsSensorData["zigbeeChannel"] = (arrRes[j][29]);
jsSensorData["zigbeeAddr"] = arrRes[j][30];
jsSensorData["zigbeeLongAddr"] = arrRes[j][31];
jsSensorData["zigbeeDesAddr"] = arrRes[j][32];
- jsSensorData["ZigbeePower"] = boost::lexical_cast(arrRes[j][33]);
- jsSensorData["ZigbeeRetry"] = boost::lexical_cast(arrRes[j][34]);
- jsSensorData["ZigbeeRetryGap"] = boost::lexical_cast(arrRes[j][35]);
- jsSensorData["ACCSampleTime"] = boost::lexical_cast(arrRes[j][36]);
- jsSensorData["status"] = boost::lexical_cast(arrRes[j][37]);
+ jsSensorData["ZigbeePower"] = atoi(arrRes[j][33].c_str());
+ jsSensorData["ZigbeeRetry"] = atoi(arrRes[j][34].c_str());
+ jsSensorData["ZigbeeRetryGap"] = atoi(arrRes[j][35].c_str());
+ jsSensorData["ACCSampleTime"] = atoi(arrRes[j][36].c_str());
+ jsSensorData["status"] = atoi(arrRes[j][37].c_str());
jsSensorData["timeStamp"] = arrRes[j][38];
- jsSensorData["viff"] = boost::lexical_cast(arrRes[j][39]);
- jsSensorData["RSSI"] = boost::lexical_cast(arrRes[j][40]);
+ jsSensorData["viff"] = atoi(arrRes[j][39].c_str());
+ jsSensorData["RSSI"] = atoi(arrRes[j][40].c_str());
+ jsSensorData["Update"] = atoi(arrRes[j][41].c_str());
jsArray.append(jsSensorData);
}
} else {
@@ -257,6 +312,7 @@ std::string JsonData::JsonCmd_27(Json::Value & recvBody)
sql_ctl->DeleteTableData(T_SENSOR_INFO(TNAME), whereCon);
sql_ctl->DeleteTableData(T_DATA_INFO(TNAME), whereCon);
sql_ctl->DeleteTableData(T_DATASTATIC_INFO(TNAME), whereCon);
+ sql_ctl->DeleteTableData(T_DATANODE_TIME(TNAME), whereCon);
}
} else {
jsonVal["success"] = false;
@@ -277,22 +333,42 @@ std::string JsonData::JsonCmd_50(Json::Value & recvBody)
std::string updateDevice = recvBody["updateDevice"].asString();//1 DataNode 2 GateWay
std::string updateURL = recvBody["updateURL"].asString();
std::string updateName = recvBody["updateName"].asString();
+ std::string md5 = recvBody["MD5"].asString();
std::string strResponse;
- updateName = "/opt/update/DataNode/" + updateName;
- bool bDownload = 1;
- int iRet = pDataTrans->download( (char*)updateName.c_str(),updateURL, strResponse, bDownload);
+ updateName = "/opt/" + updateName;
+ if (access(updateName.c_str(), 0) == 0){
+ char cmd[100]={0x00};
+ sprintf(cmd,"rm -rf %s",updateName.c_str());
+ system(cmd);
+ }
+ sleep(2);
+// int iRet = pDataTrans->download( (char*)updateName.c_str(),updateURL, strResponse, bDownload);
+ int iRet = pDataTrans->dl_curl_post_req( updateURL,"",updateName);
if(iRet != 0){
jsonVal["success"] = false;
jsonVal["message"] = "download failed";
return showValue.write(jsonVal);
}
+ string md5Val = md5file(updateName.c_str());
+ printf("md5Val = %s\n",md5Val.c_str());
+ printf("md5 = %s\n",md5.c_str());
+ if(md5 != md5Val){
+ jsonVal["success"] = false;
+ jsonVal["message"] = "download file check failed";
+ return showValue.write(jsonVal);
+ }
if(updateDevice == "1"){
- string strcmd = "tar zxvf ";
+ string strcmd = "tar xvf ";
strcmd = strcmd + updateName;
- strcmd = strcmd + " -C /opt/update/DataNode/";
+ strcmd = strcmd + " -C /opt/";
system(strcmd.c_str());
- }else{
-
+ }else if (updateDevice == "2"){
+ /* string strcmd = "tar xvf ";
+ strcmd = strcmd + updateName;
+ strcmd = strcmd + " -C /opt/update/";
+ system(strcmd.c_str());*/
+ sleep(3);
+ system("/opt/opt.sh");
}
return showValue.write(jsonVal);
}
@@ -316,7 +392,104 @@ std::string JsonData::JsonCmd_51(Json::Value & recvBody)
}
return showValue.write(jsonVal);
}
+std::string JsonData::JsonCmd_52()
+{
+ Json::Value jsonVal;
+ jsonVal.clear();
+ jsonVal["success"] = true;
+ jsonVal["message"] = "";
+ char whereCon[512] = {};
+ std::string strTimeStamp = "";
+ char selectCon[128] = { 0 };
+ memcpy(selectCon,"sendMsg = '0'",sizeof(selectCon));
+ int count = sql_ctl->GetTableRows(T_DATASTATIC_INFO(TNAME), selectCon);
+ if(count < 1){
+ return "";
+ }
+ for(int i = 0 ; i < count ;i++)
+ {
+ Json::Value jsSensor;
+ std::string strDataNodeNo = "";
+ jsonVal.clear();
+ jsonVal["cmd"] = "52";
+ memcpy(whereCon, "sendMsg = '0' ORDER BY timeStamp DESC LIMIT 0,3",sizeof(whereCon));
+ // 自数据库获取传感器特征数据
+ array_t arrRes;
+ arrRes = sql_ctl->GetDataMultiLine(T_DATA_INFO(TNAME), "*", whereCon);
+ int iResult = arrRes.size();
+ if (iResult > 0) {
+ for (int j = 0; j < iResult; j++) {
+ Json::Value jsChannelData;
+ strDataNodeNo = arrRes[j][0];
+ jsChannelData["ChannelId"] = arrRes[j][1];
+ jsChannelData["ChannelType"] = "ACCELEROMETER";
+ jsChannelData["DiagnosisPeak"] = atof(arrRes[j][2].c_str());
+ jsChannelData["IntegratPk2Pk/2"] = atof(arrRes[j][3].c_str());
+ jsChannelData["IntegratRMS"] = atof(arrRes[j][4].c_str());
+ jsChannelData["RMSValues"] = atof(arrRes[j][5].c_str());
+ jsChannelData["EnvelopEnergy"] = atof(arrRes[j][6].c_str());
+ jsChannelData["1xAmp"] = atof(arrRes[j][7].c_str());
+ jsChannelData["2xAmp"] = atof(arrRes[j][8].c_str());
+ jsChannelData["3xAmp"] = atof(arrRes[j][9].c_str());
+ jsChannelData["4xAmp"] = atof(arrRes[j][10].c_str());
+ jsChannelData["5xAmp"] = atof(arrRes[j][11].c_str());
+ jsChannelData["1xPhase"] = atof(arrRes[j][12].c_str());
+ jsChannelData["2xPhase"] = atof(arrRes[j][13].c_str());
+ jsChannelData["3xPhase"] = atof(arrRes[j][14].c_str());
+ jsChannelData["4xPhase"] = atof(arrRes[j][15].c_str());
+ jsChannelData["TimeStamp"] = atof(arrRes[j][17].c_str());
+ strTimeStamp = std::string(arrRes[j][16]);
+ jsSensor.append(jsChannelData);
+ }
+ }
+ memset(selectCon,0x00,sizeof(selectCon));
+ sprintf(selectCon, "dataNodeNo='%s' and sendMsg = '0' ORDER BY timeStamp DESC LIMIT 0,1", strDataNodeNo.c_str());
+ vec_t vecRes = sql_ctl->GetDataSingleLine(T_DATASTATIC_INFO(TNAME), "*", selectCon);
+ Json::Value jsStaticData;
+ if(vecRes.size()>0){
+ jsStaticData["TemperatureTop"] = atof(vecRes[2].c_str());
+ jsStaticData["TemperatureBot"] = atof(vecRes[3].c_str());
+ jsStaticData["Dip"] = atof(vecRes[4].c_str());
+ jsStaticData["Voltage"] = atof(vecRes[5].c_str());
+ jsStaticData["ChannelType"] = "STATUS";
+ jsStaticData["ChannelId"] = vecRes[1];
+ jsStaticData["TimeStamp"] = vecRes[7];
+ jsStaticData["dataNodeNo"] = strDataNodeNo;
+ }
+
+ jsSensor.append(jsStaticData);
+
+ jsonVal["content"].append(jsSensor);
+ std::string data = showValue.write(jsonVal);
+ memset(whereCon,0x00,sizeof(whereCon));
+ sprintf(whereCon,"sendMsg = '0' and timeStamp = '%s'",strTimeStamp.c_str());
+ int iRet = data_publish(data.c_str(), GlobalConfig::Topic_G.mPubCmd.c_str());
+ if(iRet == 0){
+ sql_ctl->DeleteTableData(T_DATA_INFO(TNAME),whereCon,0);
+ sql_ctl->DeleteTableData(T_DATASTATIC_INFO(TNAME),whereCon,0);
+ }
+ usleep(100);
+ }
+ return "";
+}
+std::string JsonData::JsonCmd_53(Json::Value & recvBody)
+{
+ Json::Value jsonVal;
+ jsonVal.clear();
+ jsonVal["success"] = true;
+ jsonVal["message"] = "";
+ jsonVal["cmd"] = "53";
+ jsonVal["dataNodeGatewayNo"] = GlobalConfig::MacAddr_G;
+ std::string looseValue = recvBody["looseValue"].asString();
+
+ int iRet = writeStringVlaue("config", "loose",(char*)looseValue.c_str(),(char*)GlobalConfig::Config_G.c_str());
+ if(iRet != 0){
+ jsonVal["success"] = false;
+ jsonVal["message"] = "update failed";
+ }
+ return showValue.write(jsonVal);
+}
std::string JsonData::JsonCmd_29(Param_29 ¶m)
{
Json::Value jsonVal;
@@ -325,23 +498,22 @@ std::string JsonData::JsonCmd_29(Param_29 ¶m)
jsonVal.clear();
jsonVal["cmd"] = "29";
jsonVal["dataNodeGatewayNo"] = GlobalConfig::MacAddr_G;
- jsonVal["cmdSerial"] = param.mCmdSerial;
-
+// jsonVal["cmdSerial"] = param.mCmdSerial;
array_t arrRes;
arrRes = sql_ctl->GetDataMultiLine(T_SENSOR_INFO(TNAME), "*", NULL);
int iResult = arrRes.size();
+// LOG_INFO("iResult = %d",iResult);
if (iResult > 0) {
for (int i = 0; i < iResult; i++) {
Json::Value jsDataNode;
- jsDataNode["dataNodeNo"] = arrRes[i][1];
- jsDataNode["status"] = boost::lexical_cast(arrRes[i][24]);
+ jsDataNode["dataNodeNo"] = arrRes[i][0];
+ jsDataNode["status"] = atoi(arrRes[i][37].c_str());
jsBody["dataNodeArray"].append(jsDataNode);
}
}
-
+
std::string strBody = showValue.write(jsBody);
jsonVal["cmdBody"] = strBody;
-
return showValue.write(jsonVal);
}
@@ -382,34 +554,38 @@ void JsonData::JsonCmd_39(Json::Value &recvBody)
}
void JsonData::DataNodeStatusCheck()
{
- vec_t vetRes = sql_ctl->GetDataMultiLineOfOneColumn(T_SENSOR_INFO(TNAME), T_SENSOR_INFO(DATANODENO), NULL);
+ array_t vetRes = sql_ctl->GetDataMultiLine(T_SENSOR_INFO(TNAME), "*", NULL);
int nSize = vetRes.size();
char localtimestamp[32] = { 0 };
GetTimeNet(localtimestamp, 1);
std::string nowTimetamp = std::string(localtimestamp);
- int lNowTime = boost::lexical_cast(nowTimetamp);
-
+ int lNowTime = atoi(nowTimetamp.c_str());
+ int onlineCheck = readIntValue( "config", "online",(char*)GlobalConfig::Config_G.c_str());
+ int loseTime = readIntValue( "config", "loseTime",(char*)GlobalConfig::Config_G.c_str());
if (nSize > 0) {
for (int i = 0; i < nSize; i++) {
- std::string strDataNodeNo = vetRes[i];
+ std::string strDataNodeNo = vetRes[i][0];
std::string strChannelId= strDataNodeNo + "-X";
- char whereCon[64] = {};
+ char whereCon[512] = {0x00},tablename[128]={0x00};
sprintf(whereCon, "dataNodeNo='%s' and channelID='%s' ORDER BY timeStamp DESC LIMIT 0,1", strDataNodeNo.c_str(), strChannelId.c_str());
- array_t arrRes;
- std::string strTimeRes = sql_ctl->GetData(T_DATA_INFO(TNAME), T_DATA_INFO(TIMESTAMP), whereCon);
+ sprintf(tablename,"t_data_%s",strDataNodeNo.c_str());
+ std::string strTimeRes = sql_ctl->GetData(tablename, "timeStamp", whereCon);
if (strTimeRes.length() > 0) {
- int llastTime = boost::lexical_cast(strTimeRes);
+ int llastTime = atoi(strTimeRes.c_str());
int lTimeTemp = lNowTime - llastTime;
- LOG_INFO("lNowTime = %d,llastTime = %d",lNowTime,llastTime);
lTimeTemp = abs(lTimeTemp);
- if (lTimeTemp > onlineCheck) {
- LOG_INFO("0-lTimeTemp = %d,onlineCheck = %d",lTimeTemp,onlineCheck);
+ if (lTimeTemp > onlineCheck){
+ LOG_DEBUG("离线 DataNodeStatusCheck lNowTime = %d,llastTime = %d,interval = %s\n",lNowTime,llastTime,vetRes[i][21].c_str());
char whereCon[32] = { 0 };
sprintf(whereCon, "dataNodeNo='%s'", strDataNodeNo.c_str());
sql_ctl->UpdateTableData(T_SENSOR_INFO(TNAME), "status='0'", whereCon);
+ }else if(lTimeTemp > (loseTime * atoi(vetRes[i][21].c_str()) * 60)){
+ LOG_DEBUG("掉线 DataNodeStatusCheck lNowTime = %d,llastTime = %d,interval = %s\n",lNowTime,llastTime,vetRes[i][21].c_str());
+ char whereCon[32] = { 0 };
+ sprintf(whereCon, "dataNodeNo='%s'", strDataNodeNo.c_str());
+ sql_ctl->UpdateTableData(T_SENSOR_INFO(TNAME), "status='2'", whereCon);
}else {
- LOG_INFO("1-lTimeTemp = %d,onlineCheck = %d",lTimeTemp,onlineCheck);
char whereCon[32] = { 0 };
sprintf(whereCon, "dataNodeNo='%s'", strDataNodeNo.c_str());
sql_ctl->UpdateTableData(T_SENSOR_INFO(TNAME), "status='1'", whereCon);
@@ -481,7 +657,7 @@ std::string JsonData::JsonCmd_Cgi_02(Param_02 ¶m)
if (0 == param.mMode) {
jsonVal["type"] = "SET";
SetTime((unsigned long)param.mTimeStamp);
- boost::this_thread::sleep(boost::posix_time::milliseconds(200));
+ usleep(200);
system("hwclock -w");
} else if (1 == param.mMode) {
char cmd[256] = { 0 };
@@ -489,7 +665,7 @@ std::string JsonData::JsonCmd_Cgi_02(Param_02 ¶m)
GetTimeNet(localtimestamp, 1);
std::string nowTimetamp = std::string(localtimestamp);
jsonVal["type"] = "GET";
- jsonVal["timeStamp"] = boost::lexical_cast(nowTimetamp);
+ jsonVal["timeStamp"] = atoi(nowTimetamp.c_str());
}
return showValue.write(jsonVal);
@@ -554,81 +730,290 @@ std::string JsonData::JsonCmd_Cgi_08()
return showValue.write(jsonVal);
}
-std::string JsonData::JsonCmd_Cgi_09()
+std::string JsonData::JsonCmd_Cgi_09(Param_09 ¶m)
{
- Json::Value jsonVal;
- jsonVal.clear();
+ Json::Value jsonVal;
+ jsonVal.clear();
- jsonVal[JSON_FIELD_CMD] = "09";
- jsonVal["success"] = true;
- jsonVal["message"] = " ";
+ jsonVal[JSON_FIELD_CMD] = "09";
+ jsonVal["success"] = true;
+ jsonVal["message"] = " ";
- vec_t vetRes = sql_ctl->GetDataMultiLineOfOneColumn(T_SENSOR_INFO(TNAME), T_SENSOR_INFO(DATANODENO), NULL);
- int nSize = vetRes.size();
-
- if (nSize > 0) {
- for (int i = 0; i < nSize; i++) {
- print_info("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@vetRes=%s\n",vetRes[i].c_str());
- Json::Value jsSensor;
- std::string strDataNodeNo = vetRes[i];
- char whereCon[64] = {};
- sprintf(whereCon, "dataNodeNo='%s' ORDER BY timeStamp DESC LIMIT 0,3", strDataNodeNo.c_str());
- // 自数据库获取传感器特征数据
- array_t arrRes;
- arrRes = sql_ctl->GetDataMultiLine(T_DATA_INFO(TNAME), "*", whereCon);
- int iResult = arrRes.size();
- if (iResult > 0) {
- for (int j = 0; j < iResult; j++) {
- Json::Value jsChannelData;
- jsChannelData["ChannelId"] = arrRes[j][1];
- jsChannelData["ChannelType"] = "ACCELEROMETER";
- jsChannelData["DiagnosisPeak"] = boost::lexical_cast(arrRes[j][2]);
- jsChannelData["IntegratPk2Pk/2"] = boost::lexical_cast(arrRes[j][3]);
- jsChannelData["IntegratRMS"] = boost::lexical_cast(arrRes[j][4]);
- jsChannelData["RMSValues"] = boost::lexical_cast(arrRes[j][5]);
- jsChannelData["EnvelopEnergy"] = boost::lexical_cast(arrRes[j][6]);
- jsChannelData["1xAmp"] = boost::lexical_cast(arrRes[j][7]);
- jsChannelData["2xAmp"] = boost::lexical_cast(arrRes[j][8]);
- jsChannelData["3xAmp"] = boost::lexical_cast(arrRes[j][9]);
- jsChannelData["4xAmp"] = boost::lexical_cast(arrRes[j][10]);
- jsChannelData["5xAmp"] = boost::lexical_cast(arrRes[j][11]);
- jsChannelData["1xPhase"] = boost::lexical_cast(arrRes[j][12]);
- jsChannelData["2xPhase"] = boost::lexical_cast(arrRes[j][13]);
- jsChannelData["3xPhase"] = boost::lexical_cast(arrRes[j][14]);
- jsChannelData["4xPhase"] = boost::lexical_cast(arrRes[j][15]);
- jsChannelData["TimeStamp"] = boost::lexical_cast(arrRes[j][16]);
- jsSensor.append(jsChannelData);
- }
- }
-
- char selectCon[128] = { 0 };
- sprintf(selectCon, "dataNodeNo='%s' ORDER BY timeStamp DESC LIMIT 0,1", strDataNodeNo.c_str());
- vec_t vecRes = sql_ctl->GetDataSingleLine(T_DATASTATIC_INFO(TNAME), "*", selectCon);
- Json::Value jsStaticData;
- if(vecRes.size()>0){
- jsStaticData["TemperatureTop"] = boost::lexical_cast(vecRes[2]);
- jsStaticData["TemperatureBot"] = boost::lexical_cast(vecRes[3]);
- jsStaticData["Dip"] = boost::lexical_cast(vecRes[4]);
- jsStaticData["Voltage"] = boost::lexical_cast(vecRes[5]);
- jsStaticData["ChannelType"] = "STATUS";
- jsStaticData["ChannelId"] = vecRes[1];
- jsStaticData["TimeStamp"] = vecRes[6];
- jsStaticData["dataNodeNo"] = strDataNodeNo;
- }
+ char localtimestamp[32] = { 0 };
+ GetTimeNet(localtimestamp, 1);
+ std::string nowTimetamp = std::string(localtimestamp);
+ char looseValue[10]={0x00};
+ readStringValue("config", "loose",looseValue,(char*)GlobalConfig::Config_G.c_str());
- jsSensor.append(jsStaticData);
+ vec_t vetRes = sql_ctl->GetDataMultiLineOfOneColumn(T_SENSOR_INFO(TNAME), T_SENSOR_INFO(DATANODENO), NULL);
+ int nSize = vetRes.size();
+ if (nSize > 0) {
+ int packgeNo = param.mPackageFlag;
+ int packgeMax = 0;
+ int packgeNum = 0;
+ jsonVal["package"] = packgeNo;
+ int lastSize = nSize % 10;
+ int index = nSize / 10;
+ if(lastSize > 0 && index > 0){
+ packgeMax = index +1;
+ if(packgeNo +1 == packgeMax){
+ packgeNum = nSize;
+ jsonVal["packageMax"] = index + 1;
+ }
+ else{
+ packgeNum = (packgeNo+1) * 10;
+ jsonVal["packageMax"] = index +1;
+ }
+ }
+ else if(lastSize == 0 && index > 0){
+ packgeNum = (packgeNo+1) * 10;
+ packgeMax = index;
+ jsonVal["packageMax"] = index;
+ }else if(lastSize > 0 && index == 0){
+ packgeNum = lastSize;
+ packgeMax = index+1;
+ jsonVal["packageMax"] = index+1;
+ }
- jsonVal["content"].append(jsSensor);
- }
- } else {
- jsonVal["content"].resize(0);
- }
+ printf("09 packgeNo = %d,packgeNum = %d,lastSize = %d,index = %d\n",packgeNo,packgeNum,lastSize,index);
+ for (int i = packgeNo * 10; i < packgeNum; i++) {
+ print_info("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@vetRes=%s\n",vetRes[i].c_str());
+ Json::Value jsSensor;
+ std::string strDataNodeNo = vetRes[i];
+ char whereCon[512] = {};
+ sprintf(whereCon, "dataNodeNo='%s' ORDER BY timeStamp DESC LIMIT 0,3", strDataNodeNo.c_str());
+ // 自数据库获取传感器特征数据
+ array_t arrRes;
+ arrRes = sql_ctl->GetDataMultiLineTransaction(T_DATA_INFO(TNAME), "*", whereCon);
+ int iResult = arrRes.size();
+ if (iResult > 0) {
+ for (int j = 0; j < iResult; j++) {
+ Json::Value jsChannelData;
+ jsChannelData["ChannelId"] = arrRes[j][1];
+ jsChannelData["ChannelType"] = "ACCELEROMETER";
+ jsChannelData["DiagnosisPeak"] = atof(arrRes[j][2].c_str());
+ jsChannelData["IntegratPk2Pk/2"] = atof(arrRes[j][3].c_str());
+ jsChannelData["IntegratRMS"] = atof(arrRes[j][4].c_str());
+ jsChannelData["RMSValues"] = atof(arrRes[j][5].c_str());
+ jsChannelData["EnvelopEnergy"] = atof(arrRes[j][6].c_str());
+ jsChannelData["1xAmp"] = atof(arrRes[j][7].c_str());
+ jsChannelData["2xAmp"] = atof(arrRes[j][8].c_str());
+ jsChannelData["3xAmp"] = atof(arrRes[j][9].c_str());
+ jsChannelData["4xAmp"] = atof(arrRes[j][10].c_str());
+ jsChannelData["5xAmp"] = atof(arrRes[j][11].c_str());
+ jsChannelData["1xPhase"] = atof(arrRes[j][12].c_str());
+ jsChannelData["2xPhase"] = atof(arrRes[j][13].c_str());
+ jsChannelData["3xPhase"] = atof(arrRes[j][14].c_str());
+ jsChannelData["4xPhase"] = atof(arrRes[j][15].c_str());
+ jsChannelData["TimeStamp"] = atof(arrRes[j][17].c_str());
+ jsSensor.append(jsChannelData);
+ }
+ }
- return showValue.write(jsonVal);
+ char selectCon[128] = { 0 };
+ char column[128]={0};
+ char tablename[256]={0};
+ sprintf(selectCon, "t_datastatic_%s.dataNodeNo='%s' ORDER BY timeStamp DESC LIMIT 0,1",strDataNodeNo.c_str(),strDataNodeNo.c_str());
+ sprintf(column," t_datastatic_%s.*,t_sensor_info.status,t_sensor_info.LooseValue,t_sensor_info.batteryPower ",strDataNodeNo.c_str());
+ sprintf(tablename," t_datastatic_%s LEFT JOIN t_sensor_info \
+ ON t_datastatic_%s.dataNodeNo = t_sensor_info.dataNodeNo ",strDataNodeNo.c_str(),strDataNodeNo.c_str());
+
+
+ vec_t vecRes = sql_ctl->GetDataSingleLine(tablename,column, selectCon);
+ Json::Value jsStaticData;
+ if(vecRes.size()>0){
+ jsStaticData["TemperatureTop"] = atof(vecRes[2].c_str());
+ jsStaticData["TemperatureBot"] = atof(vecRes[3].c_str());
+ jsStaticData["Dip"] = atof(vecRes[4].c_str());
+ jsStaticData["Voltage"] = atof(vecRes[5].c_str());
+ jsStaticData["ChannelType"] = "STATUS";
+ jsStaticData["ChannelId"] = vecRes[1];
+ jsStaticData["TimeStamp"] = vecRes[8];
+ jsStaticData["battery"] = vecRes[13];
+ jsStaticData["dataNodeNo"] = strDataNodeNo;
+ jsStaticData["status"] = vecRes[11];
+ if(atof(looseValue) < atof(vecRes[12].c_str())){
+ jsStaticData["loose"] = "1";
+ }else{
+ jsStaticData["loose"] = "0";
+ }
+ }else{
+ jsStaticData["TemperatureTop"] = "";
+ jsStaticData["TemperatureBot"] = "";
+ jsStaticData["Dip"] = "";
+ jsStaticData["Voltage"] = "";
+ jsStaticData["ChannelType"] = "STATUS";
+ jsStaticData["ChannelId"] = "";
+ jsStaticData["TimeStamp"] = "";
+ jsStaticData["battery"] = "";
+ jsStaticData["dataNodeNo"] = strDataNodeNo;
+ jsStaticData["status"] = "0";
+ jsStaticData["loose"] = "0";
+ }
+
+ jsSensor.append(jsStaticData);
+
+ jsonVal["content"].append(jsSensor);
+ }
+
+ } else {
+ jsonVal["success"] = true;
+ jsonVal["content"].resize(0);
+ }
+
+ return showValue.write(jsonVal);
+}
+std::string JsonData::JsonCmd_Cgi_10(Param_10 ¶m)
+{
+ Json::Value jsonVal;
+ jsonVal.clear();
+
+ jsonVal[JSON_FIELD_CMD] = "10";
+ jsonVal["success"] = true;
+ jsonVal["message"] = " ";
+ vec_t vetRes = sql_ctl->GetDataMultiLineOfOneColumn(T_SENSOR_INFO(TNAME), T_SENSOR_INFO(DATANODENO), NULL);
+ int nSize = vetRes.size();
+ if (nSize > 0) {
+ char selectCon[256] = { 0 },szTableName[100] = {0x00},whereCon[256]={0x00};
+ sprintf(selectCon, "%s,channelID,timeStamp",param.strStatic.c_str());
+ if(param.straxis == "S")
+ {
+ sprintf(szTableName,"t_dataStatic_%s",param.strDataNode.c_str());
+ }else{
+ sprintf(szTableName,"t_data_%s",param.strDataNode.c_str());
+ }
+ if(param.timeEnd == ""){
+ sprintf(whereCon,"dataNodeNo = '%s' and %s <> '' ",\
+ param.strDataNode.c_str(),param.strStatic.c_str());
+ }else{
+ sprintf(whereCon,"dataNodeNo = '%s' and %s <> '' and timeStamp < '%s' and timeStamp > '%s' ",\
+ param.strDataNode.c_str(),param.strStatic.c_str(),param.timeEnd.c_str(),param.timeStart.c_str());
+ }
+ int rows = sql_ctl->GetTableRows(szTableName,whereCon);
+ printf("rows : %d\n",rows);
+ int packgeNo = param.mPackageFlag;
+ int packgeMax = 0;
+ int packgeNum = 0;
+ jsonVal["package"] = packgeNo;
+ int lastSize = rows % 550;
+ int index = rows / 550;
+ if(lastSize > 0 && index > 0){
+ packgeMax = index +1;
+ if(packgeNo +1 == packgeMax){
+ packgeNum = rows-lastSize;
+ jsonVal["packageMax"] = index + 1;
+ }
+ else{
+ packgeNum = (packgeNo) * 550;
+ jsonVal["packageMax"] = index +1;}
+ }
+ else if(lastSize == 0 && index > 0){
+ packgeNum = (packgeNo+1) * 550;
+ packgeMax = index;
+ jsonVal["packageMax"] = index;
+ }else if(lastSize > 0 && index == 0){
+ packgeNum = 0;
+ packgeMax = index+1;
+ jsonVal["packageMax"] = index;
+ }
+
+ printf("10 packgeNo = %d,packgeNum = %d,lastSize = %d,index = %d\n",packgeNo,packgeNum,lastSize,index);
+ memset(whereCon,0x00,sizeof(whereCon));
+
+ if(param.timeEnd == ""){
+ sprintf(whereCon,"dataNodeNo = '%s' and %s <> '' order by timeStamp asc LIMIT %d OFFSET %d",\
+ param.strDataNode.c_str(),param.strStatic.c_str(),550,packgeNum);
+ }else{
+ sprintf(whereCon,"dataNodeNo = '%s' and %s <> '' and timeStamp < '%s' and timeStamp > '%s' order by timeStamp asc LIMIT %d OFFSET %d",\
+ param.strDataNode.c_str(),param.strStatic.c_str(),param.timeEnd.c_str(),param.timeStart.c_str(),550,packgeNum);
+ }
+ array_t vecRes;
+
+ vecRes = sql_ctl->GetDataMultiLine(szTableName, selectCon,whereCon);
+
+ if(vecRes.size() > 0){
+ Json::Value jsStaticData ;
+ for(int i = 0 ; i < vecRes.size(); i++){
+ Json::Value iTem;
+ if(vecRes[i][1] == param.strDataNode + "-X"){
+ iTem.append(vecRes[i][0]);
+ iTem.append(vecRes[i][2]);
+ jsStaticData["X"].append(iTem);
+ }if(vecRes[i][1] == param.strDataNode + "-Y"){
+ iTem.append(vecRes[i][0]);
+ iTem.append(vecRes[i][2]);
+ jsStaticData["Y"].append(iTem);
+ }if(vecRes[i][1] == param.strDataNode + "-Z"){
+ iTem.append(vecRes[i][0]);
+ iTem.append(vecRes[i][2]);
+ jsStaticData["Z"].append(iTem);
+ }
+ if(vecRes[i][1] == param.strDataNode + "-S"){
+ iTem.append(vecRes[i][0]);
+ iTem.append(vecRes[i][2]);
+ jsStaticData["S"].append(iTem);
+ }
+ //jsStaticData.append(value)
+ }
+ jsonVal["content"] = (jsStaticData);
+ jsonVal["Static"] = param.strStatic;
+ print_info("vecRes = %d,channelID = %s\n",vecRes.size(),vecRes[0][0].c_str());
+ }else{
+ jsonVal["success"] = false;
+ jsonVal["content"].resize(0);
+ }
+ }else{
+ jsonVal["success"] = false;
+ jsonVal["content"].resize(0);
+ }
+ return showValue.write(jsonVal);
}
+std::string JsonData::JsonCmd_Cgi_11(Param_11 ¶m)
+{
+ Json::Value jsonVal,jsSensor;
+ jsonVal.clear();
+ jsonVal[JSON_FIELD_CMD] = "11";
+ jsonVal["success"] = true;
+ jsonVal["message"] = " ";
+ char whereCon[512] = {};
+ sprintf(whereCon, "dataNodeNo='%s' ORDER BY timeStamp DESC LIMIT 0,3", param.DataNodeNo.c_str());
+ // 自数据库获取传感器特征数据
+ array_t arrRes;
+ arrRes = sql_ctl->GetDataMultiLineTransaction(T_DATA_INFO(TNAME), "*", whereCon);
+ int iResult = arrRes.size();
+ print_info("iResult = %d\n",iResult);
+ if (iResult > 0) {
+ for (int j = 0; j < iResult; j++) {
+ Json::Value jsChannelData;
+ jsChannelData["ChannelId"] = arrRes[j][1];
+ jsChannelData["ChannelType"] = "ACCELEROMETER";
+ jsChannelData["DiagnosisPeak"] = atof(arrRes[j][2].c_str());
+ jsChannelData["IntegratPk2Pk/2"] = atof(arrRes[j][3].c_str());
+ jsChannelData["IntegratRMS"] = atof(arrRes[j][4].c_str());
+ jsChannelData["RMSValues"] = atof(arrRes[j][5].c_str());
+ jsChannelData["EnvelopEnergy"] = atof(arrRes[j][6].c_str());
+ jsChannelData["1xAmp"] = atof(arrRes[j][7].c_str());
+ jsChannelData["2xAmp"] = atof(arrRes[j][8].c_str());
+ jsChannelData["3xAmp"] = atof(arrRes[j][9].c_str());
+ jsChannelData["4xAmp"] = atof(arrRes[j][10].c_str());
+ jsChannelData["5xAmp"] = atof(arrRes[j][11].c_str());
+ jsChannelData["1xPhase"] = atof(arrRes[j][12].c_str());
+ jsChannelData["2xPhase"] = atof(arrRes[j][13].c_str());
+ jsChannelData["3xPhase"] = atof(arrRes[j][14].c_str());
+ jsChannelData["4xPhase"] = atof(arrRes[j][15].c_str());
+ jsChannelData["TimeStamp"] = atof(arrRes[j][17].c_str());
+ jsSensor.append(jsChannelData);
+ }
+ }else {
+ jsonVal["success"] = false;
+ jsonVal["content"].resize(0);
+ }
+ jsonVal["content"] = jsSensor;
+ return showValue.write(jsonVal);
+}
std::string JsonData::JsonCmd_Cgi_20(Param_20 ¶m)
{
@@ -669,6 +1054,44 @@ std::string JsonData::JsonCmd_Cgi_20(Param_20 ¶m)
jsSystemInfo["zigbeePanId"] = GlobalConfig::ZigbeeInfo_G.PanID;
jsSystemInfo["zigbeeChannel"] = GlobalConfig::ZigbeeInfo_G.Channel;
jsSystemInfo["zigbeeAddr"] = GlobalConfig::ZigbeeInfo_G.MyAddr;
+ jsSystemInfo["GateWayVersion"] = ReadStrByOpt(SYSTEMINFOFILE, "Version", "GateWayVersion");
+ jsSystemInfo["SystemVersion"] = ReadStrByOpt(SYSTEMINFOFILE, "Version", "SystemVersion");
+ jsSystemInfo["WebVersion"] = ReadStrByOpt(SYSTEMINFOFILE, "Version", "WebVersion");
+ jsSystemInfo["GateWayHwVesion"] = ReadStrByOpt(SYSTEMINFOFILE, "Version", "GateWayHwVesion");
+ jsSystemInfo["GateWayProduct"] = ReadStrByOpt(SYSTEMINFOFILE, "Version", "GateWayProduct");
+ jsSystemInfo["serverStatus"] = GlobalConfig::serverStatus ;
+
+ if(GlobalConfig::NetType == "\"NR5G-SA\"" || GlobalConfig::NetType == "\"NR5G-NSA\"" ||
+ GlobalConfig::NetType == "\"NR5G\""){
+ GlobalConfig::NetType = "5G";
+ }else if(GlobalConfig::NetType == "\"LTE\""){
+ GlobalConfig::NetType = "4G";
+ }
+ if(GlobalConfig::NetStatus == "\"NOCONN\"" || GlobalConfig::NetStatus == "\"CONNECT\""){
+
+ if(GlobalConfig::NetSignal == 0){
+ jsSystemInfo["communicationSignal"] = GlobalConfig::NetType + ",未知";
+ }
+ else if(GlobalConfig::NetSignal > -80){
+ jsSystemInfo["communicationSignal"] = GlobalConfig::NetType + ",优";
+ }else if(GlobalConfig::NetSignal > -90 && GlobalConfig::NetSignal < -80){
+ jsSystemInfo["communicationSignal"] = GlobalConfig::NetType + ",良";
+ }else if(GlobalConfig::NetSignal > -105 && GlobalConfig::NetSignal < -90){
+ jsSystemInfo["communicationSignal"] = GlobalConfig::NetType + ",一般";
+ }else if(GlobalConfig::NetSignal < -105){
+ jsSystemInfo["communicationSignal"] = GlobalConfig::NetType + ",弱";
+ }else if(GlobalConfig::NetSignal < -115){
+ jsSystemInfo["communicationSignal"] = GlobalConfig::NetType + ",不稳定";
+ }
+
+ }else if(GlobalConfig::NetStatus == "\"SEARCH\""){
+ jsSystemInfo["communicationSignal"] = GlobalConfig::NetType + ",搜索网络";
+ }else if(GlobalConfig::NetStatus == "\"LIMSRV\""){
+ jsSystemInfo["communicationSignal"] = GlobalConfig::NetType + ",未插卡";
+ }else{
+ jsSystemInfo["communicationSignal"] = "未知";
+ }
+
jsBody["SystemInfo"] = jsSystemInfo;
@@ -719,7 +1142,13 @@ std::string JsonData::JsonCmd_Cgi_23(Param_23 ¶m)
WriteStr2Config(SERVERCONFIG, "Server", "localServerIpAddress", param.mServerIp);
WriteStr2Config(SERVERCONFIG, "Server", "localServerPort", param.mPort);
- WriteStr2Config(SERVERCONFIG, "Server", "CommMode", param.mCommMode);
+ WriteStr2Config(SERVERCONFIG, "Server", "CommMode", /*param.mCommMode*/"2");
+ WriteStr2Config(SERVERCONFIG, "Server", "UserName", param.mUserName);
+ WriteStr2Config(SERVERCONFIG, "Server", "Password", param.mPassword);
+ WriteStr2Config(SERVERCONFIG, "Server", "APN", param.mAPN);
+ char APN[100]={0x00};
+ sprintf(APN,"sed -i '15c \t\t\t\t/opt/quectel-CM/quectel-CM -s %s > /dev/null &' /etc/init.d/S95check5G",param.mAPN.c_str());
+ system(APN);
system("reboot");
}else if(0 == param.mMode && !(CheckIP(param.mServerIp.c_str()))){
jsonVal["success"] = false;
@@ -729,11 +1158,16 @@ std::string JsonData::JsonCmd_Cgi_23(Param_23 ¶m)
Json::Value jsBody;
jsSystemSetting["ServerIpAddress"] = ReadStrByOpt(SERVERCONFIG, "Server", "localServerIpAddress");
- jsSystemSetting["ServerPort"] = boost::lexical_cast(ReadStrByOpt(SERVERCONFIG, "Server", "localServerPort"));
- jsSystemSetting["CommMode"] = boost::lexical_cast(ReadStrByOpt(SERVERCONFIG, "Server", "CommMode"));
-
+ jsSystemSetting["ServerPort"] = atoi(ReadStrByOpt(SERVERCONFIG, "Server", "localServerPort").c_str());
+ jsSystemSetting["CommMode"] = atoi(ReadStrByOpt(SERVERCONFIG, "Server", "CommMode").c_str());
+ jsSystemSetting["ServerStatus"] = 1;
+ jsSystemSetting["UserName"] = ReadStrByOpt(SERVERCONFIG, "Server", "UserName");
+ jsSystemSetting["Password"] = ReadStrByOpt(SERVERCONFIG, "Server", "Password");
+ jsSystemSetting["APN"] = ReadStrByOpt(SERVERCONFIG, "Server", "APN");
jsBody["SystemSettings"] = jsSystemSetting;
- jsonVal["content"] = jsBody;
+ jsonVal["content"] = jsBody;
+
+
return showValue.write(jsonVal);
}
@@ -743,6 +1177,7 @@ std::string JsonData::JsonCmd_Cgi_23(Param_23 ¶m)
std::string JsonData::JsonCmd_Cgi_25(Param_25 ¶m)
{
Json::Value jsonVal;
+ Json::Value jsonValnet;
jsonVal.clear();
jsonVal["success"] = true;
jsonVal["message"] = " ";
@@ -750,32 +1185,71 @@ std::string JsonData::JsonCmd_Cgi_25(Param_25 ¶m)
bool bFlag1 = CheckIP(param.mGateway.c_str());
bool bFlag2 = IsValidMask(param.mSubnetMask);
bool bFlag3 = CheckIP(param.mIp.c_str());
- bool bFlag4 = CheckIP(param.mDnsName.c_str());
+ bool bFlag4 = false;
+ if(param.mDnsName.size()>0){
+ bFlag4 = CheckIP(param.mDnsName.c_str());
+ }else{
+ bFlag4 = true;
+ }
+ print_info("bFlag1 = %d,bFlag2 = %d,bFlag3 = %d,bFlag4 = %d\n",bFlag1,bFlag2,bFlag3,bFlag4);
- if (0 == param.mMode &&(bFlag1 && bFlag2 && bFlag3 && bFlag4)) {
- WriteStr2Config(NETWORKCONFIG, "Net", "dnsName", param.mDnsName);
- WriteStr2Config(NETWORKCONFIG, "Net", "networkPortStatus", param.mNetworkPortStatus);
- WriteStr2Config(NETWORKCONFIG, "Net", "gateway", param.mGateway);
- WriteStr2Config(NETWORKCONFIG, "Net", "subnetMask", param.mSubnetMask);
- WriteStr2Config(NETWORKCONFIG, "Net", "ipAddress", param.mIp);
- WriteStr2Config(NETWORKCONFIG, "Net", "hostName", param.mHostName);
- platform->EquipIpInit();
- system("reboot");
- }else if(0 == param.mMode &&(!bFlag1 || !bFlag2 || !bFlag3 || !bFlag4)){
+ if (0 == param.mMode &&(bFlag1 && bFlag2 && bFlag3 && bFlag4) && param.mNetworkPortStatus == "STATIC") {
+ WriteStr2Config(NETWORKCONFIG, param.mNet, "dnsName", param.mDnsName);
+ WriteStr2Config(NETWORKCONFIG, param.mNet, "networkPortStatus", param.mNetworkPortStatus);
+ WriteStr2Config(NETWORKCONFIG, param.mNet, "gateway", param.mGateway);
+ WriteStr2Config(NETWORKCONFIG, param.mNet, "subnetMask", param.mSubnetMask);
+ WriteStr2Config(NETWORKCONFIG, param.mNet, "ipAddress", param.mIp);
+ WriteStr2Config(NETWORKCONFIG, param.mNet, "hostName", param.mHostName);
+
+#ifdef IMX6UL_GATEWAY
+ char GateWay[100]={0x00};
+ sprintf(GateWay,"sed -i '7c route add default gw %s' /etc/init.d/S90start_userapp.sh",param.mGateway.c_str());
+ print_info("GateWay = %s\n",GateWay);
+ system(GateWay);
+#endif
+ platform->EquipIpInit(param.mNet);
+
+ }else if(0 == param.mMode && param.mNetworkPortStatus == "DHCP"){
+ WriteStr2Config(NETWORKCONFIG, param.mNet, "dnsName", "");
+ WriteStr2Config(NETWORKCONFIG, param.mNet, "networkPortStatus", param.mNetworkPortStatus);
+ WriteStr2Config(NETWORKCONFIG, param.mNet, "gateway", "");
+ WriteStr2Config(NETWORKCONFIG, param.mNet, "subnetMask", "");
+ WriteStr2Config(NETWORKCONFIG, param.mNet, "ipAddress", "");
+ WriteStr2Config(NETWORKCONFIG, param.mNet, "hostName", "");
+
+#ifdef IMX6UL_GATEWAY
+ system("sed -i '7c udhcpc -i eth0 > /dev/null &' /etc/init.d/S90start_userapp.sh");
+#endif
+ platform->EquipIpInit(param.mNet);
+
+ }else if(0 == param.mMode &&(!bFlag1 || !bFlag2 || !bFlag3 || !bFlag4) && param.mNetworkPortStatus == "STATIC"){
jsonVal["success"] = false;
}
- jsonVal["content"]["dnsName"] = ReadStrByOpt(NETWORKCONFIG, "Net", "dnsName");
- jsonVal["content"]["networkPortStatus"] = ReadStrByOpt(NETWORKCONFIG, "Net", "networkPortStatus");
- jsonVal["content"]["gateway"] = ReadStrByOpt(NETWORKCONFIG, "Net", "gateway");
- jsonVal["content"]["subnetMask"] = ReadStrByOpt(NETWORKCONFIG, "Net", "subnetMask");
- jsonVal["content"]["dataWatchIpAddress"] = ReadStrByOpt(NETWORKCONFIG, "Net", "ipAddress");
- jsonVal["content"]["hostName"] = ReadStrByOpt(NETWORKCONFIG, "Net", "hostName");
+ jsonValnet["dnsName"] = ReadStrByOpt(NETWORKCONFIG, "eth0", "dnsName");
+ jsonValnet["networkPortStatus"] = ReadStrByOpt(NETWORKCONFIG, "eth0", "networkPortStatus");
+ jsonValnet["gateway"] = ReadStrByOpt(NETWORKCONFIG, "eth0" ,"gateway");
+ jsonValnet["subnetMask"] = ReadStrByOpt(NETWORKCONFIG, "eth0", "subnetMask");
+ jsonValnet["dataWatchIpAddress"] = ReadStrByOpt(NETWORKCONFIG, "eth0", "ipAddress");
+ jsonValnet["hostName"] = ReadStrByOpt(NETWORKCONFIG, "eth0", "hostName");
+ jsonVal["content"]["eth0"] = jsonValnet;
+ jsonVal["content"]["gatewaytype"] = 0;
+
+#ifdef G2UL_GATEWAY
+ jsonValnet["dnsName"] = ReadStrByOpt(NETWORKCONFIG, "eth1", "dnsName");
+ jsonValnet["networkPortStatus"] = ReadStrByOpt(NETWORKCONFIG, "eth1", "networkPortStatus");
+ jsonValnet["gateway"] = ReadStrByOpt(NETWORKCONFIG, "eth1", "gateway");
+ jsonValnet["subnetMask"] = ReadStrByOpt(NETWORKCONFIG, "eth1", "subnetMask");
+ jsonValnet["dataWatchIpAddress"] = ReadStrByOpt(NETWORKCONFIG, "eth1", "ipAddress");
+ jsonValnet["hostName"] = ReadStrByOpt(NETWORKCONFIG, "eth1", "hostName");
+ jsonVal["content"]["eth1"] =jsonValnet;
+ jsonVal["content"]["gatewaytype"] = 1;
+#endif
return showValue.write(jsonVal);
}
-std::string JsonData::JsonCmd_Cgi_26()
+std::string JsonData::JsonCmd_Cgi_26(Param_26 ¶m)
{
Json::Value jsonVal;
jsonVal.clear();
@@ -785,59 +1259,107 @@ std::string JsonData::JsonCmd_Cgi_26()
jsonVal["success"] = true;
jsonVal["message"] = " ";
+ char looseValue[10]={0x00};
+ readStringValue("config", "loose",looseValue,(char*)GlobalConfig::Config_G.c_str());
+ print_debug("loose = %f \n",atof(looseValue));
Json::Value jsArray;
array_t arrRes;
- arrRes = sql_ctl->GetDataMultiLine(T_SENSOR_INFO(TNAME), "*", NULL);
+ arrRes = sql_ctl->GetDataMultiLineTransaction(T_SENSOR_INFO(TNAME), "*", NULL);
int iResult = arrRes.size();
- printf("iResult = %d\n",iResult);
if (iResult > 0) {
- for (int j = 0; j < iResult; j++) {
+ int packgeNo = param.mPackageFlag;
+ int packgeMax = 0;
+ int packgeNum = 0;
+ jsonVal["package"] = packgeNo;
+ int lastSize = iResult % 10;
+ int index = iResult / 10;
+ if(lastSize > 0 && index > 0){
+ packgeMax = index +1;
+ if(packgeNo +1 == packgeMax){
+ packgeNum = iResult;
+ jsonVal["packageMax"] = index + 1;
+ }
+ else{
+ packgeNum = (packgeNo+1) * 10;
+ jsonVal["packageMax"] = index +1;}
+ }
+ else if(lastSize == 0 && index > 0){
+ packgeNum = (packgeNo+1) * 10;
+ packgeMax = index;
+ jsonVal["packageMax"] = index;
+ }else if(lastSize > 0 && index == 0){
+ packgeNum = lastSize;
+ packgeMax = index+1;
+ jsonVal["packageMax"] = index;
+ }
+
+ printf("26 packgeNo = %d,packgeNum = %d,lastSize = %d,index = %d\n",packgeNo,packgeNum,lastSize,index);
+ for (int j = packgeNo * 10; j < packgeNum; j++) {
Json::Value jsSensorData;
jsSensorData["dataNodeNo"] = arrRes[j][0];
jsSensorData["dataNodeName"] = arrRes[j][1];
- jsSensorData["initFlag"] = boost::lexical_cast(arrRes[j][2]);
- jsSensorData["accFlag"] = boost::lexical_cast(arrRes[j][3]);
- jsSensorData["zigbeeFlag"] = boost::lexical_cast(arrRes[j][4]);
- jsSensorData["temTopFlag"] = boost::lexical_cast(arrRes[j][5]);
- jsSensorData["temBotFlag"] = boost::lexical_cast(arrRes[j][6]);
+ jsSensorData["initFlag"] = atoi(arrRes[j][2].c_str());
+ jsSensorData["accFlag"] = atoi(arrRes[j][3].c_str());
+ jsSensorData["zigbeeFlag"] = atoi(arrRes[j][4].c_str());
+ jsSensorData["temTopFlag"] = atoi(arrRes[j][5].c_str());
+ jsSensorData["temBotFlag"] = atoi(arrRes[j][6].c_str());
jsSensorData["hardVersion"] = arrRes[j][8];
jsSensorData["softVersion"] = arrRes[j][9];
jsSensorData["bpNo"] = arrRes[j][10];
jsSensorData["serialNo"] = arrRes[j][11];
jsSensorData["firstPowerTime"] = arrRes[j][12];
- jsSensorData["WakeupTime"] = boost::lexical_cast(arrRes[j][13]);
- jsSensorData["StaticTime"] = boost::lexical_cast(arrRes[j][14]);
- jsSensorData["WaveTime"] = boost::lexical_cast(arrRes[j][15]);
+ jsSensorData["WakeupTime"] = atoi(arrRes[j][13].c_str());
+ jsSensorData["StaticTime"] = atoi(arrRes[j][14].c_str());
+ jsSensorData["WaveTime"] = atoi(arrRes[j][15].c_str());
jsSensorData["BateryV"] = arrRes[j][16];
jsSensorData["ProductNo"] = arrRes[j][17];
- jsSensorData["configFlag"] = boost::lexical_cast(arrRes[j][18]);
+ jsSensorData["configFlag"] = atoi(arrRes[j][18].c_str());
jsSensorData["startBrands"] = arrRes[j][19];
jsSensorData["stopBrands"] = arrRes[j][20];
- jsSensorData["featureInterVal"] = boost::lexical_cast(arrRes[j][21]);
- jsSensorData["waveInterVal"] = boost::lexical_cast(arrRes[j][22]);
- jsSensorData["samplingRate"] = boost::lexical_cast(arrRes[j][23]);
- // jsSensorData["scope"] = boost::lexical_cast(arrRes[j][24]);
- jsSensorData["range"] = boost::lexical_cast(arrRes[j][25]);
+ jsSensorData["featureInterVal"] = atoi(arrRes[j][21].c_str());
+ jsSensorData["waveInterVal"] = atoi(arrRes[j][22].c_str());
+ jsSensorData["samplingRate"] = atoi(arrRes[j][23].c_str());
+ // jsSensorData["scope"] = atoi(arrRes[j][24]);
+ jsSensorData["range"] = atoi(arrRes[j][25].c_str());
jsSensorData["envelopeBandPass"] = arrRes[j][26];
jsSensorData["faultFrequency"] = arrRes[j][27];
jsSensorData["zigbeePanId"] = arrRes[j][28];
- jsSensorData["zigbeeChannel"] = boost::lexical_cast(arrRes[j][29]);
+ jsSensorData["zigbeeChannel"] = (arrRes[j][29]);
jsSensorData["zigbeeAddr"] = arrRes[j][30];
jsSensorData["zigbeeLongAddr"] = arrRes[j][31];
jsSensorData["zigbeeDesAddr"] = arrRes[j][32];
- jsSensorData["ZigbeePower"] = boost::lexical_cast(arrRes[j][33]);
- jsSensorData["ZigbeeRetry"] = boost::lexical_cast(arrRes[j][34]);
- jsSensorData["ZigbeeRetryGap"] = boost::lexical_cast(arrRes[j][35]);
- jsSensorData["ACCSampleTime"] = boost::lexical_cast(arrRes[j][36]);
- jsSensorData["status"] = boost::lexical_cast(arrRes[j][37]);
+ jsSensorData["ZigbeePower"] = atoi(arrRes[j][33].c_str());
+ jsSensorData["ZigbeeRetry"] = atoi(arrRes[j][34].c_str());
+ jsSensorData["ZigbeeRetryGap"] = atoi(arrRes[j][35].c_str());
+ jsSensorData["ACCSampleTime"] = atoi(arrRes[j][36].c_str());
+ jsSensorData["status"] = atoi(arrRes[j][37].c_str());
jsSensorData["timeStamp"] = arrRes[j][38];
- jsSensorData["viff"] = boost::lexical_cast(arrRes[j][39]);
- jsSensorData["RSSI"] = boost::lexical_cast(arrRes[j][40]);
+ jsSensorData["viff"] = atoi(arrRes[j][39].c_str());
+ if(atof(looseValue) < atof(arrRes[j][42].c_str())){
+ jsSensorData["loose"] = "1";
+ }else{
+ jsSensorData["loose"] = "0";
+ }
+
+ //获取最新zigbee信号
+ char szTableName[50]={0x00},selectCon[128]={0x00};
+ sprintf(szTableName,"t_dataStatic_%s",arrRes[j][0].c_str());
+ memset(selectCon,0x00,sizeof(selectCon));
+ sprintf(selectCon, "zigbeeSignal <> '' ORDER BY timeStamp desc LIMIT 0,1");
+ string strZigbeeSignal = sql_ctl->GetData(szTableName, "zigbeeSignal", selectCon);
+ if(strZigbeeSignal == "")
+ jsSensorData["RSSI"] = arrRes[j][40];
+ else
+ jsSensorData["RSSI"] = strZigbeeSignal;
+ jsSensorData["update"] = atoi(arrRes[j][41].c_str());
jsArray.append(jsSensorData);
}
} else {
jsArray.resize(0);
+ jsonVal["success"] = true;
}
+ jsonVal["gatewayMac"] = GlobalConfig::MacAddr_G ;
+ jsonVal["gatewayIP"] = GlobalConfig::IpAddr_G ;
jsonVal["content"]["dataNodeArray"] = jsArray;
return showValue.write(jsonVal);
}
@@ -859,6 +1381,13 @@ std::string JsonData::JsonCmd_Cgi_27(Param_27 ¶m)
sql_ctl->DeleteTableData(T_SENSOR_INFO(TNAME), whereCon);
sql_ctl->DeleteTableData(T_DATA_INFO(TNAME), whereCon);
sql_ctl->DeleteTableData(T_DATASTATIC_INFO(TNAME), whereCon);
+ sql_ctl->DeleteTableData(T_DATANODE_TIME(TNAME), whereCon);
+ char szTableName[50]={0x00};
+ sprintf(szTableName,"DROP TABLE t_data_%s",param.mDataNodeNo.c_str());
+ sql_ctl->CreateTable(szTableName, 0);
+ memset(szTableName,0x00,sizeof(szTableName));
+ sprintf(szTableName,"DROP TABLE t_dataStatic_%s",param.mDataNodeNo.c_str());
+ sql_ctl->CreateTable(szTableName, 0);
} else {
jsonVal["success"] = false;
jsonVal["message"] = "没有传感器号";
@@ -900,6 +1429,12 @@ std::string JsonData::JsonCmd_Cgi_29(Param_29 ¶m)
jsonVal["dataNodeGatewayNo"] = GlobalConfig::MacAddr_G;
jsonVal["success"] = true;
jsonVal["message"] = " ";
+ std::vector vecWave;
+ /* 新增代码 */
+ char whereCon[64] = {};
+ sprintf(whereCon, "dataNodeNo='%s'",param.mDataNodeNo.c_str());
+ vec_t res = sql_ctl->GetDataSingleLine(T_SENSOR_INFO(TNAME)," * ",whereCon);
+ char localtimestamp[32] = { 0 };
std::string strWaveData = "";
std::string filename = "/opt/data/" + param.mChannelId + ".dat";
if (access(filename.c_str(), 0) >= 0) {
@@ -910,10 +1445,21 @@ std::string JsonData::JsonCmd_Cgi_29(Param_29 ¶m)
jsonVal["message"] = "error";
} else {
float fTemp = 0;
- std::vector vecWave;
+
+ //std::vector hanningWave;
+ inFile.read((char *)localtimestamp,sizeof(localtimestamp));
while (inFile.read((char *)&fTemp, sizeof(fTemp))) {
vecWave.push_back(fTemp);
}
+ //测试正弦波
+ //pCalculation->GenerateSin(vecWave);
+
+ //添加汉宁窗
+ /*pCalculation->Hanning(vecWave, hanningWave);
+ for(int i = 0; i < vecWave.size();i++){
+ vecWave[i] = (vecWave[i]*hanningWave[i]);
+ }*/
+
int flag = param.mPackageFlag;
flag = (flag + 1) * 1024;
int number = vecWave.size();
@@ -952,8 +1498,18 @@ std::string JsonData::JsonCmd_Cgi_29(Param_29 ¶m)
jsBody["channelId"] = param.mChannelId;
jsBody["package"] = param.mPackageFlag;
- jsBody["Data"] = strWaveData;
+ print_info("vecWave.size() = %d,sample = %d,second = %f\n",vecWave.size(),atoi(res[23].c_str()),float(vecWave.size()/atoi(res[23].c_str())));
+ string::size_type comper = param.mChannelId.find("Z");
+ if (comper != string::npos && res[17]=="02"){
+ jsBody["second"] = float((float)vecWave.size()/(float)atoi(res[23].c_str()));
+ }else if(res[17]=="01"){
+ jsBody["second"] = float((float)vecWave.size()/(float)atoi(res[23].c_str()));
+ }else{
+ jsBody["second"] = 1;
+ }
+ jsBody["Data"] = strWaveData;
+ jsBody["timestamp"] = string(localtimestamp);
jsonVal["content"] = jsBody;
return showValue.write(jsonVal);
@@ -961,52 +1517,7 @@ std::string JsonData::JsonCmd_Cgi_29(Param_29 ¶m)
std::string JsonData::JsonCmd_Cgi_30(Param_30 ¶m)
{
- /*Json::Value jsonVal;
- jsonVal.clear();
- jsonVal["cmd"] = "30";
- jsonVal["success"] = true;
- jsonVal["message"] = "";
- Json::Value jsBody;
- std::string strWaveData;
- // if (GlobalConfig::WaveCgi.flag == 1) {
- // int number = GlobalConfig::WaveCgi.number;
- // char buf[32];
- // int flag = param.mPackageFlag;
- // flag = (flag + 1) * 1024;
- // int start = param.mPackageFlag * 1024;
- // if ( number < 1024) {
- // flag = number;
- // start = 0;
- // }
-
- // for (int i = start; i < flag; i++) {
- // if ( i == start ) {
- // strWaveData = (boost::lexical_cast(GlobalConfig::WaveCgi.waveData[i])).substr(0.4);
- // } else {
- // memset(buf, 0, 32);
- // sprintf(buf, "%.2f", GlobalConfig::WaveCgi.waveData[i]);
- // std::string waveTemp(buf);
- // strWaveData = strWaveData + "," + waveTemp;
- // }
- // }
- // int max = number / 1024;
- // if (max == 0 && number > 0) {
- // max = 1;
- // }
- // jsBody["packageMax"] = max;
- // } else {
- // jsonVal["success"] = false;
- // jsonVal["message"] = "数据获取失败";
- // }
-
-
- jsBody["channelId"] = param.mChannelId;
- jsBody["package"] = param.mPackageFlag;
- jsBody["Data"] = strWaveData;
-
- jsonVal["content"] = jsBody;
- return showValue.write(jsonVal);*/
Json::Value jsonVal;
Json::Value jsBody;
Json::Value SystemSetting;
@@ -1019,6 +1530,16 @@ std::string JsonData::JsonCmd_Cgi_30(Param_30 ¶m)
int i = 0;
std::string strWaveData;
std::string filename = "/opt/data/" + param.mChannelId + ".dat";
+ char localtimestamp[32] = { 0 };
+ std::vector vecWave;
+ std::vector hanningWave;
+ std::vector addhanningWave;
+ std::vector fftWave;
+ int sampleRateReference = 0;
+ /* 新增代码 */
+ char whereCon[64] = {};
+ sprintf(whereCon, "dataNodeNo='%s'",param.mDataNodeNo.c_str());
+ vec_t res = sql_ctl->GetDataSingleLine(T_SENSOR_INFO(TNAME)," * ",whereCon);
if (access(filename.c_str(), 0) >= 0)
{
std::ifstream inFile(filename.c_str(),ios::in|ios::binary);
@@ -1029,109 +1550,64 @@ std::string JsonData::JsonCmd_Cgi_30(Param_30 ¶m)
jsonVal["message"] = "error";
}else{
float fTemp = 0;
- std::vector vecWave;
- std::vector fftWave;
- while(inFile.read((char *)&fTemp,sizeof(fTemp)))
- { // 取8K进行计算
- if(i < 8192)
- {
- vecWave.push_back(fTemp);
- }else{
- break;
+
+
+ inFile.read((char *)localtimestamp,sizeof(localtimestamp));
+ string::size_type comper = param.mChannelId.find("Z");
+ if (comper != string::npos && res[17]=="02") {
+ while(inFile.read((char *)&fTemp,sizeof(fTemp)))
+ {
+ vecWave.push_back(fTemp);
}
- i++;
- }
- /*std::string strWaveData1 = "";
- char buff[32] = {0};
- for(int j=0;j %s,vecWave.size()=%d\n", strWaveData1.c_str(),vecWave.size());*/
- //进行傅立叶变换
- pCalculation->FFTSpec(vecWave, fftWave);
- printf("2---------------------------------------------->%d\n",fftWave.size());
- printf("2---------------------------------------------->%f\n",fftWave[10]);
- /*std::string strWaveData2 = "";
- char bufff[32] = {0};
- for(int k=0;kfftWave.size()=%d\n", fftWave.size());
- //print_info("after fft---------------------------------------------------> %s,fftWave.size()=%d\n", strWaveData2.c_str(),fftWave.size());
- /* int flag = param.mPackageFlag;
- //print_info("*********************************param.mPackageFlag=%d\n",param.mPackageFlag);
- flag = (flag + 1) * 1024;
- int number = fftWave.size();
- int start = param.mPackageFlag * 1024;
- if (number < 1024)
- {
- flag = number;
- start = 0;
- }
- char buf[32] = {0};
- //print_info("start=%d,flag=%d\n",start,flag);
- for (int i = start; i < flag; i++)
- {
- if (i == start)
- {
- memset(buf, 0, 32);
- sprintf(buf, "%.2f", fftWave[i]);
- std::string waveTemp(buf);
- if (0 == i)
+ //进行傅立叶变换
+ pCalculation->FFTSpec(vecWave, fftWave);
+ sampleRateReference = 1000;
+
+ }else{
+ while(inFile.read((char *)&fTemp,sizeof(fTemp)))
+ { // 取8K进行计算
+ if(i < 8192)
{
- strWaveData = boost::lexical_cast(0);
+ vecWave.push_back(fTemp);
}else{
- strWaveData = waveTemp;
+ break;
}
- }else{
- memset(buf, 0, 32);
- sprintf(buf, "%.2f", fftWave[i]);
- std::string waveTemp(buf);
- strWaveData = strWaveData + "," + waveTemp;
- }
+ i++;
+ }
+ //测试正弦波
+ //pCalculation->GenerateSin(vecWave);
+
+ if(vecWave.size() < 8192){
+ for(int i = vecWave.size(); i < 8192;i++){
+ vecWave.push_back(0);
+ }
+ }
+ //添加汉宁窗
+ pCalculation->Hanning(vecWave, hanningWave);
+ for(int i = 0; i < vecWave.size();i++){
+ addhanningWave.push_back(vecWave[i]*hanningWave[i]);
+ }
+
+ //进行傅立叶变换
+ pCalculation->FFTSpec(addhanningWave, fftWave);
+ sampleRateReference = 1024;
}
- //print_info("@strwavedata=%s@,strWaveData.sizeof=%d,fftWave.size()=%d\n",strWaveData.c_str(),strWaveData.size(),fftWave.size());
- int max = number / 1024;
- //print_info("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&max=%d\n",max);
- if (max == 0 && number > 0)
- {
- max = 1;
- }
- jsBody["packageMax"] = max; */
+ /*for(int i = 0; i < fftWave.size();i++){
+ fftWave[i] = fftWave[i]*2;
+ }*/
+ printf("2---------------------------------------------->vecWave = %d,fftWave = %d\n",vecWave.size(),fftWave.size());
+
int flag = param.mPackageFlag;
- flag = (flag + 1) * 1024;
+ flag = (flag + 1) * sampleRateReference;
int number = fftWave.size();
- int start = param.mPackageFlag * 1024;
+ printf("number---------------------------------------------->%d\n",number);
+ int start = param.mPackageFlag * sampleRateReference;
printf("param.mPackageFlag = %d\n",param.mPackageFlag);
printf("param.start = %d\n",start);
printf("param.flag = %d\n",flag);
- if (number < 1024) {
- flag = number;
- start = 0;
+ if (number < sampleRateReference) {
+ flag = number;
+ start = 0;
}
char buf[32];
for (int i = start; i < flag; i++) {
@@ -1149,29 +1625,51 @@ std::string JsonData::JsonCmd_Cgi_30(Param_30 ¶m)
}
}
- int max = number / 1024;
+ int max = number / sampleRateReference;
if (max == 0 && number > 0) {
- max = 1;
+ max = 1;
}
jsBody["packageMax"] = max;
+
+
+
}
} else {
- jsonVal["success"] = false;
- jsonVal["message"] = "数据获取失败";
- }
+ jsonVal["success"] = false;
+ jsonVal["message"] = "没有数据文件";
+ }
jsBody["channelId"] = param.mChannelId;
jsBody["package"] = param.mPackageFlag;
+ jsBody["timestamp"] = string(localtimestamp);
jsBody["Data"] = strWaveData;
- /* 新增代码 */
- char whereCon[64] = {};
- sprintf(whereCon, "dataNodeNo='%s'",param.mDataNodeNo.c_str());
- std::string sample_rate = sql_ctl->GetData(T_SENSOR_INFO(TNAME), T_SENSOR_INFO(SAMPLINGRATE), whereCon);
- printf("@@@@@@@@@@@@@@@@@@@@sample_rate=%s\n",sample_rate.c_str());
- int SampleRate = boost::lexical_cast(sample_rate.c_str());
- double resolution = (double)SampleRate / 8192;
- printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@the sample rate is %d,the resolution %f\n",SampleRate,resolution);
+
+
+
+ double resolution = 0.0;
+ int SampleRate =0;
+ print_info("sensor type %s\n",res[17].c_str());
+ if(res[17]=="01"){
+ SampleRate = atoi(res[23].c_str());
+ printf("@@@@@@@@@@@@@@@@@@@@sample_rate=%d\n",SampleRate);
+ resolution = (((double)SampleRate/1000)*1024)/ 8192;
+
+ }else if(res[17]=="02"){
+ string::size_type comper = param.mChannelId.find("Z");
+ if (comper != string::npos) {
+ SampleRate = atoi(res[23].c_str());
+ resolution = (double)SampleRate/vecWave.size();
+ //resolution = (((double)vecWave.size()/1000)*1024)/ (SampleRate * ((vecWave.size()/SampleRate)));
+ printf("@@@@@@@@@@@@@@@@@@@@sample_rate=%d,resolution = %f\n",SampleRate,resolution);
+ }else{
+ SampleRate = 8000;
+ printf("@@@@@@@@@@@@@@@@@@@@sample_rate=%d\n",SampleRate);
+ resolution = (((double)SampleRate/1024)*1024)/ 8192;
+ }
+ }
+
+ print_info("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@the sample rate is %d,the resolution %f\n",SampleRate,resolution);
char buf[32];
memset(buf, 0, 32);
sprintf(buf, "%f", resolution);
@@ -1180,6 +1678,253 @@ std::string JsonData::JsonCmd_Cgi_30(Param_30 ¶m)
jsonVal["content"] = jsBody;
return showValue.write(jsonVal);
}
+std::string JsonData::JsonCmd_Cgi_40(Param_40 ¶m)
+{
+
+ Json::Value jsonVal;
+ Json::Value jsBody;
+ Json::Value SystemSetting;
+ jsonVal.clear();
+
+ jsonVal["cmd"] = "40";
+ jsonVal["dataNodeGatewayNo"] = GlobalConfig::MacAddr_G;
+ jsonVal["success"] = true;
+ jsonVal["message"] = "";
+ int i = 0;
+ int sampleRateReference = 0;
+ std::vector vecWave;
+ /* 新增代码 */
+ char whereCon[64] = {};
+ sprintf(whereCon, "dataNodeNo='%s'",param.mDataNodeNo.c_str());
+ vec_t res = sql_ctl->GetDataSingleLine(T_SENSOR_INFO(TNAME)," * ",whereCon);
+ std::string strWaveData;
+ std::string filename = "/opt/data/" + param.mChannelId + ".dat";
+ char localtimestamp[32] = { 0 };
+ if (access(filename.c_str(), 0) >= 0)
+ {
+ std::ifstream inFile(filename.c_str(),ios::in|ios::binary);
+ if(!inFile)
+ {
+ print_error("read channel data error\n");
+ jsonVal["success"] = "false";
+ jsonVal["message"] = "error";
+ }else{
+ float fTemp = 0;
+
+ std::vector envWave;
+ std::vector hanningWave;
+ std::vector addhanningWave;
+ inFile.read((char *)localtimestamp,sizeof(localtimestamp));
+ string::size_type comper = param.mChannelId.find("Z");
+ if (comper != string::npos && res[17]=="02") {
+ while(inFile.read((char *)&fTemp,sizeof(fTemp)))
+ {
+ vecWave.push_back(fTemp);
+ }
+ //添加汉宁窗
+ pCalculation->Hanning(vecWave, hanningWave);
+ for(int i = 0; i < vecWave.size();i++){
+ addhanningWave.push_back(vecWave[i]*hanningWave[i]);
+ }
+
+ //进行傅立叶变换
+ if(param.StartFrequency == 0){
+ param.StartFrequency = 3000;
+ param.EndFrequency = 5000;
+ }
+
+ pCalculation->envSpec(addhanningWave, envWave,param.StartFrequency,param.EndFrequency);
+ sampleRateReference = 1000;
+
+ }else{
+ while(inFile.read((char *)&fTemp,sizeof(fTemp)))
+ { // 取8K进行计算
+ if(i < 8192)
+ {
+ vecWave.push_back(fTemp);
+ }else{
+ break;
+ }
+ i++;
+ }
+ if(vecWave.size() < 8192){
+ for(int i = vecWave.size(); i < 8192;i++){
+ vecWave.push_back(0);
+ }
+ }
+
+ //添加汉宁窗
+ pCalculation->Hanning(vecWave, hanningWave);
+ for(int i = 0; i < vecWave.size();i++){
+ addhanningWave.push_back(vecWave[i]*hanningWave[i]);
+ }
+
+ //进行傅立叶变换
+ if(param.StartFrequency == 0){
+ param.StartFrequency = 3000;
+ param.EndFrequency = 5000;
+ }
+
+ pCalculation->envSpec(addhanningWave, envWave,param.StartFrequency,param.EndFrequency);
+ sampleRateReference = 1024;
+ }
+ /*for(int i = 0; i < envWave.size();i++){
+ envWave[i] = envWave[i]*2;
+ }*/
+
+ printf("2---------------------------------------------->%d\n",envWave.size());
+ printf("2---------------------------------------------->%f\n",envWave[10]);
+
+ print_info("after fft--------------------------------------------------->fftWave.size()=%d\n", envWave.size());
+
+ int flag = param.mPackageFlag;
+ flag = (flag + 1) * sampleRateReference;
+ int number = envWave.size();
+ int start = param.mPackageFlag * sampleRateReference;
+ printf("param.mPackageFlag = %d\n",param.mPackageFlag);
+ printf("param.start = %d\n",start);
+ printf("param.flag = %d\n",flag);
+ if (number < sampleRateReference) {
+ flag = number;
+ start = 0;
+ }
+ char buf[32];
+ for (int i = start; i < flag; i++) {
+ if ( i == start ) {
+ memset(buf, 0, 32);
+ sprintf(buf, "%.6f", envWave[i]);
+ std::string waveTemp(buf);
+ strWaveData = waveTemp;
+
+ } else {
+ memset(buf, 0, 32);
+ sprintf(buf, "%.6f", envWave[i]);
+ std::string waveTemp(buf);
+ strWaveData = strWaveData + "," + waveTemp;
+ }
+ }
+
+ int max = number / sampleRateReference;
+ if (max == 0 && number > 0) {
+ max = 1;
+ }
+ jsBody["packageMax"] = max;
+
+ }
+ } else {
+ jsonVal["success"] = false;
+ jsonVal["message"] = "没有数据文件";
+ }
+
+
+ jsBody["channelId"] = param.mChannelId;
+ jsBody["package"] = param.mPackageFlag;
+ jsBody["timestamp"] = string(localtimestamp);
+ jsBody["Data"] = strWaveData;
+
+ double resolution = 0.0;
+ int SampleRate =0;
+ print_info("sensor type %s\n",res[17].c_str());
+ if(res[17]=="01"){
+ SampleRate = atoi(res[23].c_str());
+ printf("@@@@@@@@@@@@@@@@@@@@sample_rate=%d\n",SampleRate);
+ resolution = (((double)SampleRate/1000)*1024)/ 8192;
+ }else if(res[17]=="02"){
+ string::size_type comper = param.mChannelId.find("Z");
+ if (comper != string::npos) {
+ SampleRate = atoi(res[23].c_str());
+
+ resolution = (double)SampleRate/vecWave.size();
+ printf("@@@@@@@@@@@@@@@@@@@@sample_rate=%d,resolution = %f\n",SampleRate,resolution);
+ }else{
+ SampleRate = 8000;
+ printf("@@@@@@@@@@@@@@@@@@@@sample_rate=%d\n",SampleRate);
+ resolution = (((double)SampleRate/1000)*1024)/ 8192;
+ }
+ }
+
+ printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@the sample rate is %d,the resolution %f\n",SampleRate,resolution);
+ char buf[32];
+ memset(buf, 0, 32);
+ sprintf(buf, "%f", resolution);
+ jsBody["resolution"] = std::string(buf);
+
+ jsonVal["content"] = jsBody;
+ return showValue.write(jsonVal);
+}
+std::string JsonData::JsonCmd_Cgi_41(std::vector ¶m)
+{
+ Json::Value jsonVal;
+ jsonVal.clear();
+
+ jsonVal["cmd"] = "41";
+ jsonVal["dataNodeGatewayNo"] = GlobalConfig::MacAddr_G;
+ jsonVal["success"] = true;
+ jsonVal["message"] = " ";
+
+ char whereCon[1024] = {0};
+ char updateSql[1024] = { 0 };
+ //int WaveInteerVal = param.mwaveInterVal/param.mfeatureInterVal;
+ for(int i = 0; i < param.size();i++){
+ sprintf(updateSql, "featureInterVal='%d',waveInterVal='%d',range='%d',samplingRate='%d',AccSampleTime = '%d',\
+ startBrands = '%s',stopBrands = '%s',envelopeBandPass = '%s',viff = '%d',faultFrequency = '%s' ,UpdateFlag = 0",
+ param[i].mfeatureInterVal, param[i].mwaveInterVal,param[i].mrange,\
+ param[i].msamplingRate,param[i].mAccSampleTime, param[i].mstartBrands.c_str(),\
+ param[i].mstopBrands.c_str(),param[i].menvelopeBandPass.c_str(),param[i].mviff,param[i].mfaultFrequency.c_str());
+ sprintf(whereCon, "dataNodeNo='%s'", param[i].mdataNodeNo.c_str());
+
+ int iRet = sql_ctl->UpdateTableData(T_SENSOR_INFO(TNAME), updateSql, whereCon);
+ memset(whereCon,0x00,sizeof(whereCon));
+ memset(updateSql,0x00,sizeof(updateSql));
+ if(iRet != 0)
+ jsonVal["success"] = false;
+ }
+ return showValue.write(jsonVal);
+}
+std::string JsonData::JsonCmd_Cgi_42(Param_42 ¶m)
+{
+ Json::Value jsonVal;
+ jsonVal.clear();
+ jsonVal["cmd"] = "42";
+ jsonVal["dataNodeGatewayNo"] = GlobalConfig::MacAddr_G;
+ jsonVal["success"] = true;
+ jsonVal["message"] = "上传成功!";
+ char cmd[100]={0x00};
+ strcpy(cmd,"rm -rf /tmp/cgic*");
+ system(cmd);
+ if(param.fileName == "DataNode.tar"){
+ string strcmd = "tar xvf /opt/";
+ strcmd = strcmd + param.fileName;
+ strcmd = strcmd + " -C /opt/";
+ print_info("strcmd = %s\n",strcmd.c_str());
+ system(strcmd.c_str());
+ }else if(param.fileName == "rfsbu.tar"){
+ sleep(3);
+ print_info("strcmd = %s\n",param.fileName.c_str());
+ system("/opt/opt.sh");
+ }else if(param.fileName == "update.json"){
+ print_info("strcmd = %s\n",param.fileName.c_str());
+
+ ReadStrConfig("/opt/update.json");
+ }else if(param.fileName == "DataNode.csv"){
+ print_info("strcmd = %s\n",param.fileName.c_str());
+
+ int iRet = UpdataDataNodeConfig("/opt/DataNode.csv");
+ string str = to_string(iRet) + "个传感器更新成功";
+ if(iRet < 0){
+ jsonVal["success"] = false;
+ jsonVal["message"] = "更新失败!";
+ }else{
+ jsonVal["success"] = true;
+ jsonVal["message"] = str;
+ }
+
+ }else {
+ jsonVal["success"] = false;
+ jsonVal["message"] = "文件名错误!";
+ }
+ return showValue.write(jsonVal);
+}
std::string JsonData::JsonCmd_Cgi_31(Param_31 ¶m)
{
@@ -1202,6 +1947,8 @@ std::string JsonData::JsonCmd_Cgi_31(Param_31 ¶m)
jsonVal["success"] = true;
jsBody["channel"] = ReadStrByOpt(ZIGBEECONFIG, "Zigbee", "channel");
jsBody["panID"] = GlobalConfig::ZigbeeInfo_G.PanID;
+ jsBody["RetryNum"] = GlobalConfig::ZigbeeInfo_G.RetryNum;
+ jsBody["TranTimeout"] = GlobalConfig::ZigbeeInfo_G.TranTimeout;
jsBody["status"] = "1";
jsonVal["content"] = jsBody;
@@ -1368,5 +2115,167 @@ std::string JsonData::JsonCmd_Cgi_47(Param_47 ¶m)
return showValue.write(jsonVal);
}
+std::string JsonData::JsonCmd_Cgi_50()
+{
+ Json::Value jsonVal;
+ jsonVal.clear();
+
+ jsonVal[JSON_FIELD_CMD] = "50";
+ jsonVal["success"] = true;
+ jsonVal["message"] = "";
+
+ std::string strFileName = "",strSoftVersion = "";
+ Json::Value root;
+ Json::Value jsBody;
+ Json::Reader reader;
+ std::vector value;
+ std::vector vecDataNodeUpdate;
+ DataNodeUpdate datanodeUpdate;
+ std::fstream is;
+ is.open("/opt/DataNode/config.json", std::ios::in);
+ if (reader.parse(is, root)) {
+ jsBody["sensor"] = root;
+ }
+ jsBody["GateWayVersion"] = ReadStrByOpt(SYSTEMINFOFILE, "Version", "GateWayVersion");
+ jsBody["SystemVersion"] = ReadStrByOpt(SYSTEMINFOFILE, "Version", "SystemVersion");
+ jsBody["WebVersion"] = ReadStrByOpt(SYSTEMINFOFILE, "Version", "WebVersion");
+ jsonVal["content"] = jsBody;
+ return showValue.write(jsonVal);
+}
+std::string JsonData::JsonCmd_Cgi_51(Param_51 ¶m)
+{
+ Json::Value jsonVal;
+ jsonVal.clear();
+ Json::Value jsBody;
+ jsonVal[JSON_FIELD_CMD] = "51";
+ jsonVal["success"] = true;
+ jsonVal["message"] = "";
+
+ char whereCon[1024] = {0};
+ char updateSql[1024] = { 0 };
+ string gatewayLocation = "";
+
+ sprintf(updateSql, "gatewayLocation='%s'",
+ param.strGateWayLocation.c_str());
+ sprintf(whereCon, "gatewayMAC='%s'", param.strGateWayMAC.c_str());
+ if(param.mMode == 0){
+ int iRet = sql_ctl->UpdateTableData(T_GATEWAY_INFO(TNAME), updateSql, whereCon);
+ if(iRet != 0)
+ jsonVal["success"] = false;
+ }else{
+ gatewayLocation = sql_ctl->GetData(T_GATEWAY_INFO(TNAME) ,"gatewayLocation", NULL);
+ jsBody["gateWayLocation"] = gatewayLocation;
+ }
+
+
+
+ jsonVal["content"] = jsBody;
+
+ return showValue.write(jsonVal);
+}
+std::string JsonData::JsonCmd_Cgi_52(Param_52 ¶m)
+{
+ Json::Value jsonVal;
+ Json::Value jsBody;
+
+ jsonVal.clear();
+ jsonVal["cmd"] = "52";
+ jsonVal["dataWatchNo"] = GlobalConfig::MacAddr_G;
+ jsonVal["cmdSerial"] = param.mCmdSerial;
+ jsonVal["success"] = true;
+ jsonVal["message"] = " ";
+
+ if (0 == param.mMode) { // 扫描
+ wifi::WPAClient wpa;
+ std::string netssid = wpa.GetNetSsid();
+ std::vector vecSsid;
+ boost::split(vecSsid, netssid, boost::is_any_of("\n"), boost::token_compress_off);
+ jsBody["type"] = "SCAN";
+ print_info("netssid : %s %d\n", netssid.c_str(), vecSsid.size());
+ for (unsigned int i = 1; i < vecSsid.size() - 1; i++) {
+ std::vector data;
+ boost::split(data, vecSsid[i], boost::is_any_of("\t"), boost::token_compress_off);
+ Json::Value wifiInfo;
+ wifiInfo["bssid"] = data[0];
+ wifiInfo["frequency"] = data[1];
+ wifiInfo["signallevel"] = data[2];
+ wifiInfo["secure"] = data[3];
+ wifiInfo["ssid"] = data[4];
+ jsBody["wifilist"].append(wifiInfo);
+
+ }
+ } else if ( 1 == param.mMode) { // 设置
+ print_info("set WiFi\n");
+ wifi::WPAClient wpa;
+ jsBody["ssid"] = param.mSsid;
+ if (param.mPassWord.length() > 0) {
+ if (wpa.ConnectWiFi(param.mSsid.c_str(), param.mPassWord.c_str())) {
+ jsBody["status"] = true;
+ } else {
+ jsBody["status"] = false;
+ }
+ } else {
+ if (wpa.ConnectWiFiWithNoPassword(param.mSsid.c_str())) {
+ jsBody["status"] = true;
+ } else {
+ jsBody["status"] = false;
+ }
+ }
+ } else if ( 2 == param.mMode ) { // 获取
+ wifi::WPAClient wpa;
+ std::string ssid = " ";
+ int rssi = 0;
+ ssid = wpa.GetCurrentSSID();
+ rssi = wpa.GetWiFiRssi() ;
+ jsBody["ssid"] = ssid;
+ jsBody["rssi"] = rssi;
+ } else if ( 3 == param.mMode ) {
+ wifi::WPAClient wpa;
+ if (wpa.CleanWifi()) {
+ jsonVal["message"] = "wifi断开成功";
+ } else {
+ jsonVal["message"] = "wifi断开失败";
+ }
+ }
+
+ jsonVal["content"] = jsBody;
+ return showValue.write(jsonVal);
+}
+
+std::string JsonData::JsonCmd_Cgi_53(std::vector ¶m)
+{
+ Json::Value jsonVal;
+ jsonVal.clear();
+
+ jsonVal["cmd"] = "53";
+ jsonVal["dataNodeGatewayNo"] = GlobalConfig::MacAddr_G;
+ jsonVal["success"] = true;
+ jsonVal["message"] = " ";
+
+ char whereCon[1024] = {0};
+ char updateSql[1024] = { 0 };
+ for(int i = 0; i < param.size();i++){
+ if(param[i].mUpdateKey2 == ""){
+ sprintf(updateSql, "%s='%s',UpdateFlag = 0",
+ param[i].mUpdateKey.c_str(), param[i].mUpdateValue.c_str());
+ }else if(param[i].mUpdateKey3 == "" && param[i].mUpdateKey2 != ""){
+ sprintf(updateSql, "%s='%s',%s='%s',UpdateFlag = 0",
+ param[i].mUpdateKey.c_str(), param[i].mUpdateValue.c_str(),param[i].mUpdateKey2.c_str(), param[i].mUpdateValue2.c_str());
+ }else if(param[i].mUpdateKey3 != "" && param[i].mUpdateKey2 != ""){
+ sprintf(updateSql, "%s='%s',%s='%s',%s='%s',UpdateFlag = 0",
+ param[i].mUpdateKey.c_str(), param[i].mUpdateValue.c_str(),param[i].mUpdateKey2.c_str(), param[i].mUpdateValue2.c_str(),\
+ param[i].mUpdateKey3.c_str(), param[i].mUpdateValue3.c_str());
+ }
+ sprintf(whereCon, "dataNodeNo='%s'", param[i].mdataNodeNo.c_str());
+
+ int iRet = sql_ctl->UpdateTableData(T_SENSOR_INFO(TNAME), updateSql, whereCon);
+ memset(whereCon,0x00,sizeof(whereCon));
+ memset(updateSql,0x00,sizeof(updateSql));
+ if(iRet != 0)
+ jsonVal["success"] = false;
+ }
+ return showValue.write(jsonVal);
+}
+
diff --git a/jsonparse/SH_JsonCmd.hpp b/jsonparse/SH_JsonCmd.hpp
index 50b0013..bf0f541 100644
--- a/jsonparse/SH_JsonCmd.hpp
+++ b/jsonparse/SH_JsonCmd.hpp
@@ -4,6 +4,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -13,6 +14,7 @@
#include "../calculation/Calculation.hpp"
#include "../uart/SH_Uart.hpp"
#include "../datatransfer/SH_Datatrans.hpp"
+#include "../wifi/wpa_client.h"
class JsonData {
@@ -26,8 +28,10 @@ public :
std::string JsonCmd_26(Param_26 ¶m);
std::string JsonCmd_27(Json::Value & recvBody);
std::string JsonCmd_29(Param_29 ¶m); //系统配置信息
- std::string JsonCmd_50(Json::Value & recvBody);
+ std::string JsonCmd_50(Json::Value & recvBody); //download update file
std::string JsonCmd_51(Json::Value & recvBody);
+ std::string JsonCmd_52();//upload static data
+ std::string JsonCmd_53(Json::Value & recvBody);
void JsonCmd_38(Json::Value &recvBody); //获取原始数据
void JsonCmd_39(Json::Value &recvBody); //更新传感器程序
@@ -37,24 +41,34 @@ public :
std::string JsonCmd_Cgi_07(); //获取系统内存温度硬盘等信息
std::string JsonCmd_07(); //获取系统内存温度硬盘等信息
std::string JsonCmd_Cgi_08(); //重启
- std::string JsonCmd_Cgi_09(); //实时数据获取
+ std::string JsonCmd_Cgi_09(Param_09 ¶m); //实时数据获取
+ std::string JsonCmd_Cgi_10(Param_10 ¶m); //
+ std::string JsonCmd_Cgi_11(Param_11 ¶m); //
std::string JsonCmd_Cgi_20(Param_20 ¶m); //终端信息获取
std::string JsonCmd_Cgi_22(Param_22 ¶m); //时区配置
std::string JsonCmd_Cgi_23(Param_23 ¶m); //服务器配置
std::string JsonCmd_Cgi_25(Param_25 ¶m); //网口配置
- std::string JsonCmd_Cgi_26();
+ std::string JsonCmd_Cgi_26(Param_26 ¶m);
std::string JsonCmd_Cgi_27(Param_27 ¶m);
std::string JsonCmd_Cgi_28(Param_28 ¶m);
std::string JsonCmd_Cgi_29(Param_29 ¶m); //获取原始数据
std::string JsonCmd_Cgi_30(Param_30 ¶m); //获取频域数据
std::string JsonCmd_Cgi_31(Param_31 ¶m);//配置通信通道
std::string JsonCmd_Cgi_32(Param_32 ¶m); //
+
+ std::string JsonCmd_Cgi_40(Param_40 ¶m); //
+ std::string JsonCmd_Cgi_41(std::vector ¶m); //
+ std::string JsonCmd_Cgi_42(Param_42 ¶m); //从web端更新程序
std::string JsonCmd_Cgi_43(); //检测网口状态
std::string JsonCmd_Cgi_45(Param_45 ¶m); //国家区域配置
std::string JsonCmd_Cgi_46(Param_46 ¶m); //升级固件
std::string JsonCmd_Cgi_47(Param_47 ¶m); //替换Logo
+ std::string JsonCmd_Cgi_50(); //
+ std::string JsonCmd_Cgi_51(Param_51 ¶m); //
+ std::string JsonCmd_Cgi_52(Param_52 ¶m);
+ std::string JsonCmd_Cgi_53(std::vector ¶m);
std::string JsonCmd_Cgi_default();
private :
diff --git a/localserver/SH_LocalServer.cpp b/localserver/SH_LocalServer.cpp
index 23c608e..0c19294 100644
--- a/localserver/SH_LocalServer.cpp
+++ b/localserver/SH_LocalServer.cpp
@@ -21,26 +21,30 @@ void LocalServer::HandleFromServer(const char *pData_r, int pLen, const char *to
}
std::string data_r = (std::string)(pData_r);
+ LOG_INFO("MQTT recv base64 %s\n",data_r.c_str());
print_brown("pData base : %s \n", data_r.c_str());
char *base64_data = new char[data_r.length()];
memset(base64_data, 0, data_r.length());
Secure::instance()->Base64Decode(data_r.c_str(), (unsigned char*)base64_data);
std::string pData = std::string(base64_data);
delete[] base64_data;
-
+ LOG_INFO("MQTT recv %s\n",pData.c_str());
print_brown("pData : %s \n", pData.c_str());
Json::Reader recvReader;
Json::Value recvValue;
Json::Value recvBody;
if (recvReader.parse(pData, recvValue)) {
- std::string cmdBody = recvValue["cmdBody"].asString();
- if (!recvReader.parse(cmdBody, recvBody)) {
- print_error("recv body error");
- return;
- }
- // recvBody = recvValue["cmdBody"];
- std::string str = recvBody["timestamp"].asString();
- int cmdType = atoi(recvValue["cmd"].asString().c_str());
+ int cmdType = atoi(recvValue["cmd"].asString().c_str());
+ if(cmdType == 41){
+ recvBody = recvValue["cmdBody"];
+ }else{
+ std::string cmdBody = recvValue["cmdBody"].asString();
+ if (!recvReader.parse(cmdBody, recvBody)) {
+ print_error("recv body error");
+ return;
+ }
+ }
+
switch (cmdType) {
case 7:{
JsonData jd;
@@ -53,8 +57,8 @@ void LocalServer::HandleFromServer(const char *pData_r, int pLen, const char *to
Json::FastWriter fw;
std::string strjson = fw.write(recvValue);
data_publish(strjson.c_str(), GlobalConfig::Topic_G.mPubCmd.c_str());
- system("echo 1 > /CIDW/start");
- boost::this_thread::sleep(boost::posix_time::seconds(1));
+ //system("echo 1 > /CIDW/start");
+ sleep(1);
system("reboot");
}
break;
@@ -65,9 +69,9 @@ void LocalServer::HandleFromServer(const char *pData_r, int pLen, const char *to
return;
}*/
std::string timestamp = recvBody["timestamp"].asString();
- unsigned long itimestamp = boost::lexical_cast(timestamp);
+ unsigned long itimestamp = atol(timestamp.c_str());
SetTime(itimestamp);
- boost::this_thread::sleep(boost::posix_time::milliseconds(200));
+ usleep(200);
system("hwclock -w");
if (!recvValue["ZoneId"].isNull() && recvValue["ZoneId"].asString().length() > 0) {
std::string zoneid = recvValue["ZoneId"].asString();
@@ -134,8 +138,8 @@ void LocalServer::HandleFromServer(const char *pData_r, int pLen, const char *to
if (0 == type.compare("SET")) {
param.mMode = 0;
param.mServerIp = recvBody["localServerIpAddress"].asString();
- param.mPort = boost::lexical_cast(recvBody["localServerPort"].asInt());
- param.mCommMode = boost::lexical_cast(recvBody["CommMode"].asInt());
+ param.mPort = to_string(recvBody["localServerPort"].asInt());
+ param.mCommMode = to_string(recvBody["CommMode"].asInt());
} else {
param.mMode = 1;
}
@@ -194,11 +198,49 @@ void LocalServer::HandleFromServer(const char *pData_r, int pLen, const char *to
std::string data = jd.JsonCmd_50(recvBody);
data_publish(data.c_str(), GlobalConfig::Topic_G.mPubCmd.c_str());
}break;
+ case 41:{
+
+ JsonData jd;
+ Param_41 param;
+ std::vector param41;
+ for(int i = 0; i < recvBody.size();i++){
+ param.mdataNodeNo = recvBody[i]["dataNodeNo"].asString();
+ param.mfeatureInterVal = recvBody[i]["featureInterVal"].asInt();
+ param.mwaveInterVal = recvBody[i]["waveInterVal"].asInt();
+ param.msamplingRate = recvBody[i]["samplingRate"].asInt();
+ param.mrange = recvBody[i]["range"].asInt();
+ param.mAccSampleTime = recvBody[i]["ACCSampleTime"].asInt();
+ param.mstartBrands = recvBody[i]["startBrands"].asString();
+ param.mstopBrands = recvBody[i]["stopBrands"].asString();
+ param.menvelopeBandPass = recvBody[i]["envelopeBandPass"].asString();
+ param.mviff = recvBody[i]["viff"].asInt();
+ param.mfaultFrequency = recvBody[i]["faultFrequency"].asString();
+ param41.push_back(param);
+ }
+ std::string data = jd.JsonCmd_Cgi_41(param41);
+ char whereCon[64] = { 0 };
+ sprintf(whereCon, "dataNodeNo='%s'", param.mdataNodeNo.c_str());
+ string strData = sql_ctl->GetNodeConfigureInfor(whereCon);
+ data_publish(strData.c_str(), GlobalConfig::Topic_G.mPubConfig.c_str());
+
+ }
+ break;
case 51:{
JsonData jd;
std::string data = jd.JsonCmd_51(recvBody);
data_publish(data.c_str(), GlobalConfig::Topic_G.mPubCmd.c_str());
}break;
+ case 52:{
+// JsonData jd;
+// std::string data = jd.JsonCmd_52(recvBody);
+// data_publish(data.c_str(), GlobalConfig::Topic_G.mPubCmd.c_str());
+ }break;
+ case 53:{
+ JsonData jd;
+ std::string data = jd.JsonCmd_53(recvBody);
+ data_publish(data.c_str(), GlobalConfig::Topic_G.mPubCmd.c_str());
+ }
+ break;
default:
// data_publish_local(pData.c_str(), GlobalConfig::Topic_G.mPubLocalCmd.c_str());
break;
@@ -274,10 +316,33 @@ try{
break;
case 9:{
JsonData jd;
- std::string data = jd.JsonCmd_Cgi_09();
+ Param_09 param;
+ param.mPackageFlag = recvBody["package"].asInt();
+ std::string data = jd.JsonCmd_Cgi_09(param);
return data;
}
break;
+ case 10:{
+ JsonData jd;
+ Param_10 param;
+ param.strDataNode = recvBody["DataNode"].asString();
+ param.strStatic = recvBody["Static"].asString();
+ param.straxis = recvBody["Raxis"].asString();
+ param.mPackageFlag = recvBody["package"].asInt();
+ param.timeStart = recvBody["timeStart"].asString();
+ param.timeEnd = recvBody["timeEnd"].asString();
+ std::string data = jd.JsonCmd_Cgi_10(param);
+ return data;
+ }
+ break;
+ case 11:{
+ JsonData jd;
+ Param_11 param;
+ param.DataNodeNo = recvBody["DataNode"].asString();
+ std::string data = jd.JsonCmd_Cgi_11(param);
+ return data;
+ }
+ break;
case 20:{
Param_20 param;
std::string type = recvBody["type"].asString();
@@ -319,7 +384,10 @@ try{
param.mMode = 0;
param.mServerIp = recvBody["SystemSettings"]["ServerIpAddress"].asString();
param.mPort = boost::lexical_cast(recvBody["SystemSettings"]["ServerPort"].asInt());
- param.mCommMode = boost::lexical_cast(recvBody["SystemSettings"]["CommMode"].asInt());
+ param.mCommMode = recvBody["SystemSettings"]["CommMode"].asString();
+ param.mUserName = recvBody["SystemSettings"]["UserName"].asString();
+ param.mPassword = recvBody["SystemSettings"]["Password"].asString();
+ param.mAPN = recvBody["SystemSettings"]["APN"].asString();
} else {
param.mMode = 1;
}
@@ -332,11 +400,12 @@ try{
case 25:{
Param_25 param;
std::string type = recvBody["type"].asString();
- if (0 == type.compare("SET")) {
+ if (0 == type.compare("SET")) {
+ param.mNet = recvBody["net"].asString();
param.mDnsName = recvBody["dnsName"].asString();
param.mGateway = recvBody["gateway"].asString();
param.mHostName = recvBody["hostName"].asString();
- param.mIp = recvBody["dataNodeGatewayIpAddress"].asString();
+ param.mIp = recvBody["dataWatchIpAddress"].asString();
param.mSubnetMask = recvBody["subnetMask"].asString();
param.mNetworkPortStatus = recvBody["networkPortStatus"].asString();
param.mMode = 0;
@@ -351,8 +420,10 @@ try{
break;
case 26:{
JsonData jd;
- std::string data = jd.JsonCmd_Cgi_26();
- printf("data = %s\n",data.c_str());
+ Param_26 param;
+ param.mPackageFlag = recvBody["package"].asInt();
+ std::string data = jd.JsonCmd_Cgi_26(param);
+ // print_info("data = %s\n",data.c_str());
return data;
}
break;
@@ -415,6 +486,119 @@ try{
return data;
}
break;
+ case 40:{
+ JsonData jd;
+ Param_40 param;
+ param.mChannelId = recvBody["channelId"].asString();
+ param.mPackageFlag = recvBody["package"].asInt();
+ param.mDataNodeNo = recvBody["dataNodeNo"].asString();
+ param.StartFrequency = recvBody["StartFrequency"].asInt();
+ param.EndFrequency = recvBody["EndFrequency"].asInt();
+ std::string data = jd.JsonCmd_Cgi_40(param);
+ return data;
+ }
+ break;
+ case 41:{
+ JsonData jd;
+ Param_41 param;
+ std::vector param41;
+ for(int i = 0; i < recvBody.size();i++){
+ param.mdataNodeNo = recvBody[i]["dataNodeNo"].asString();
+ param.mfeatureInterVal = recvBody[i]["featureInterVal"].asInt();
+ param.mwaveInterVal = recvBody[i]["waveInterVal"].asInt();
+ param.msamplingRate = recvBody[i]["samplingRate"].asInt();
+ param.mrange = recvBody[i]["range"].asInt();
+ param.mAccSampleTime = recvBody[i]["ACCSampleTime"].asInt();
+ param.mstartBrands = recvBody[i]["startBrands"].asString();
+ param.mstopBrands = recvBody[i]["stopBrands"].asString();
+ param.menvelopeBandPass = recvBody[i]["envelopeBandPass"].asString();
+ param.mviff = recvBody[i]["viff"].asInt();
+ param.mfaultFrequency = recvBody[i]["faultFrequency"].asString();
+ param41.push_back(param);
+ }
+ std::string data = jd.JsonCmd_Cgi_41(param41);
+ char whereCon[64] = { 0 };
+ sprintf(whereCon, "dataNodeNo='%s'", param.mdataNodeNo.c_str());
+ string strData = sql_ctl->GetNodeConfigureInfor(whereCon);
+ data_publish(strData.c_str(), GlobalConfig::Topic_G.mPubConfig.c_str());
+ return data;
+ }
+ break;
+ case 42:{
+ JsonData jd;
+ Param_42 param;
+ param.fileName = recvBody["fileName"].asString();
+ std::string data = jd.JsonCmd_Cgi_42(param);
+ return data;
+ }
+ break;
+ case 50:{
+ JsonData jd;
+ std::string data = jd.JsonCmd_Cgi_50();
+ return data;
+ }
+
+ break;
+ case 51:{
+ JsonData jd;
+ Param_51 param;
+ std::string type = recvBody["type"].asString();
+ if(0 == type.compare("SET")){
+ param.mMode = 0;
+ param.strGateWayMAC = recvBody["gateWayNo"].asString();
+ param.strGateWayLocation = recvBody["gateWayLocation"].asString();
+
+ }else{
+ param.mMode = 1;
+ }
+ std::string data = jd.JsonCmd_Cgi_51(param);
+ return data;
+ }
+ break;
+ case 52:{
+ Param_52 param;
+ param.mCmdSerial = recvValue["cmdSerial"].asString();
+ std::string type = recvBody["type"].asString();
+ if (0 == type.compare("SCAN")) {
+ param.mMode = 0;
+ }
+ if (0 == type.compare("SET")) {
+ param.mMode = 1;
+ param.mSsid = recvBody["ssid"].asString();
+ param.mPassWord = recvBody["password"].asString();
+ }
+ if (0 == type.compare("GET")) {
+ param.mMode = 2;
+ }
+ if (0 == type.compare("CLEAN")) {
+ param.mMode = 3;
+ }
+ JsonData jd;
+ std::string data = jd.JsonCmd_Cgi_52(param);
+ return data;
+ }
+ break;
+ case 53:{
+ JsonData jd;
+ Param_53 param;
+ std::vector param53;
+ for(int i = 0; i < recvBody.size();i++){
+ param.mdataNodeNo = recvBody[i]["dataNodeNo"].asString();
+ param.mUpdateKey = recvBody[i]["updateKey"].asString();
+ param.mUpdateValue = recvBody[i]["updateValue"].asString();
+ param.mUpdateKey2 = recvBody[i]["updateKey2"].asString();
+ param.mUpdateValue2 = recvBody[i]["updateValue2"].asString();
+ param.mUpdateKey3 = recvBody[i]["updateKey3"].asString();
+ param.mUpdateValue3 = recvBody[i]["updateValue3"].asString();
+ param53.push_back(param);
+ }
+ std::string data = jd.JsonCmd_Cgi_53(param53);
+ char whereCon[64] = { 0 };
+ sprintf(whereCon, "dataNodeNo='%s'", param.mdataNodeNo.c_str());
+ string strData = sql_ctl->GetNodeConfigureInfor(whereCon);
+ data_publish(strData.c_str(), GlobalConfig::Topic_G.mPubConfig.c_str());
+ return data;
+ }break;
default:
JsonData jd;
std::string data = jd.JsonCmd_Cgi_default();
@@ -428,6 +612,6 @@ try{
jsVal["message"] = "未知错误";
Json::FastWriter fw;
return fw.write(jsVal);
-}
+}
}
diff --git a/main.cpp b/main.cpp
index 3a78adb..869ead7 100644
--- a/main.cpp
+++ b/main.cpp
@@ -42,29 +42,69 @@ int main(int argc, char *argv[])
// 初始化平台配置文件
platform->PlatFormInit();
+ //启动 mqtt客户端
+ boost::thread startMqtt(StartMqttClient);
+ startMqtt.detach();
+
+
+ sql_ctl->InintGateway();
+ sql_ctl->CalculateDip();
+ sql_ctl->CalculateBattery();
+ pUart->InitZigbee();
// UDP,接收客户端发来的组播消息,用于外接 QT 专家系统,屏蔽之
- boost::thread searchT(attrs,SearchThread);
+ boost::thread searchT(SearchThread);
searchT.detach();
// 串口处理线程,用于与 ZigBee 模块通信,通过ZigBee无线通信技术与无线传感器通信
boost::thread uartReadTh(UartStart);
uartReadTh.detach();
+ boost::thread uartTestReadTh(TestUart);
+ uartReadTh.detach();
+
+ boost::thread InitModuleReadTh(InitModule);
+ InitModuleReadTh.detach();
+ //boost::thread uartWatchDogReadTh(WatchDog);
+ //uartWatchDogReadTh.detach();
+
// 休眠2秒,等待串口线程初始化完毕
- boost::this_thread::sleep(boost::posix_time::seconds(2));
+ sleep(2);
// 串口数据处理,读取传感器原始波形数据
boost::thread uartWaveReadTh(UartStartWave);
uartWaveReadTh.detach();
- //启动 mqtt客户端
- boost::thread startMqtt(StartMqttClient);
- startMqtt.detach();
+
//启动 mqtt 心跳
boost::thread startHeart(HeartRep);
startHeart.detach();
+ //启动 mqtt 心跳
+ boost::thread startRunLED(RunLED);
+ startRunLED.detach();
+
+#ifdef NR5G_MODULE
+ print_info("NR5G_MODULE \n");
+ //5G
+ boost::thread startCSQ(GetCSQ);
+ startCSQ.detach();
+#ifndef NR5G_MEIGE
+ boost::thread startDial(Dial5G);
+ startDial.detach();
+#endif
+#endif
+
+#ifdef Q4G_MODULE
+ boost::thread startCSQ(GetCSQ);
+ startCSQ.detach();
+ print_info("4G_MODULE \n");
+
+#endif
+#ifdef WIFI_MODULE
+ print_info("WiFi_MODULE \n");
+#endif
+
// 通过UDP接收数据
boost::thread StartConnectSys(attrs, StartUdpSys);
StartConnectSys.detach();
@@ -81,13 +121,30 @@ int main(int argc, char *argv[])
boost::thread startTcpCgi(attrs,StartCgiServer);
startTcpCgi.detach();
- //pUart->UpdateZigbeeInfoCtrl();
+
+ sleep(5);
pUart->ZigbeeInit();
+ sleep(1);
pUart->UpdateZigbeeInfoCtrl();
- boost::this_thread::sleep(boost::posix_time::seconds(5));
+
+ bool status = Ping( GlobalConfig::ServerIP.c_str(), 10000);
+ print_info("===========status ======== %d\n",status);
+
+ /* char * szRes = sql_ctl->GetDataChar(T_SENSOR_INFO(TNAME), "dataNodeName", "dataNodeNo = '074cfd0000158d00'");
+ printf("szRes = %s\n",szRes);
+ for(int i = 0; i < 64;i++){
+ printf("temp = %02x ",szRes[i]);
+ }*/
+
+ int fd = OpenWatchDog();
while (GlobalConfig::QuitFlag_G) {
- boost::this_thread::sleep(boost::posix_time::seconds(20));
+
+ gpio_set(GlobalConfig::GPIO_G.hardWatchDog,1);
+ usleep(20000);
+ gpio_set(GlobalConfig::GPIO_G.hardWatchDog,0);
+ WriteWatchDog(fd);
+ sleep(20);
// data_publish(senddata.c_str(), GlobalConfig::Topic_G.mPubData.c_str());
}
diff --git a/mqttclient/SH_MqttClient.cpp b/mqttclient/SH_MqttClient.cpp
index 98e6606..3737870 100644
--- a/mqttclient/SH_MqttClient.cpp
+++ b/mqttclient/SH_MqttClient.cpp
@@ -48,21 +48,31 @@ int data_publish(const char *str, const char *topic)
{
int iRet = -1;
if(mosq != NULL){
- print_blue("data_publish: %s %s\n", str, topic);
+ //print_blue("data_publish: %s %s\n", str, topic);
std::string strTopic = std::string(topic);
- if (strTopic.find("cmd") != std::string::npos) {
+ if (strTopic.find("cmd") != std::string::npos || \
+ strTopic.find("configureInfo") != std::string::npos ) {
std::string pData = (std::string)str;
char *base64_aes = new char[pData.length() * 2];
memset(base64_aes, 0, pData.length() * 2);
Secure::instance()->Base64Encode((unsigned char*)pData.c_str(), base64_aes, pData.length());
iRet = mosquitto_publish(mosq, &mid_sent, topic, strlen(base64_aes), base64_aes, ud.topic_qos, false);
- print_blue("data_publish: %s \n",base64_aes);
+ //char *base64_data = new char[pData.length() * 2];
+ //memset(base64_data, 0, pData.length() *2);
+ //Secure::instance()->Base64Decode(base64_aes, (unsigned char*)base64_data);
+ //std::string pData = std::string(base64_data);
+ if(base64_aes != NULL)
+ delete[] base64_aes;
// free(out);
} else {
iRet = mosquitto_publish(mosq, &mid_sent, topic, strlen(str), str, ud.topic_qos, false);
}
}
+ if(iRet != 0)
+ {
+ reconnect();
+ }
return iRet;
}
@@ -93,6 +103,10 @@ int disconnect()
return mosquitto_disconnect(mosq);
}
+int reconnect()
+{
+ return mosquitto_reconnect(mosq);
+}
int start_client(const char *boardname, const char *gwid, const char* gwip, const char *gwver, const char *gwcode, std::string &salt)
{
char *id = NULL;
@@ -123,11 +137,11 @@ int start_client(const char *boardname, const char *gwid, const char* gwip, cons
signal(SIGPIPE, SIG_IGN);
int reconnect = 0;
if (my_connect_callback == NULL || my_message_callback == NULL || my_subscribe_callback == NULL || my_log_callback == NULL) {
- printf("please call the register_collback function first.\n");
+ print_info("please call the register_collback function first.\n");
return -1;
}
-
+ int qos = readIntValue( "config", "qos",(char*)GlobalConfig::Config_G.c_str());
mosquitto_lib_init();//使用mosquitto库函数前需进行初始化
memset(&mqttsdata, 0, sizeof(mqttsdata_t));
memcpy(mqttsdata.gwid, gwid, strlen(gwid));
@@ -142,19 +156,28 @@ int start_client(const char *boardname, const char *gwid, const char* gwip, cons
host = localip;
mqttsdata.port = GlobalConfig::ServerPort;
port = GlobalConfig::ServerPort;
-
+#ifdef WIFI_MODULE
+ mqttsdata.qos = 0;
+#else
+ mqttsdata.qos = qos;
+#endif
+ print_info("mqttsdata.qos = %d\n",mqttsdata.qos);
// std::string username = "root";
// std::string password = "xom!*283#@XHG";
- std::string username = "chaos";
- std::string password = "HSD272*#xkd";
+ std::string username = ReadStrByOpt(SERVERCONFIG, "Server", "UserName");
+ std::string password = ReadStrByOpt(SERVERCONFIG, "Server", "Password");
+ if(username == "" || password == ""){
+ username = "chaos";
+ password = "HSD272*#xkd";
+ }
char userName[100];
sprintf(userName, "%s", username.c_str());
char passWord[100];
sprintf(passWord, "%s", password.c_str());
-
+ print_info("userName = %s , passWord = %s\n",userName,passWord);
ud.username = userName;
ud.password = passWord;
@@ -162,6 +185,7 @@ int start_client(const char *boardname, const char *gwid, const char* gwip, cons
ud.dataUrl = mqttsdata.dataUrl;
ud.fsUrl = mqttsdata.fsUrl;
will_qos = mqttsdata.qos;
+ ud.topic_qos = will_qos;
ud.topic_count++;
ud.topics = (char**)realloc(ud.topics, ud.topic_count*sizeof(char *));
if (ud.topics == NULL) {
@@ -172,15 +196,15 @@ int start_client(const char *boardname, const char *gwid, const char* gwip, cons
sprintf(req_topic, "dev/cidwcc");
ud.topics[ud.topic_count - 1] = req_topic;
ud.verbose = 1;
- fprintf(stderr, "topic = %s!!!!!!!!!!!\n", ud.topics[ud.topic_count - 1]);
+ //fprintf(stderr, "topic = %s!!!!!!!!!!!\n", ud.topics[ud.topic_count - 1]);
memset(res_topic, 0, 100);
sprintf(res_topic, "gw/will");
- printf("res_topic:%s\n", res_topic);
+ print_info("res_topic:%s\n", res_topic);
will_topic = res_topic;
ud.resp_topic = res_topic;
sprintf(will_payload, "{\"cmd\":\"15\",\"gwID\":\"%s\"}", mqttsdata.gwid);
will_payloadlen = strlen(will_payload);
- printf("will_payload:%s,will_payloadlen:%ld\n", will_payload, will_payloadlen);
+ print_info("will_payload:%s,will_payloadlen:%ld\n", will_payload, will_payloadlen);
if (clean_session == false && (id_prefix || !id)){
if (!ud.quiet) fprintf(stderr, "Error: You must provide a client id if you are using the -c option.\n");
return 1;
@@ -230,7 +254,7 @@ int start_client(const char *boardname, const char *gwid, const char* gwip, cons
id[MOSQ_MQTT_ID_MAX_LENGTH] = '\0';
}
}
- printf("id:%s\n", id);
+ print_info("id:%s\n", id);
mosq = mosquitto_new(id, clean_session, &ud);
if (!mosq){
switch (errno){
@@ -316,15 +340,17 @@ int start_client(const char *boardname, const char *gwid, const char* gwip, cons
else{
rc = mosquitto_connect_bind(mosq, host, port, keepalive, bind_address);
}
- printf("host = %s port = %d rc = %d\n",host,port,rc);
+ print_info("host = %s port = %d rc = %d\n",host,port,rc);
if (rc){
if (!ud.quiet){
if (rc == MOSQ_ERR_ERRNO){
- strerror_r(errno, err, 1024);
- fprintf(stderr, "Error_: %s\n", err);
+ //strerror_r(errno, err, 1024);
+ //fprintf(stderr, "Error_: %s\n", err);
+ //print_info("%s",stderr);
}
else{
fprintf(stderr, "Unable to connect (%d).\n", rc);
+ print_info("%s",stderr);
}
}
goto mosq_free;
@@ -332,7 +358,8 @@ int start_client(const char *boardname, const char *gwid, const char* gwip, cons
rc = mosquitto_loop_forever(mosq, -1, 1);
if (rc)
{
- fprintf(stderr, "Error: %s\n", mosquitto_strerror(rc));
+ //fprintf(stderr, "Error: %s\n", mosquitto_strerror(rc));
+ //print_info("%s",stderr);
}
mosq_free:
mosquitto_destroy(mosq);
diff --git a/mqttclient/SH_MqttClient.h b/mqttclient/SH_MqttClient.h
index 89cb9aa..d080fc9 100644
--- a/mqttclient/SH_MqttClient.h
+++ b/mqttclient/SH_MqttClient.h
@@ -61,6 +61,7 @@ extern void register_collback(connect_callback connect_c,
extern int data_publish(const char *str, const char* topic);
extern int data_publish_wave(WAVE_CONTAIN *str, const char *topic);
extern int disconnect();
+extern int reconnect();
extern int subscribe(const char* topic, int qos);
extern int unsubscribe(const char* topic);
extern int start_client(const char *boardname, const char *gwid, const char* gwip, const char *gwver, const char *gwcode, std::string &salt);
diff --git a/platform/SH_PlatformInit.cpp b/platform/SH_PlatformInit.cpp
index 41be7df..f8a207f 100644
--- a/platform/SH_PlatformInit.cpp
+++ b/platform/SH_PlatformInit.cpp
@@ -9,20 +9,28 @@ int GlobalConfig::RUN_MODE = 0;
int GlobalConfig::QuitFlag_G = 1;
int GlobalConfig::LinkStatus_G = 0;
int GlobalConfig::LinkCount = 0;
+int GlobalConfig::net0Status = 1;
-
-std::string GlobalConfig::Version = "2.0.11";
+std::string GlobalConfig::Version = "3.0";
std::string GlobalConfig::MacAddr_G = "";
+std::string GlobalConfig::MacAddr_G2 = "";
std::string GlobalConfig::IpAddr_G = "";
std::string GlobalConfig::ServerIP = "";
+std::string GlobalConfig::NetStatus = "";
+std::string GlobalConfig::NetType = "";
+std::string GlobalConfig::NR5GTemp = "";
+int GlobalConfig::serverStatus = 0;
+int GlobalConfig::NetSignal = 0;
int GlobalConfig::ServerPort = 0;
TopicList GlobalConfig::Topic_G;
ZigbeeInfo GlobalConfig::ZigbeeInfo_G;
ZIGBEE GlobalConfig::Zigbee_G;
+GPIOInfo GlobalConfig::GPIO_G;
std::string GlobalConfig::DbName_G = "/opt/configenv/cidn.db"; //数据库名称
+std::string GlobalConfig::Config_G = "/opt/configenv/config.ini";
std::string GlobalConfig::UartName_G = "/dev/ttymxc4";
// 处理ZigBee网络接收过程的PanID切换
@@ -41,16 +49,57 @@ PlatformInit::~PlatformInit()
void PlatformInit::PlatFormInit()
{
try{
- GlobalConfig::MacAddr_G = GetLocalMac();
+ GlobalConfig::MacAddr_G = GetLocalMac("eth0");
+ GlobalConfig::MacAddr_G2 = GetLocalMac("eth1");
transform(GlobalConfig::MacAddr_G.begin(), GlobalConfig::MacAddr_G.end(), GlobalConfig::MacAddr_G.begin(), ::toupper);
+ transform(GlobalConfig::MacAddr_G2.begin(), GlobalConfig::MacAddr_G2.end(), GlobalConfig::MacAddr_G2.begin(), ::toupper);
GlobalConfig::IpAddr_G = IpAddrInit();
print_info("GlobalConfig::IpAddr_G : %s\n", GlobalConfig::IpAddr_G.c_str());
this->ConfigFileCheck();
+ print_info("ConfigFileCheck\n");
this->TopicInit();
+ print_info("TopicInit\n");
this->ServerIpInit();
+ print_info("TopicInit\n");
this->Sqlite3Init();
-
+ this->GPIOInit();
+
print_info("ServerIP : %s \n", GlobalConfig::ServerIP.c_str());
+ std::string strMac = sql_ctl->GetData("t_gateway_info","gatewayMAC",NULL);
+ if(strMac == "60294D208517"){
+ char szUpdateSql[100]={0x00};
+ sprintf(szUpdateSql,"gatewayMAC = '%s'",GlobalConfig::MacAddr_G.c_str());
+ sql_ctl->UpdateTableData("t_gateway_info",szUpdateSql,NULL);
+ }
+ else if(strMac != GlobalConfig::MacAddr_G ){
+ LOG_ERROR("MAC error strMac1 = %s,MacAddr_G1 = %s\n",strMac.c_str(),GlobalConfig::MacAddr_G.c_str());
+ strMac.insert(2,":");
+ strMac.insert(5,":");
+ strMac.insert(8,":");
+ strMac.insert(11,":");
+ strMac.insert(14,":");
+ ModifyMac((char*)strMac.c_str());
+ //system("reboot");
+ }
+#ifdef G2UL_GATEWAY
+ std::string strMac2 = sql_ctl->GetData("t_gateway_info","MAC2",NULL);
+ if(strMac2 == "60294D208518"){
+ char szUpdateSql[100]={0x00};
+ sprintf(szUpdateSql,"MAC2 = '%s'",GlobalConfig::MacAddr_G2.c_str());
+ sql_ctl->UpdateTableData("t_gateway_info",szUpdateSql,NULL);
+ }
+ else if(strMac2 != GlobalConfig::MacAddr_G2 ){
+ LOG_ERROR("MAC error strMac2 = %s,MacAddr_G2 = %s\n",strMac2.c_str(),GlobalConfig::MacAddr_G2.c_str());
+ strMac2.insert(2,":");
+ strMac2.insert(5,":");
+ strMac2.insert(8,":");
+ strMac2.insert(11,":");
+ strMac2.insert(14,":");
+ ModifyMac((char*)strMac2.c_str());
+ //system("reboot");
+ }
+#endif
+
// sleep(10);
} catch(...){
print_error("PlatFormInit exception happend.\n");
@@ -66,7 +115,7 @@ void PlatformInit::TopicInit()
GlobalConfig::Topic_G.mPubHeart = "wireless/heart/" + GlobalConfig::MacAddr_G;//
- GlobalConfig::Topic_G.mPubConfig = "wireless/configureInfor/" + GlobalConfig::MacAddr_G;
+ GlobalConfig::Topic_G.mPubConfig = "wireless/configureInfo/" + GlobalConfig::MacAddr_G;
GlobalConfig::Topic_G.mPubWaveData = "wireless/realTimeData/" + GlobalConfig::MacAddr_G;
@@ -78,6 +127,8 @@ void PlatformInit::TopicInit()
GlobalConfig::Topic_G.mPubRep = "wireless/resp/" + GlobalConfig::MacAddr_G;
+ GlobalConfig::Topic_G.mPubTiming = "equipment/cmd/" + GlobalConfig::MacAddr_G;
+
GlobalConfig::Topic_G.mPubLocalWifi = "up/" + GlobalConfig::MacAddr_G + "/recive/wifi";
@@ -128,7 +179,7 @@ int PlatformInit::ServerIpInit()
{
if (access(SERVERCONFIG, 0) >= 0) {
GlobalConfig::ServerIP = ReadStrByOpt(SERVERCONFIG, "Server", "localServerIpAddress");
- GlobalConfig::ServerPort = boost::lexical_cast(ReadStrByOpt(SERVERCONFIG, "Server", "localServerPort"));
+ GlobalConfig::ServerPort = atoi(ReadStrByOpt(SERVERCONFIG, "Server", "localServerPort").c_str());
}
}
@@ -136,10 +187,43 @@ int PlatformInit::ServerIpInit()
void PlatformInit::Sqlite3Init()
{
sql_ctl->OpenDB(GlobalConfig::DbName_G.c_str());
+ char szValue[10] = {0x00};
+ int nType = readIntValue( "Update", "type",(char*)GlobalConfig::Config_G.c_str());
+ if(nType== 1){
+ sql_ctl->SqliteInitDel(GlobalConfig::DbName_G.c_str());
+ writeIntValue("Update", "type",0,(char*)GlobalConfig::Config_G.c_str());
+ }
+ print_info("szValue = %d\n",nType);
sql_ctl->SqliteInit(GlobalConfig::DbName_G.c_str());
print_info("Sqlite3Init \n");
}
+void PlatformInit::GPIOInit()
+{
+#ifdef G2UL_GATEWAY
+ GlobalConfig::GPIO_G.zigAckrep = 507;
+ GlobalConfig::GPIO_G.zigAckreset = 499;
+ GlobalConfig::GPIO_G.zigReset = 496;
+ GlobalConfig::GPIO_G.commPower = 363;
+ GlobalConfig::GPIO_G.vol3_8 = 498;
+ GlobalConfig::GPIO_G.commRest = 466;
+ GlobalConfig::GPIO_G.wifiPower = 488;
+ GlobalConfig::GPIO_G.wifiReset = 474;
+ GlobalConfig::GPIO_G.hardWatchDog = 497;
+ GlobalConfig::GPIO_G.zigDef = 408;
+ GlobalConfig::GPIO_G.runLed = 409;
+ GlobalConfig::GPIO_G.errorLed = 410;
+ GlobalConfig::GPIO_G.netResetNet0 = 489;
+#else if IMX6UL_GATEWAY
+ GlobalConfig::GPIO_G.zigAckrep = 119;
+ GlobalConfig::GPIO_G.zigAckreset = 120;
+ GlobalConfig::GPIO_G.zigReset = 116;
+ GlobalConfig::GPIO_G.wifiReset = 8;
+ GlobalConfig::GPIO_G.commRest = 8;
+ GlobalConfig::GPIO_G.power = 9;
+ GlobalConfig::GPIO_G.errorLed = 130;
+#endif
+}
void PlatformInit::SystemInfoInit()
{
std::ifstream ifileOut(SYSTEMINFOFILE);
@@ -182,14 +266,14 @@ void PlatformInit::UserInit()
}
}
-void PlatformInit::EquipIpInit()
+void PlatformInit::EquipIpInit(std::string eth)
{
//eth0 初始化
int flag = 0;
- std::string networkPortStatus = ReadStrByOpt(NETWORKCONFIG, "Net", "networkPortStatus");
- std::string subnetMask = ReadStrByOpt(NETWORKCONFIG, "Net", "subnetMask");
- std::string gateway = ReadStrByOpt(NETWORKCONFIG, "Net", "gateway");
- std::string dataWatchIpAddress = ReadStrByOpt(NETWORKCONFIG, "Net", "ipAddress");
+ std::string networkPortStatus = ReadStrByOpt(NETWORKCONFIG, eth, "networkPortStatus");
+ std::string subnetMask = ReadStrByOpt(NETWORKCONFIG, eth, "subnetMask");
+ std::string gateway = ReadStrByOpt(NETWORKCONFIG, eth, "gateway");
+ std::string dataWatchIpAddress = ReadStrByOpt(NETWORKCONFIG, eth, "ipAddress");
std::string strStatus = GetFileContent(NETWORK, 18);
print_red("strStatus:%s\n networkPortStatus:%s dataWatchIpAddress:%s subnetMask:%s gateway:%s\n",strStatus.c_str(),networkPortStatus.c_str(),dataWatchIpAddress.c_str(),subnetMask.c_str(),gateway.c_str());
@@ -197,18 +281,31 @@ void PlatformInit::EquipIpInit()
{
print_white("dhcp config\n");
std::string cmd = "";
+#ifdef IMX6UL_GATEWAY
system("sed -i '17c auto eth0' /etc/network/interfaces");
system("sed -i '18c iface eth0 inet dhcp' /etc/network/interfaces");
system("sed -i '20c ' /etc/network/interfaces");
system("sed -i '21c ' /etc/network/interfaces");
system("sed -i '22c ' /etc/network/interfaces");
+#endif
+#ifdef G2UL_GATEWAY
+ if(eth == "eth0"){
+ system("sed -i '5c DHCP=ipv4' /etc/systemd/network/static/10-eth0-static.network");
+ system("sed -i '6c ' /etc/systemd/network/static/10-eth0-static.network");
+ system("sed -i '7c ' /etc/systemd/network/static/10-eth0-static.network");
+ }else if(eth == "eth1"){
+ system("sed -i '5c DHCP=ipv4' /etc/systemd/network/dynamic/20-eth1-dynamic.network");
+ system("sed -i '6c ' /etc/systemd/network/dynamic/20-eth1-dynamic.network");
+ system("sed -i '7c ' /etc/systemd/network/dynamic/20-eth1-dynamic.network");
+ }
+#endif
flag = 0;
}
if(0 == networkPortStatus.compare("STATIC"))
{
std::string cmd = "";
print_red("static config\n");
-
+#ifdef IMX6UL_GATEWAY
system("sed -i '18c iface eth0 inet static' /etc/network/interfaces");
if(dataWatchIpAddress.length() > 0)
{
@@ -236,15 +333,34 @@ void PlatformInit::EquipIpInit()
}
system(cmd.c_str());
cmd.clear();
+#endif
+#ifdef G2UL_GATEWAY
+ if(eth == "eth0"){
+ cmd = "sed -i '5c Address=" + dataWatchIpAddress + "' /etc/systemd/network/static/10-eth0-static.network";
+ system(cmd.c_str());
+ cmd = "sed -i '6c Netmask=" + subnetMask + "' /etc/systemd/network/static/10-eth0-static.network";
+ system(cmd.c_str());
+ cmd = "sed -i '7c Gateway=" + gateway + "' /etc/systemd/network/static/10-eth0-static.network";
+ system(cmd.c_str());
+ }else if(eth == "eth1"){
+ cmd = "sed -i '5c Address=" + dataWatchIpAddress + "' /etc/systemd/network/dynamic/20-eth1-dynamic.network";
+ system(cmd.c_str());
+ cmd = "sed -i '6c Netmask=" + subnetMask + "' /etc/systemd/network/dynamic/20-eth1-dynamic.network";
+ system(cmd.c_str());
+ cmd = "sed -i '7c Gateway=" + gateway + "' /etc/systemd/network/dynamic/20-eth1-dynamic.network";
+ system(cmd.c_str());
+ }
+#endif
flag = 1;
}
-
- if(1 == flag){ //静态直接更新
- system("source /etc/config.sh");
- }
- if(0 == flag) //动态重新启动获取
- {
- system("reboot");
- }
+#ifdef IMX6UL_GATEWAY
+
+
+ system("reboot");
+
+#endif
+#ifdef G2UL_GATEWAY
+ system("systemctl restart systemd-networkd.service");
+#endif
}
diff --git a/platform/SH_PlatformInit.hpp b/platform/SH_PlatformInit.hpp
index 3d2c04d..0734532 100644
--- a/platform/SH_PlatformInit.hpp
+++ b/platform/SH_PlatformInit.hpp
@@ -52,7 +52,9 @@ public :
/**
*@eth0 初始化
*/
- void EquipIpInit();
+ void EquipIpInit(std::string eth);
+
+ void GPIOInit();
private:
/**
diff --git a/searchdev/SH_SearchDev.cpp b/searchdev/SH_SearchDev.cpp
index c6a92d9..ea4e66d 100644
--- a/searchdev/SH_SearchDev.cpp
+++ b/searchdev/SH_SearchDev.cpp
@@ -107,7 +107,7 @@ void SearchDev::HandleRecv_1(const boost::system::error_code &pEc,size_t pBytesR
std::string status = jsData["status"].asString();
if(status.compare("REQ") == 0) {
jsData["dataWatchNo"] = GlobalConfig::MacAddr_G.c_str();
- jsData["localServerIpAddress"] = GlobalConfig::ServerIP;
+ jsData["localServerIpAddress"] = GlobalConfig::IpAddr_G;
jsData["status"] = "ACK";
jsData["DeviceType"] = "WirelessGateWay";
std::string strData = fw.write(jsData);
@@ -122,6 +122,8 @@ void SearchDev::HandleRecv_1(const boost::system::error_code &pEc,size_t pBytesR
default:
break;
}
+ }else{
+ print_error("parse error\n");
}
MultiCastRecv_1();
} else {
diff --git a/serial/serial.c b/serial/serial.c
new file mode 100644
index 0000000..3f9102c
--- /dev/null
+++ b/serial/serial.c
@@ -0,0 +1,503 @@
+/*
+ * A library for Linux serial communication
+ *
+ * Author: JoStudio, 2016
+ *
+ * Version: 0.5
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "serial.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#ifndef CMSPAR
+#define CMSPAR 010000000000
+#endif
+
+
+
+/*
+ * convert baud_rate to speed_t
+ */
+static speed_t get_speed(unsigned int baud_rate)
+{
+ switch (baud_rate) {
+ case 0:
+ return B0;
+ case 50:
+ return B50;
+ case 75:
+ return B75;
+ case 110:
+ return B110;
+ case 150:
+ return B150;
+ case 200:
+ return B200;
+ case 300:
+ return B300;
+ case 600:
+ return B600;
+ case 1200:
+ return B1200;
+ case 1800:
+ return B1800;
+ case 2400:
+ return B2400;
+ case 4800:
+ return B4800;
+ case 9600:
+ return B9600;
+ case 19200:
+ return B19200;
+ case 38400:
+ return B38400;
+ case 57600:
+ return B57600;
+ case 115200:
+ return B115200;
+ case 230400:
+ return B230400;
+ case 460800:
+ return B460800;
+ case 500000:
+ return B500000;
+ case 576000:
+ return B576000;
+ case 921600:
+ return B921600;
+ case 1000000:
+ return B1000000;
+ case 1152000:
+ return B1152000;
+ case 1500000:
+ return B1500000;
+ case 2000000:
+ return B2000000;
+ case 2500000:
+ return B2500000;
+ case 3000000:
+ return B3000000;
+ case 3500000:
+ return B3500000;
+ case 4000000:
+ return B4000000;
+ default:
+ //unsupported baud rate
+ return 0;
+ }
+}
+
+
+/**
+ * set baud rate of serial port
+ *
+ * @param file_descriptor file descriptor of serial device
+ * @param baud_rate baud rate
+ *
+ * @return 1 if success
+ * return negative error code if fail
+ */
+int serial_set_baud_rate(int file_descriptor, int baud_rate) {
+/* struct termios termio;
+ speed_t speed;
+ int fd = file_descriptor;
+
+ if ( fd < 0 ) {
+ return SERIAL_INVALID_FILE;
+ }
+
+ memset(&termio, 0, sizeof(termio));
+
+ //get old attribute
+ if (tcgetattr(fd, &termio)) {
+ return SERIAL_INVALID_RESOURCE;
+ }
+
+ //calculate baud rate
+ speed = get_speed(baud_rate);
+ if (speed == 0) {
+ return SERIAL_ERROR_BAUDRATE;
+ }
+ cfsetispeed(&termio, speed);
+ cfsetospeed(&termio, speed);
+
+ // set baud rate
+ if (tcsetattr(fd, TCSAFLUSH, &termio) < 0) {
+ return SERIAL_ERROR_BAUDRATE;
+ }*/
+ int iFd = file_descriptor;
+ int len,ret;
+ struct termios opt;
+ tcgetattr(iFd, &opt);
+ cfsetispeed(&opt, B115200);
+ cfsetospeed(&opt, B115200);
+ if (tcgetattr(iFd, &opt)<0) {
+ return -1;
+ }
+ opt.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG);
+ opt.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON);
+ opt.c_oflag &= ~(OPOST);
+ opt.c_cflag &= ~(CSIZE | PARENB | CBAUD);
+ opt.c_cflag |= (CS8 | B115200);
+ opt.c_cc[VMIN] = 255;
+ opt.c_cc[VTIME] = 5;
+ if (tcsetattr(iFd, TCSANOW, &opt)<0) {
+ return -1;
+ }
+ tcflush(iFd,TCIOFLUSH);
+
+ return 1;
+}
+
+
+/**
+ * set serial attributes
+ *
+ * @param file_descriptor file descriptor of serial device
+ * @param flow_ctrl
+ * @param data_bits how many bits per data, could be 7, 8, 5
+ * @param parity which parity method, could be PARITY_NONE, PARITY_ODD, PARITY_EVEN
+ * @param stop_bits how many stop bits
+ *
+ * @return 1 if success.
+ * return negative error code if fail.
+ */
+int serial_set_attr(int file_descriptor, int data_bits, char parity, int stop_bits, int flow_ctrl)
+{
+ struct termios termio;
+ int fd = file_descriptor;
+
+ if ( fd < 0 ) {
+ return SERIAL_INVALID_FILE;
+ }
+
+ memset(&termio, 0, sizeof(termio));
+
+ if (tcgetattr(fd, &termio)) {
+ return SERIAL_INVALID_RESOURCE;
+ }
+
+ //set flow control
+ switch(flow_ctrl) {
+ case FLOW_CONTROL_NONE :
+ termio.c_cflag &= ~CRTSCTS;
+ break;
+ case FLOW_CONTROL_HARDWARE :
+ termio.c_cflag |= CRTSCTS;
+ break;
+ case FLOW_CONTROL_SOFTWARE :
+ termio.c_cflag |= IXON | IXOFF | IXANY;
+ break;
+ }
+
+ //set data bit
+ termio.c_cflag &= ~CSIZE;
+ switch (data_bits) {
+ case 8:
+ termio.c_cflag |= CS8;
+ break;
+ case 7:
+ termio.c_cflag |= CS7;
+ break;
+ case 6:
+ termio.c_cflag |= CS6;
+ break;
+ case 5:
+ termio.c_cflag |= CS5;
+ break;
+ default:
+ termio.c_cflag |= CS8;
+ break;
+ }
+
+ //set stop bits
+ switch (stop_bits) {
+ case 1:
+ termio.c_cflag &= ~CSTOPB;
+ break;
+ case 2:
+ termio.c_cflag |= CSTOPB;
+ break;
+ default:
+ break;
+ }
+
+ //set parity bit
+ switch (parity) {
+ case PARITY_NONE:
+ termio.c_cflag &= ~(PARENB | PARODD);
+ break;
+ case PARITY_EVEN:
+ termio.c_cflag |= PARENB;
+ termio.c_cflag &= ~PARODD;
+ break;
+ case PARITY_ODD:
+ termio.c_cflag |= PARENB | PARODD;
+ break;
+ case PARITY_MARK:
+ termio.c_cflag |= PARENB | CMSPAR | PARODD;
+ break;
+ case PARITY_SPACE:
+ termio.c_cflag |= PARENB | CMSPAR;
+ termio.c_cflag &= ~PARODD;
+ break;
+ }
+
+ if (tcsetattr(fd, TCSAFLUSH, &termio) < 0) {
+ return SERIAL_ERROR_SETTING;
+ }
+
+ return 1;
+}
+
+
+/**
+ * open serial port
+ *
+ * @param device_filename device file name, such as "/dev/ttyS0"
+ * @param baund_rate could be 57600, 38400, 19200, 9600, 4800, 2400, 1200, 300
+ *
+ * @return file descriptor which could be used in read() or write()
+ * return -1 if failed, and errno is set
+ */
+int serial_open_file(char *device_filename, int baud_rate) {
+ int fd;
+ struct termios termio;
+
+ if ((fd = open(device_filename, O_RDWR | O_NOCTTY )) == -1) {
+ return -1;
+ }
+
+ memset(&termio, 0, sizeof(termio));
+
+ // setup the tty and the selected baud rate
+ // get current modes
+ if (tcgetattr(fd, &termio)) {
+ close(fd);
+ return -1;
+ }
+
+ // setup initial mode: 8 bit data, No parity, 1 stop bit, no echo, no flow control
+ cfmakeraw(&termio);
+ if (tcsetattr(fd, TCSAFLUSH, &termio) < 0) {
+ close(fd);
+ return -1;
+ }
+
+ if (serial_set_baud_rate(fd, baud_rate) != 1) {
+ close(fd);
+ return -1;
+ }
+
+ return fd;
+}
+
+/**
+ * open serial port
+ *
+ * @param file_descriptor file descriptor of serial device
+ * @param timeout timeout in second
+ *
+ * @return 1 if success
+ * return negative error code if fail
+ */
+int serial_set_timeout(int file_descriptor, int timeout)
+{
+ int fd = file_descriptor;
+ struct termios termio;
+
+ if (fd < 0) {
+ return SERIAL_INVALID_FILE;
+ }
+
+
+ // get current attributes
+ if (tcgetattr(fd, &termio)) {
+ return SERIAL_INVALID_RESOURCE;
+ }
+
+ //set read timeout
+ if (timeout > 0) {
+ timeout = timeout / 100;
+ if (timeout == 0)
+ timeout = 1;
+ }
+ termio.c_lflag &= ~ICANON; /* Set non-canonical mode */
+ termio.c_cc[VTIME] = timeout; /* Set timeout in tenth seconds */
+ if (tcsetattr(fd, TCSANOW, &termio) < 0) {
+ return SERIAL_ERROR_SETTING;
+ }
+
+ return 1;
+}
+
+
+/**
+ * open serial port
+ *
+ * @param port number of port, could be 0, 1 ... , the device file is /dev/ttyS0, /dev/ttyS1 respectively
+ * @param baund_rate could be 57600, 38400, 19200, 9600, 4800, 2400, 1200, 300
+ *
+ * @return file descriptor which could be used in read() or write()
+ * return -1 if failed, and errno is set
+ */
+int serial_open(char* port, int baud_rate) {
+ char buf[128];
+
+ snprintf(buf, sizeof(buf), "/dev/ttyS%d", port);
+ return serial_open_file(port, baud_rate);
+}
+
+
+/**
+ * close serial port
+ *
+ * @param file_descriptor file descriptor of serial port device file
+ *
+ * @return 0 if success.
+ * return -1 if failed, and errno is set.
+ */
+int serial_close(int file_descriptor) {
+ return close(file_descriptor);
+}
+
+
+/**
+ * The function waits until all queued output to the terminal filedes has been transmitted.
+ *
+ * tcdrain() is called.
+
+ * @param file_descriptor file descriptor of serial port device file
+ *
+ * @return 0 if success.
+ * return -1 if fail, and errno is set.
+ */
+int serial_flush(int file_descriptor)
+{
+ return tcdrain(file_descriptor);
+}
+
+/**
+ * whether data is available
+ *
+ * @param file_descriptor file descriptor of serial port device file
+ * @param timeout_millisec timeout in millisecond
+ *
+ * @return 1 if data is available
+ * return 0 if data is not available
+ */
+int serial_data_available(int file_descriptor, unsigned int timeout_millisec)
+{
+ int fd = file_descriptor;
+ struct timeval timeout;
+ fd_set readfds;
+
+ if (fd < 0) {
+ return SERIAL_INVALID_FILE;
+ }
+
+ if (timeout_millisec == 0) {
+ // no waiting
+ timeout.tv_sec = 0;
+ timeout.tv_usec = 0;
+ } else {
+ timeout.tv_sec = timeout_millisec / 1000;
+ timeout.tv_usec = (timeout_millisec % 1000) * 1000;
+ }
+
+ FD_ZERO(&readfds);
+ FD_SET(fd, &readfds);
+
+ if (select(fd + 1, &readfds, NULL, NULL, &timeout) > 0) {
+ return 1; // data is ready
+ } else {
+ return 0; // no data
+ }
+}
+
+
+/**
+ * send data
+ *
+ * @param file_descriptor file descriptor of serial port device file
+ * @param buffer buffer of data to send
+ * @param data_len data length
+ *
+ * @return positive integer of bytes sent if success.
+ * return -1 if failed.
+ */
+int serial_send(int file_descriptor, char *buffer, size_t data_len)
+{
+ ssize_t len = 0;
+ len = write(file_descriptor, buffer, data_len);
+ if ( len == data_len ) {
+ return len;
+ } else {
+ tcflush(file_descriptor, TCOFLUSH);
+ return -1;
+ }
+
+}
+
+/**
+ * receive data
+ *
+ * @param file_descriptor file descriptor of serial port device file
+ * @param buffer buffer to receive data
+ * @param data_len max data length
+ *
+ * @return positive integer of bytes received if success.
+ * return -1 if failed.
+ */
+int serial_receive(int file_descriptor, char *buffer,size_t data_len)
+{
+ int len,fs_sel;
+ fd_set fs_read;
+ struct timeval time;
+ int fd = file_descriptor;
+
+ FD_ZERO(&fs_read);
+ FD_SET(fd, &fs_read);
+
+ time.tv_sec = 10;
+ time.tv_usec = 0;
+
+ //use select() to achieve multiple channel communication
+ fs_sel = select(fd + 1, &fs_read, NULL, NULL, &time);
+ if ( fs_sel ) {
+ len = read(fd, buffer, data_len);
+ return len;
+ } else {
+ return -1;
+ }
+}
+
+
diff --git a/serial/serial.h b/serial/serial.h
new file mode 100644
index 0000000..5e1eb3b
--- /dev/null
+++ b/serial/serial.h
@@ -0,0 +1,193 @@
+/*
+ * A library for Linux serial communication
+ *
+ * Author: JoStudio, 2016
+ *
+ * Version: 0.5
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef __SERIAL_H__
+#define __SERIAL_H__
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+
+/* serial error code */
+#define SERIAL_ERROR_OPEN -1
+#define SERIAL_ERROR_READ -2
+#define SERIAL_ERROR_WRITE -3
+#define SERIAL_ERROR_BAUDRATE -4
+#define SERIAL_ERROR_SETTING -5
+#define SERIAL_INVALID_RESOURCE -6
+#define SERIAL_INVALID_FILE -7
+
+
+/* flow control */
+#define FLOW_CONTROL_NONE 0
+#define FLOW_CONTROL_HARDWARE 1
+#define FLOW_CONTROL_SOFTWARE 2
+
+/* parity */
+#define PARITY_NONE 'N'
+#define PARITY_EVEN 'E'
+#define PARITY_ODD 'O'
+#define PARITY_SPACE 'S'
+#define PARITY_MARK 'M'
+
+
+/**
+ * open serial port
+ *
+ * @param port number of port, could be 0, 1 ... , the device file is /etc/ttyS0, /etc/ttyS1 respectively
+ * @param baund_rate could be 57600, 38400, 19200, 9600, 4800, 2400, 1200, 300
+ *
+ * @return file descriptor which could be used in read() or write()
+ * return -1 if failed, and errno is set
+ */
+int serial_open(char* port, int baud_rate);
+
+
+/**
+ * close serial port
+ *
+ * @param file_descriptor file descriptor of serial port device file
+ *
+ * @return 0 if success.
+ * return -1 if failed, and errno is set.
+ */
+int serial_close(int file_descriptor);
+
+/**
+ * open serial port
+ *
+ * @param device_filename device file name, such as "/etc/ttyS0"
+ * @param baund_rate could be 57600, 38400, 19200, 9600, 4800, 2400, 1200, 300
+ *
+ * @return file descriptor which could be used in read() or write()
+ * return -1 if failed, and errno is set
+ */
+int serial_open_file(char *device_filename, int baud_rate);
+
+
+/**
+ * set serial attributes
+ *
+ * @param file_descriptor file descriptor of serial device
+ * @param flow_ctrl
+ * @param data_bits how many bits per data, could be 7, 8, 5
+ * @param parity which parity method, could be PARITY_NONE, PARITY_ODD, PARITY_EVEN
+ * @param stop_bits how many stop bits
+ *
+ * @return 1 if success.
+ * return negative error code if fail.
+ */
+int serial_set_attr(int file_descriptor, int data_bits, char parity, int stop_bits, int flow_ctrl);
+
+
+/**
+ * open serial port
+ *
+ * @param file_descriptor file descriptor of serial device
+ * @param timeout timeout in second
+ *
+ * @return 1 if success
+ * return negative error code if fail
+ */
+int serial_set_timeout(int file_descriptor, int timeout);
+
+
+/**
+ * set baud rate of serial port
+ *
+ * @param file_descriptor file descriptor of serial device
+ * @param baud_rate baud rate
+ *
+ * @return 1 if success
+ * return negative error code if fail
+ */
+int serial_set_baud_rate(int file_descriptor, int baud_rate) ;
+
+
+
+
+/**
+ * The function waits until all queued output to the terminal filedes has been transmitted.
+ *
+ * tcdrain() is called.
+
+ * @param file_descriptor file descriptor of serial port device file
+ *
+ * @return 0 if success.
+ * return -1 if fail, and errno is set.
+ */
+int serial_flush(int file_descriptor);
+
+/**
+ * whether data is available
+ *
+ * @param file_descriptor file descriptor of serial port device file
+ * @param timeout_millisec timeout in millisecond
+ *
+ * @return 1 if data is available
+ * return 0 if data is not available
+ */
+int serial_data_available(int file_descriptor, unsigned int timeout_millisec);
+
+
+/**
+ * send data
+ *
+ * @param file_descriptor file descriptor of serial port device file
+ * @param buffer buffer of data to send
+ * @param data_len data length
+ *
+ * @return positive integer of bytes sent if success.
+ * return -1 if failed.
+ */
+int serial_send(int file_descriptor, char *buffer, size_t data_len);
+
+
+
+/**
+ * receive data
+ *
+ * @param file_descriptor file descriptor of serial port device file
+ * @param buffer buffer to receive data
+ * @param data_len max data length
+ *
+ * @return positive integer of bytes received if success.
+ * return -1 if failed.
+ */
+int serial_receive(int file_descriptor, char *buffer,size_t data_len);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* __SERIAL_H__ */
diff --git a/tcpcgi/TcpCgi.cpp b/tcpcgi/TcpCgi.cpp
index 510f1f3..a8aefe2 100644
--- a/tcpcgi/TcpCgi.cpp
+++ b/tcpcgi/TcpCgi.cpp
@@ -53,7 +53,7 @@ void TcpCgi::startCgiServer()
std::string recvData = std::string(buff);
std::string reqData = cidwServer->HandleCgi_cmd(recvData);
- print_info("send cgi : %s\n", reqData.c_str());
+ //print_info("send cgi : %s\n length = %d\n", reqData.c_str(),reqData.length());
if( send(connfd, reqData.c_str(), reqData.length(), 0) < 0){
printf("send msg error: %s(errno: %d)\n", strerror(errno), errno);
}
diff --git a/threadfunc/SH_ThreadFunc.cpp b/threadfunc/SH_ThreadFunc.cpp
index 9aac80b..60787e1 100644
--- a/threadfunc/SH_ThreadFunc.cpp
+++ b/threadfunc/SH_ThreadFunc.cpp
@@ -9,6 +9,10 @@
#include "SH_ThreadFunc.hpp"
#include "../API_log/SH_log.h"
#include "../uart/SH_Uart.hpp"
+#include "../common/SH_CommonFunc.hpp"
+#include "../dial5G/Dial.h"
+#include "../wifi/wpa_client.h"
+#include
namespace{
Uart *pUart = Uart::instance();
@@ -20,6 +24,8 @@ static std::string uptime;
static long long connect_lost_time = 0; //ms
static long long connect_time = 0; //ms
+Dial dial;
+
void CheckThread()
{
print_info("ENTER CHECK THREAD \n");
@@ -31,27 +37,123 @@ void CheckThread()
int reset_flag = 0;
int online_check = 0;
int HardStatus = 0;
+ int logClean = 0;
+ int Battery = 0;
+ int UpdateZigbee = 0;
+ int commSignal = 0;
+ int loose_check = 0;
+ int mqttresend = 0;
+ int rebootsystem = 0;
+ int ModifyAddr = 0;
+ int wifi_reconnect_count = 0;
+ int checkNet0 = 0;
+ int connectCount = 0;
while (GlobalConfig::QuitFlag_G) {
if (10 == heart_count) {
// StatusPub();
if (GlobalConfig::LinkCount > 30) {
- exit(0);
+ //exit(0);
}
std::string ipTemp = IpAddrInit();
+ GlobalConfig::IpAddr_G = ipTemp;
if ( 0 != ipTemp.compare(GlobalConfig::IpAddr_G)) {
- exit(0);
+ //exit(0);
}
heart_count = 0;
}
-
- if (600 == time_check) {
+#ifdef G2UL_GATEWAY
+ if(checkNet0 == 5){
+ checkNet0 = 0;
+ int iStatus = get_netlink_status("eth0");
+ if(iStatus == 1 && GlobalConfig::net0Status == 0){
+ system("ifconfig eth0:1 192.168.188.188 netmask 255.255.255.0");
+ }
+ GlobalConfig::net0Status = iStatus;
+ }
+#endif
+ if (300 == time_check) {
char buf[256] = {0};
sprintf(buf, "{\"dataNodeGatewayNo\":\"%s\",\"cmd\":\"12\",\"status\":\"REQ\"}",
GlobalConfig::MacAddr_G.c_str());
std::string str = std::string(buf);
- data_publish(str.c_str(), GlobalConfig::Topic_G.mPubCmd.c_str());
time_check = 0;
+ int iRet = data_publish(str.c_str(), GlobalConfig::Topic_G.mPubCmd.c_str());
+ if(iRet != 0 )
+ {
+ LOG_ERROR("MQTT connect failed\n");
+ //bool status = Ping( GlobalConfig::ServerIP.c_str(), 10000);
+#ifdef NR5G_MODULE
+#ifdef IMX6UL_GATEWAY
+ dial.closePort();
+ gpio_set(GlobalConfig::GPIO_G.commRest,0);
+ LOG_DEBUG("GPIO 8 start\n");
+ sleep(2);
+ gpio_set(GlobalConfig::GPIO_G.commRest,1);
+ LOG_DEBUG("GPIO 8 End\n");
+ sleep(20);
+ dial.openPort("/dev/ttyUSB2");
+ dial.setState();
+#endif
+#ifdef G2UL_GATEWAY
+ dial.closePort();
+ gpio_set(GlobalConfig::GPIO_G.commPower,0);
+ LOG_DEBUG("commPower start\n");
+ sleep(2);
+ gpio_set(GlobalConfig::GPIO_G.commPower,1);
+ LOG_DEBUG("commPower End\n");
+ sleep(20);
+ connectCount ++;
+ if(connectCount > 10){
+ LOG_ERROR("5G reset error ,reboot!\n");
+ system("reboot");
+ }
+#ifndef NR5G_MEIGE
+ dial.openPort("/dev/ttyUSB2");
+ dial.setState();
+#else
+ char szquectel[100]={0x00};
+ std::string strAPN = ReadStrByOpt(SERVERCONFIG, "Server", "APN");
+ sprintf(szquectel,"/opt/quectel-CM/Meig-CM -s %s &",strAPN.c_str());
+ system(szquectel);
+#endif
+#endif
+#endif
+#ifdef WIFI_MODULE
+ LOG_ERROR("WiFi reset!\n");
+#ifdef IMX6UL_GATEWAY
+ gpio_set(GlobalConfig::GPIO_G.wifiReset,0);
+ sleep(5);
+ gpio_set(GlobalConfig::GPIO_G.wifiReset,1);
+ sleep(5);
+ wifi::WPAClient wpa;
+ wpa.ReconnectWiFi();
+ system("/etc/init.d/wpa_restart");
+ system("udhcpc -i wlan2 &");
+#endif
+#ifdef G2UL_GATEWAY
+ system("/etc/init.d/wpa_restart");
+ sleep(5);
+ string strip = GetGwIp_("wlan0");
+ print_info("strip = %s\n",strip.c_str());
+ if (strip.compare("0.0.0.0") != 0) {
+
+ }else{
+ gpio_set(GlobalConfig::GPIO_G.wifiReset,1);
+ sleep(5);
+ gpio_set(GlobalConfig::GPIO_G.wifiReset,0);
+ sleep(30);
+ wifi::WPAClient wpa;
+ wpa.ReconnectWiFi();
+ system("/etc/init.d/wpa_restart");
+ sleep(5);
+ system("udhcpc -b -i wlan0 &");
+ }
+#endif
+#endif
+ }else{
+ connectCount = 0;
+ }
}
if(HardStatus == 3600){//one hour 3600
JsonData jd;
@@ -59,26 +161,227 @@ void CheckThread()
data_publish(data.c_str(), GlobalConfig::Topic_G.mPubStatus.c_str());
HardStatus = 0;
}
+ if(mqttresend == 1800){
+ mqttresend = 0;
+#ifdef WIFI_MODULE
+ bool status = Ping( GlobalConfig::ServerIP.c_str(), 10000);
+ if(status != 0){
+ LOG_INFO("===========net status ========failed \n");
+ LOG_ERROR("openSwitch\n");
+ sleep(20);
+ gpio_set(GlobalConfig::GPIO_G.power,1);
+ }
+#endif
+ LOG_INFO("mqttresend check\n");
+ Json::Value jsHeart;
+ Json::FastWriter fw;
+ jsHeart["dataNodeGatewayNo"] = GlobalConfig::MacAddr_G;
+ jsHeart["status"] = "online_V" + GlobalConfig::Version;
+ jsHeart["IP"] = GlobalConfig::IpAddr_G;
+ std::string strJson = fw.write(jsHeart);
+ int iRet = data_publish(strJson.c_str(), GlobalConfig::Topic_G.mPubHeart.c_str());
+ if(iRet == 0){
+ sql_ctl->QueryofflineData();
+ }
- if (onlineCheck == online_check) {
- JsonData jd;
- jd.DataNodeStatusCheck();
- LOG_INFO("online_check = %d",online_check);
- Param_29 param;
- std::string cmd29 = jd.JsonCmd_29(param);
- data_publish(cmd29.c_str(), GlobalConfig::Topic_G.mPubCmd.c_str());
- online_check = 0;
}
+ if (600 == online_check) {
+ online_check = 0;
+ int Count = sql_ctl->GetTableRows(T_SENSOR_INFO(TNAME), NULL);
+ if(Count > 0){
+ JsonData jd;
+ jd.DataNodeStatusCheck();
+ Param_29 param;
+ std::string cmd29 = jd.JsonCmd_29(param);
+ int iRet = data_publish(cmd29.c_str(), GlobalConfig::Topic_G.mPubCmd.c_str());
+ char localtimestamp[32] = { 0 };
+ GetTimeNet(localtimestamp, 1);
+ std::string nowTimetamp = std::string(localtimestamp);
+ char selectCon[128] = { 0 };
+ sprintf(selectCon, " sendMsg <> '' ORDER BY timeStamp DESC LIMIT 0,1");
+ sleep(1);
+ std::string strTime = sql_ctl->GetData(T_DATASTATIC_INFO(TNAME), "timeStamp", selectCon);
+ long lTime = atol(nowTimetamp.c_str())-atol(strTime.c_str());
+ LOG_INFO("online check = %d\n",lTime);
+ if(lTime > 1800){
+ LOG_ERROR("nowTimetamp = %s,lastTime = %s,lTime = %d\n",nowTimetamp.c_str(),strTime.c_str(),lTime);
+ }
+ }
+ }if(21000 == Battery){
+ Battery = 0;
+ sql_ctl->CalculateBattery();
+ }
+// if(10800 == UpdateZigbee){
+// UpdateZigbee = 0;
+// pUart->UpdateZigbeeInfoCtrl();
+// }
+ if(21000 == loose_check){
+ loose_check = 0;
+ sql_ctl->CalculateDip();
+ }
+ if(ModifyAddr == 21000 && pUart->bModifyAddr){
+//#ifdef IMX6UL_GATEWAY
+ LOG_ERROR("ModifyAddr failed \n");
+ exit(0);
+//#endif
+ }
+ if(ModifyAddr == 21000){
+ ModifyAddr = 0;
+ }
+
+ if(18000 == commSignal){ //5h
+ Json::Value jsBody,jsonVal;
+ Json::FastWriter showValue;
+ if(GlobalConfig::NetStatus == "\"NOCONN\"" || GlobalConfig::NetStatus == "\"CONNECT\""){
+ if(GlobalConfig::NetSignal == 0){
+ jsBody["communicationSignal"] = "未知";
+ }
+ else if(GlobalConfig::NetSignal > -80){
+ jsBody["commSignal"] = "优";
+ }else if(GlobalConfig::NetSignal > -90 && GlobalConfig::NetSignal < -80){
+ jsBody["commSignal"] = "良";
+ }else if(GlobalConfig::NetSignal > -105 && GlobalConfig::NetSignal < -90){
+ jsBody["commSignal"] = "一般";
+ }else if(GlobalConfig::NetSignal < -105){
+ jsBody["commSignal"] = "弱";
+ }else if(GlobalConfig::NetSignal < -115){
+ jsBody["commSignal"] = "不稳定";
+ }
+
+ }else if(GlobalConfig::NetStatus == "\"SEARCH\""){
+ jsBody["commSignal"] = "搜索网络";
+ }else if(GlobalConfig::NetStatus == "\"LIMSRV\""){
+ jsBody["commSignal"] = "未插卡";
+ }else{
+ jsBody["commSignal"] = "未知";
+ }
+
+ jsonVal["cmd"] = "53";
+ std::string dataBody = showValue.write(jsBody);
+ jsonVal["cmdBody"] = dataBody;
+ data_publish(showValue.write(jsonVal).c_str(), GlobalConfig::Topic_G.mPubConfig.c_str());
+ }
+ if(21000 == logClean){
+ logClean = 0;
+ DIR *dp; //创建一个指向root路径下每个文件的指针
+ struct dirent *dirp;
+ string root="/opt/log/";
+ if((dp = opendir(root.c_str()))==NULL)
+ cout << "can't open"<< root << endl;
+ while((dirp = readdir(dp)) != NULL){
+
+ if((!strcmp(dirp->d_name,".")||(!strcmp(dirp->d_name,".."))))
+ continue;
+ struct timeval curTime;
+ gettimeofday(&curTime, NULL);
+ char buffer[80] = {0};
+ char fileMonth[11] = {0};
+ char todayMonth[11]={0};
+ char fileDay[11] = {0};
+ char todayDay[11]={0};
+ struct tm nowTime;
+ localtime_r(&curTime.tv_sec, &nowTime);//把得到的值存入临时分配的内存中,线程安全
+ strftime(buffer, sizeof(buffer), "%Y-%m-%d", &nowTime);
+ memcpy(fileDay,dirp->d_name+8,2);
+ memcpy(todayDay,buffer+8,2);
+ memcpy(fileMonth,dirp->d_name+5,2);
+ memcpy(todayMonth,buffer+5,2);
+ string filename = root+ string(dirp->d_name);
+ if(atoi(fileMonth) == atoi(todayMonth) ? abs(atoi(todayDay) - atoi(fileDay)) > 15: abs(abs(30-(atoi(fileDay)) + atoi(todayDay))) > 15){
+ LOG_INFO("filename = %s\n",filename.c_str());
+ remove(filename.c_str());
+ }
+
+ }
+
+ /*staticData = 0;
+ Json::Value jsHeart;
+ Json::FastWriter fw;
+ jsHeart["dataNodeGatewayNo"] = GlobalConfig::MacAddr_G;
+ jsHeart["status"] = "online";
+ std::string strJson = fw.write(jsHeart);
+ int iRet = data_publish(strJson.c_str(), GlobalConfig::Topic_G.mPubHeart.c_str());
+ if(iRet == 0){
+ JsonData jd;
+ std::string data = jd.JsonCmd_52();
+ }
+ double freeDisk = GetHardDiskFree();
+ if(freeDisk < 90){
+ char whereCon[512] = {0x00};
+ time_t timestamp;
+ long timeStamp = time(×tamp) ;//秒级时间戳
+ memset(whereCon,0x00,sizeof(whereCon));
+ sprintf(whereCon,"sendMsg = '0' and timeStamp < '%s'",timeStamp-1); //1 week
+ sql_ctl->DeleteTableData(T_DATA_INFO(TNAME),whereCon,0);
+ sql_ctl->DeleteTableData(T_DATASTATIC_INFO(TNAME),whereCon,0);
+ }*/
+
+ }
+#ifdef WIFI_MODULE
+ if (wifi_reconnect_count == 600) { // 每 10分钟,重连WiFi网络
+ wifi_reconnect_count = 0;
+ wifi::WPAClient wpa;
+ std::string netssid = wpa.GetNetSsid();
+ std::string currentssid = "";
+ if (0 == netssid.compare("")) {
+ netssid = wpa.GetNetSsid();
+ }
+
+ if (netssid.length() > 0) {
+ currentssid = wpa.GetCurrentSSID();
+ if (currentssid.length() > 0) {
+ char buf[64] = {0};
+ std::string rssiSend = "";
+#ifdef G2UL_GATEWAY
+ rssiSend = "/usr/sbin/wpa_cli signal_poll|grep RSSI | cut -f 2 -d '='";
+#endif
+
+#ifdef IMX6UL_GATEWAY
+ rssiSend = "/opt/Cidn/wpa_cli signal_poll|grep RSSI | cut -f 2 -d '='";
+#endif
+ system_custom(rssiSend.c_str(), buf);
+ std::string Rssi = std::string(buf);
+
+ memset(buf, 0, 64);
+ sprintf(buf, "wifi:true Rssi:%s", Rssi.c_str());
+ print_info("%s\n", buf);
+ LOG_INFO("%s\n",buf);
+
+ } else {
+ std::string runinfo = "wifi:false\n";
+ print_info("%s\n", runinfo.c_str());
+ }
+ }
+ if (wpa.ReconnectWiFi()) {
+ print_info("wifi reconnect ok\n");
+ }
+ }
+#endif
+
if ( reset_flag > 7200) {
reset_flag = 0;
//exit(0);
}
+ Battery ++;
reset_flag++;
time_check++;
heart_count++;
online_check++;
HardStatus ++;
+ //UpdateZigbee ++;
+ logClean ++ ;
+ loose_check ++;
+ ModifyAddr ++;
+ mqttresend ++;
+#ifdef G2UL_GATEWAY
+ checkNet0 ++;
+#endif
+#ifdef WIFI_MODULE
+ wifi_reconnect_count ++;
+#endif
+
+ //rebootsystem ++;
if(GlobalConfig::EnterZigBeeWaveTransmittingFlag_G == ENTER_TRANSMITTING_STATUS) {
GlobalConfig::EnterZigBeeWaveTransmittingCnt_G ++;
if(GlobalConfig::EnterZigBeeWaveTransmittingCnt_G >= 180) {
@@ -87,13 +390,17 @@ void CheckThread()
LOG_ERROR("[---- ZigBee error--!] ZigBee PanID is 9999 over time for 3 minutes !\n");
// 重新写入 0x8888
unsigned short shortAddr = 0x8888;
- pUart->WriteShortAddr2Zigbee(shortAddr);
+ pUart->modify_LocalAddr(0x8888);
+ GlobalConfig::Zigbee_G.MyAddr = 0x8888;
+// pUart->WriteShortAddr2Zigbee(shortAddr);
// 延时1秒
- boost::this_thread::sleep(boost::posix_time::seconds(1));
+ sleep(1);
// 重新读回 GlobalConfig::ZigbeeInfo_G.PanID
pUart->UpdateZigbeeInfoCtrl();
+ pUart->bUpdateconfig = false;
+ pUart->bUpdate = false;
// 延时1秒
- boost::this_thread::sleep(boost::posix_time::seconds(1));
+ sleep(1);
std::string str("8888");
if( GlobalConfig::ZigbeeInfo_G.MyAddr.compare(str) == 0 ){
LOG_INFO("[---- ZigBee INFO ----!] ZigBee PanID come back to be 8888 !\n");
@@ -103,8 +410,7 @@ void CheckThread()
}
}
}
-
- boost::this_thread::sleep(boost::posix_time::milliseconds(1000));
+ sleep(1);;
}
}
@@ -114,40 +420,277 @@ void StartCgiServer()
TcpCgi *tcpCgi = TcpCgi::instance();
while (1) {
tcpCgi->startCgiServer();
- boost::this_thread::sleep(boost::posix_time::seconds(10));
+ sleep(10);
}
}
-
+void RunLED()
+{
+ while(1){
+ gpio_set(GlobalConfig::GPIO_G.runLed,1);
+ sleep(1);
+ gpio_set(GlobalConfig::GPIO_G.runLed,0);
+ sleep(1);
+ }
+}
void HeartRep()
{
+ int count = 0;
while(1) {
Json::Value jsHeart;
Json::FastWriter fw;
jsHeart["dataNodeGatewayNo"] = GlobalConfig::MacAddr_G;
- jsHeart["status"] = "online";
+ jsHeart["status"] = "online_V" + GlobalConfig::Version;
+ jsHeart["IP"] = GlobalConfig::IpAddr_G;
std::string strJson = fw.write(jsHeart);
- data_publish(strJson.c_str(), GlobalConfig::Topic_G.mPubHeart.c_str());
- boost::this_thread::sleep(boost::posix_time::seconds(10));
+ int iRet = data_publish(strJson.c_str(), GlobalConfig::Topic_G.mPubHeart.c_str());
+ print_info("heart = %s,iRet = %d\n",strJson.c_str(),iRet);
+ if(iRet != 0){
+ count ++;
+ gpio_set(GlobalConfig::GPIO_G.errorLed,1);
+ sleep(1);
+ gpio_set(GlobalConfig::GPIO_G.errorLed,0);
+ sleep(1);
+ gpio_set(GlobalConfig::GPIO_G.errorLed,1);
+ sleep(1);
+ gpio_set(GlobalConfig::GPIO_G.errorLed,0);
+ sleep(1);
+ gpio_set(GlobalConfig::GPIO_G.errorLed,1);
+ sleep(1);
+ GlobalConfig::serverStatus = 1;
+ }else{
+ GlobalConfig::serverStatus = 0;
+ count = 0;
+ gpio_set(GlobalConfig::GPIO_G.errorLed,0);
+ }
+ gpio_set(GlobalConfig::GPIO_G.errorLed,0);
+// if(count > 0){
+// bool status = Ping( GlobalConfig::ServerIP.c_str(), 10000);
+// if(status != 0)
+// //LOG_INFO("===========net status ========failed heart count %d\n",count);
+// if(status != 0 && count > 30){
+// LOG_ERROR("heart send failed,heart count %d\n",count);
+// count = 0;
+// sleep(20);
+// gpio_set(GlobalConfig::GPIO_G.power,1);
+// }
+// }
+// if(count > 1000){
+// gpio_set(GlobalConfig::GPIO_G.power,1);
+// count = 0;
+// }
+// write_data(fd,"AT+QENG=\"servingcell\"\r\n",27);
+// //sleep(1);
+// char buff[1024]={0x00};
+// int ret = read_data(fd, buff, 1024, 10);
+// print_info("ret = %d,buff = %s\n",ret,buff);
+// const char *str2 = "+QENG: ";
+// char csq[128] = {0};
+// char *pdata = strstr((char*)buff, str2);
+// if(pdata){
+// strncpy(csq, pdata+7, sizeof(csq));
+// }
+// else {
+// }
+//
+// //printf("SIM-CSQ: %s\n", csq);
+// GlobalConfig::NetStatus = GetOneContent(csq,1,",");
+// string signal = GetOneContent(csq,13,",");
+// GlobalConfig::NetSignal = atoi(signal.c_str());
+// print_info("NetStatus = %s,NetSignal = %d\n",GlobalConfig::NetStatus.c_str(),GlobalConfig::NetSignal);
+
+ //GlobalConfig::NetSignal = getcsq();
+ /*if(GlobalConfig::NetSignal <= -105 ){
+ gpio_set(130,1);
+ }else if(GlobalConfig::NetSignal > -105 ){
+ gpio_set(130,0);
+ }else{
+ gpio_set(130,1);
+ }*/
+ sleep(10);
+ //socketHeart(strJson.c_str());
}
}
+void GetCSQ()
+{
+#ifdef NR5G_MODULE
+ //5G
+ int iRet = -1;
+open5G:
+ iRet = dial.openPort("/dev/ttyUSB2");
+ if (iRet < 0){
+ sleep(5);
+ goto open5G;
+ }
+#ifdef NR5G_MEIGE
+ dial.closePort();
+ char szquectel[100]={0x00};
+ std::string strAPN = ReadStrByOpt(SERVERCONFIG, "Server", "APN");
+ sprintf(szquectel,"/opt/quectel-CM/Meig-CM -s %s &",strAPN.c_str());
+ system(szquectel);
+#else
+ dial.recvData();
+#endif
+#endif
+#ifdef Q4G_MODULE
+ //4G
+ int fd = -1;
+open4G:
+ fd = config_uart("/dev/ttyUSB2",115200);
+ if (fd < 0){
+ sleep(5);
+ goto open4G;
+ }
+ char szbuffer[200]={0x00};
+ int offSize = 0;
+ int timeoutflag = 0;
+ write_data(fd,"AT+QENG=\"servingcell\"\r\n",27);
+ while(1){
+ char buff[1024]={0x00};
+ int ret = read_data(fd, buff, 1024, 10);
+ if(ret <= 0){
+ timeoutflag ++;
+ if(timeoutflag > 5){
+ print_info("timeoutflag = %d\n",timeoutflag);
+ timeoutflag = 0;
+ const char *str2 = "+QENG: ";
+ char csq[128] = {0};
+ char *pdata = strstr((char*)szbuffer, str2);
+ if(pdata){
+ strncpy(csq, pdata+7, sizeof(csq));
+
+ //printf("SIM-CSQ: %s\n", csq);
+ GlobalConfig::NetStatus = GetOneContent(csq,1,",");
+ string signal = GetOneContent(csq,13,",");
+ GlobalConfig::NetSignal = atoi(signal.c_str());
+ GlobalConfig::NetType = GetOneContent(csq,2,",");
+ print_info("NetStatus = %s,NetSignal = %d\n",GlobalConfig::NetStatus.c_str(),GlobalConfig::NetSignal);
+
+ }
+ memset(szbuffer,0x00,sizeof(szbuffer));
+ offSize = 0;
+ write_data(fd,"AT+QENG=\"servingcell\"\r\n",27);
+ }
+ usleep(10000);
+ }else if(ret > 0){
+ print_info("ret = %d,buff = %s\n",ret,buff);
+ memcpy(szbuffer + offSize,buff,ret);
+ offSize = offSize + ret;
+ print_info("szbuffer = %s\n",szbuffer);
+ continue;
+ }
+ sleep(10);
+ }
+#endif
+}
+void Dial5G()
+{
+ sleep(2);
+dial5G:
+ if(dial.m_fd > 0){
+ dial.dial5G();
+ }else{
+ sleep(5);
+ goto dial5G;
+ }
+}
void UartStart()
{
// onReceiveUart cb = (onReceiveUart)&ProtoConvert::HandleFromUart;
// pUart->setCallBack(cb);
- pUart->InitUart();
+ InitGpio(GlobalConfig::GPIO_G.zigAckrep,0);//ACK
+ InitGpio(GlobalConfig::GPIO_G.zigAckreset,1);//ACK reset
+ InitGpio(GlobalConfig::GPIO_G.zigReset,1);//Zigbee reset
+ gpio_set(GlobalConfig::GPIO_G.zigAckreset,1);
+ gpio_set(GlobalConfig::GPIO_G.zigReset,1);
- while (GlobalConfig::QuitFlag_G) {
+#ifdef IMX6UL_GATEWAY
+ InitGpio(GlobalConfig::GPIO_G.errorLed,1);//指示灯
+ gpio_set(GlobalConfig::GPIO_G.errorLed,0);
+ InitGpio(GlobalConfig::GPIO_G.power,1);//power reset
+ gpio_set(GlobalConfig::GPIO_G.power,0);
+#endif
+#ifdef G2UL_GATEWAY
+ InitGpio(GlobalConfig::GPIO_G.runLed,1);
+ InitGpio(GlobalConfig::GPIO_G.errorLed,1);
+ gpio_set(GlobalConfig::GPIO_G.runLed,1);
+ gpio_set(GlobalConfig::GPIO_G.errorLed,0);
+ InitGpio(GlobalConfig::GPIO_G.netResetNet0,1);
+ gpio_set(GlobalConfig::GPIO_G.netResetNet0,0);
+#endif
+ GlobalConfig::Zigbee_G.Serial_Rate = 0x07;
+ GlobalConfig::Zigbee_G.Serial_DataB = 0x08;
+ GlobalConfig::Zigbee_G.Serial_StopB = 0x01;
+ pUart->InitUart(B115200);
+ char buffer[1100]={0x00};
+
+ sleep(1);
+ pUart->UartRecv(pUart->fd,1,buffer);
+ sleep(1);
- pUart->UpdateZigbeeInfoCtrl();
- pUart->ReadFromUart();
- pUart->Run();
-// pUart->Stop();
- boost::this_thread::sleep(boost::posix_time::milliseconds(10));
- }
}
+void InitModule()
+{
+#ifdef NR5G_MODULE
+#ifdef G2UL_GATEWAY
+ InitGpio(GlobalConfig::GPIO_G.commPower,1);//4G,5G模组供电,
+ gpio_set(GlobalConfig::GPIO_G.commPower,1);
+ InitGpio(GlobalConfig::GPIO_G.vol3_8,1);//5G 高电平3.8V,低电平3.3V
+ gpio_set(GlobalConfig::GPIO_G.vol3_8,1);
+
+ InitGpio(GlobalConfig::GPIO_G.commRest,1);
+ gpio_set(GlobalConfig::GPIO_G.commRest,0);//高电平复位
+#endif
+#ifdef IMX6UL_GATEWAY
+ InitGpio(GlobalConfig::GPIO_G.commRest,1);
+ gpio_set(GlobalConfig::GPIO_G.commRest,1);//
+#endif
+#endif
+#ifdef Q4G_MODULE
+#ifdef G2UL_GATEWAY
+ InitGpio(GlobalConfig::GPIO_G.commPower,1);//4G,5G模组供电,
+ gpio_set(GlobalConfig::GPIO_G.commPower,1);
+ InitGpio(GlobalConfig::GPIO_G.commRest,1);
+ gpio_set(GlobalConfig::GPIO_G.commRest,0);//高电平复位
+ sleep(10);
+ char szquectel[100]={0x00};
+ std::string strAPN = ReadStrByOpt(SERVERCONFIG, "Server", "APN");
+ sprintf(szquectel,"/opt/quectel-CM/quectel-CM -s %s &",strAPN.c_str());
+ system(szquectel);
+#endif
+#endif
+#ifdef WIFI_MODULE
+ print_info("Init WiFi!\n");
+
+#ifdef IMX6UL_GATEWAY
+ InitGpio(GlobalConfig::GPIO_G.wifiReset,1);//WiFi模组复位,0复位,1取消复位
+ gpio_set(GlobalConfig::GPIO_G.wifiReset,1);
+ sleep(10);
+ wifi::WPAClient wpa;
+ wpa.ReconnectWiFi();
+ system("/etc/init.d/wpa_restart");
+ system("udhcpc -i wlan2 &");
+#endif
+#ifdef G2UL_GATEWAY
+ InitGpio(GlobalConfig::GPIO_G.wifiReset,1);//WiFi模组复位,1复位,0取消复位
+ gpio_set(GlobalConfig::GPIO_G.wifiReset,0);
+ InitGpio(GlobalConfig::GPIO_G.wifiPower,1);//WiFi模组上电
+ gpio_set(GlobalConfig::GPIO_G.wifiPower,1);
+ sleep(10);
+ wifi::WPAClient wpa;
+ wpa.ReconnectWiFi();
+ system("/usr/sbin/wpa_supplicant -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf &");
+ system("udhcpc -b -i wlan0 &");
+#endif
+#endif
+}
+void TestUart()
+{
+ pUart->InitTestUart(B115200);
+ pUart->ReadTestUart();
+}
void UartStartWave()
{
pUart->DealWaveThread();
@@ -158,7 +701,15 @@ void StartUdpSys()
UdpSys *udpsys = UdpSys::instance();
udpsys->StartConnectSysUdp();
}
-
+void WatchDog()
+{
+ int fd = OpenWatchDog();
+ while(1){
+ WriteWatchDog(fd);
+ sleep(50);
+ }
+ close(fd);
+}
static const char* LOCAL_WILL_TOPIC = "up/uart/will";
void my_publish_callback(struct mosquitto *mosq, void *obj, int mid)
{
@@ -185,7 +736,7 @@ void my_connect_callback(struct mosquitto *mosq, void *obj, int result)
connect_time = strtoll(gwTime, NULL, 10);
print_debug("connect_time:%lld\n", connect_time);
long long difftime_ms = connect_time - connect_lost_time;
- //if (difftime_ms > 20*1000) { // 超过20秒,判定为连接断开
+ if (difftime_ms > 20*1000) { // 超过20秒,判定为连接断开
char reply_string[256] = {0};
std::string startStatus = "0";
if (access(SYSTEMSTART, 0) >= 0) {
@@ -199,20 +750,17 @@ void my_connect_callback(struct mosquitto *mosq, void *obj, int result)
Json::FastWriter fw;
jsData["cmd"] = "15";
jsData["dataNodeGatewayNo"] = GlobalConfig::MacAddr_G;
- // jsData["cmdBody"] = "";
std::string strCmd15 = fw.write(jsData);
- // data_publish(strCmd15.c_str(), GlobalConfig::Topic_G.mPubCmd.c_str());
std::string instr = std::string(reply_string);
std::string topic = "equipment/state/" + GlobalConfig::MacAddr_G;
int ret = data_publish(instr.c_str(), topic.c_str());
- system("echo 0 > /CIDW/start");
if (ret != MOSQ_ERR_SUCCESS) {
print_debug("Publish failed:%d, %s\n", ret, instr.c_str());
disconnect();
}
- //}
+ }
GlobalConfig::LinkStatus_G = 1;
print_debug("Connect to server success.\n");
@@ -250,8 +798,8 @@ void my_disconnect_callback(struct mosquitto *mosq, void *obj, int result)
{
int ret = 0;
ret = disconnect();
- // LOG_ERROR("The uart connection lost:%d\n", ret);
- print_debug("The uart connection lost\n");
+ //LOG_ERROR("The MQTT connection lost:%d\n", ret);
+ print_debug("The MQTT connection lost\n");
char gwTime[32] = { 0 };
GetTimeNet(gwTime, 0);
uptime = std::string(gwTime);
@@ -259,6 +807,41 @@ void my_disconnect_callback(struct mosquitto *mosq, void *obj, int result)
print_debug("connect_lost_time:%lld\n", connect_lost_time);
GlobalConfig::LinkStatus_G = 0;
GlobalConfig::LinkCount = GlobalConfig::LinkCount + 1;
+
+#ifdef WIFI_MODULE
+ char buf[128] = {0};
+ std::string wpa_state = "";
+#ifdef G2UL_GATEWAY
+ wpa_state = "/usr/sbin/wpa_cli status|grep wpa_state | cut -f 2 -d '='";
+#endif
+
+#ifdef IMX6UL_GATEWAY
+ wpa_state = "/opt/Cidn/wpa_cli status|grep wpa_state | cut -f 2 -d '='";
+#endif
+ system_custom(wpa_state.c_str(), buf);
+ std::string state = std::string(buf);
+ std::string RSSI_cmd = "";
+#ifdef G2UL_GATEWAY
+ RSSI_cmd = "/usr/sbin/wpa_cli signal_poll|grep RSSI | cut -f 2 -d '='";
+#endif
+#ifdef IMX6UL_GATEWAY
+ RSSI_cmd = "/opt/Cidn/wpa_cli signal_poll|grep RSSI | cut -f 2 -d '='";
+#endif
+ system_custom(RSSI_cmd.c_str(), buf);
+ std::string RSSI = std::string(buf);
+
+ int iRet = reconnect();
+ memset(buf, 0, sizeof(buf));
+ sprintf(buf, "wifi RSSI:%s,state:%s,MQTT reconnect :%d\n", RSSI.c_str(),state.c_str(),iRet);
+ //LOG_WARN(" %s\n",buf);
+ int status = Ping( GlobalConfig::ServerIP.c_str(), 10000);;
+ //LOG_WARN(" netStatus %d\n",status);
+ print_info("%s\n", buf);
+
+#else
+ int iRet = reconnect();
+#endif
+
}
void my_message_callback(struct mosquitto *mosq, void *obj, const struct mosquitto_message *message)
@@ -337,7 +920,7 @@ void StartMqttClient()
register_collback(my_connect_callback, my_message_callback, my_subscribe_callback, my_log_callback, my_disconnect_callback, my_publish_callback);
start_client(strEqupNo.c_str(), GlobalConfig::MacAddr_G.c_str(), GlobalConfig::ServerIP.c_str(), strVersion.c_str(), "11111111", salt);
}
- boost::this_thread::sleep(boost::posix_time::seconds(3));
+ sleep(3);
}
}
@@ -348,13 +931,14 @@ void SearchThread()
while (GlobalConfig::QuitFlag_G) {
if (GlobalConfig::IpAddr_G.length() > 0 && 0 != GlobalConfig::IpAddr_G.compare("0.0.0.0")) {
+ print_info("%s\n",runinfo.c_str());
boost::asio::io_service io_service;
SearchDev *searchDevObj = new SearchDev(io_service);
searchDevObj->MultiCastRecv();
io_service.run();
delete searchDevObj;
}
- boost::this_thread::sleep(boost::posix_time::seconds(5));
+ sleep(5);
print_error("SearchThred restart.\n");
}
}
diff --git a/threadfunc/SH_ThreadFunc.hpp b/threadfunc/SH_ThreadFunc.hpp
index 38a4e4b..8f35074 100644
--- a/threadfunc/SH_ThreadFunc.hpp
+++ b/threadfunc/SH_ThreadFunc.hpp
@@ -27,5 +27,11 @@ extern void RecvUpdateFile(); //更新升级包
extern void StartCgiServer(); //启动cgi处理服务端
extern void HeartRep();
extern void UartStart(); //
+extern void TestUart();
+extern void WatchDog();
extern void UartStartWave();
extern void StartUdpSys(); //组播通信
+extern void GetCSQ();
+extern void Dial5G();
+extern void InitModule();
+extern void RunLED();
diff --git a/uart/SH_Uart.cpp b/uart/SH_Uart.cpp
index 77a95ac..c4adf45 100644
--- a/uart/SH_Uart.cpp
+++ b/uart/SH_Uart.cpp
@@ -1,4 +1,10 @@
#include
+#include
+#include
+#include
+#include
+#include