Explorar el Código

增加电源控制

vothin hace 1 año
padre
commit
99174e84b8
Se han modificado 46 ficheros con 412 adiciones y 1520 borrados
  1. 1 0
      .cproject
  2. 2 2
      .settings/language.settings.xml
  3. BIN
      Release/libzkgui.so
  4. 1 1
      Release/makefile
  5. BIN
      Release/src/activity/callActivity.o
  6. 0 6
      Release/src/activity/deviceInfoActivity.d
  7. BIN
      Release/src/activity/deviceInfoActivity.o
  8. BIN
      Release/src/activity/functionActivity.o
  9. 0 6
      Release/src/activity/mainActivity.d
  10. BIN
      Release/src/activity/mainActivity.o
  11. BIN
      Release/src/activity/medicalCareActivity.o
  12. BIN
      Release/src/activity/moreActivity.o
  13. BIN
      Release/src/activity/navibar.o
  14. BIN
      Release/src/activity/promptActivity.o
  15. BIN
      Release/src/activity/settingActivity.o
  16. BIN
      Release/src/activity/sipTestActivity.o
  17. BIN
      Release/src/activity/startActivity.o
  18. BIN
      Release/src/activity/statusbar.o
  19. 0 6
      Release/src/activity/updateActivity.d
  20. BIN
      Release/src/activity/updateActivity.o
  21. 0 195
      Release/src/core/jhws.d
  22. BIN
      Release/src/core/jhws.o
  23. 0 3
      Release/src/core/subdir.mk
  24. BIN
      Release/src/core/update_assistant.o
  25. BIN
      Release/src/net/tcp_client.o
  26. BIN
      Release/src/net/tcp_model.o
  27. BIN
      Release/src/server/http_server.o
  28. BIN
      Release/src/service/BusinessConfig.o
  29. BIN
      Release/src/service/time.o
  30. BIN
      Release/src/uart/UartContext.o
  31. 2 0
      i18n/zh_CN.tr
  32. 17 0
      src/activity/functionActivity.cpp
  33. 5 0
      src/activity/functionActivity.h
  34. 0 102
      src/core/houseinfo.h
  35. 0 659
      src/core/jhws.cpp
  36. 0 133
      src/core/jhws.h
  37. 1 0
      src/logic/callLogic.cc
  38. 9 7
      src/logic/deviceInfoLogic.cc
  39. 42 3
      src/logic/functionLogic.cc
  40. 304 381
      src/logic/mainLogic.cc
  41. 10 6
      src/logic/navibar.cc
  42. 1 2
      src/logic/updateLogic.cc
  43. 2 1
      src/net/tcp_client.cpp
  44. 7 2
      src/net/tcp_model.cpp
  45. 8 5
      src/service/BusinessConfig.h
  46. BIN
      ui/function.ftu

+ 1 - 0
.cproject

@@ -161,4 +161,5 @@
 		</scannerConfigBuildInfo>
 	</storageModule>
 	<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
+	<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
 </cproject>

+ 2 - 2
.settings/language.settings.xml

@@ -5,7 +5,7 @@
 			<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
 			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
 			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
-			<provider class="com.flythings.ide.managedbuilder.CrossGCCBuiltinSpecsDetector" console="false" env-hash="1941340705933690604" id="flythings.managedbuild.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="Cross Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
+			<provider class="com.flythings.ide.managedbuilder.CrossGCCBuiltinSpecsDetector" console="false" env-hash="1359126561061538827" id="flythings.managedbuild.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="Cross Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
 				<language-scope id="org.eclipse.cdt.core.gcc"/>
 				<language-scope id="org.eclipse.cdt.core.g++"/>
 			</provider>
@@ -17,7 +17,7 @@
 			<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
 			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
 			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
-			<provider class="com.flythings.ide.managedbuilder.CrossGCCBuiltinSpecsDetector" console="false" env-hash="1941340705933690604" id="flythings.managedbuild.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="Cross Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
+			<provider class="com.flythings.ide.managedbuilder.CrossGCCBuiltinSpecsDetector" console="false" env-hash="1359126561061538827" id="flythings.managedbuild.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="Cross Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
 				<language-scope id="org.eclipse.cdt.core.gcc"/>
 				<language-scope id="org.eclipse.cdt.core.g++"/>
 			</provider>

BIN
Release/libzkgui.so


+ 1 - 1
Release/makefile

@@ -112,7 +112,7 @@ all: libzkgui.so
 # 工具调用
 libzkgui.so: $(OBJS) $(USER_OBJS)
 	@echo.exe 'Linking $@'
-	@arm-pc-linux-gnueabihf-gcc -s -Wl,-z,now -Wl,-z,relro -Wl,-z,defs -Wl,--warn-common -Wl,-z,combreloc -Wl,--warn-once -shared -o "libzkgui.so" $(OBJS) $(USER_OBJS) $(LIBS) $(DEPENDENCIES_LINK_FLAGS) 
+	@arm-pc-linux-gnueabihf-gcc -s -Wl,-z,now -Wl,-z,relro -Wl,-z,defs -Wl,--warn-common -Wl,-z,combreloc -Wl,--warn-once -shared -o "libzkgui.so" $(OBJS) $(USER_OBJS) $(LIBS) $(DEPENDENCIES_LINK_FLAGS) -Wl,-Bsymbolic 
 
 # 其他目标
 clean:

BIN
Release/src/activity/callActivity.o


+ 0 - 6
Release/src/activity/deviceInfoActivity.d

@@ -74,8 +74,6 @@ src/activity/deviceInfoActivity.o: ../src/activity/deviceInfoActivity.cpp \
  D:\MyProgram\C++\linux_door_2.0\src/net/net.h \
  D:\MyProgram\C++\linux_door_2.0\src/net/tcp_model.h \
  D:\MyProgram\C++\linux_door_2.0\src/net/tcp_model.h \
- D:\MyProgram\C++\linux_door_2.0\src/core/jhws.h \
- D:\MyProgram\C++\linux_door_2.0\src/core/houseinfo.h \
  D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/manager/LanguageManager.h \
  D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\zknet\0.0.0\include/net/NetUtils.h
 
@@ -229,10 +227,6 @@ D:\MyProgram\C++\linux_door_2.0\src/net/tcp_model.h:
 
 D:\MyProgram\C++\linux_door_2.0\src/net/tcp_model.h:
 
-D:\MyProgram\C++\linux_door_2.0\src/core/jhws.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/core/houseinfo.h:
-
 D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/manager/LanguageManager.h:
 
 D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\zknet\0.0.0\include/net/NetUtils.h:

BIN
Release/src/activity/deviceInfoActivity.o


BIN
Release/src/activity/functionActivity.o


+ 0 - 6
Release/src/activity/mainActivity.d

@@ -89,8 +89,6 @@ src/activity/mainActivity.o: ../src/activity/mainActivity.cpp \
  D:\MyProgram\C++\linux_door_2.0\src/base/http_response.h \
  D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/os/UpgradeMonitor.h \
  D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/os/MountMonitor.h \
- D:\MyProgram\C++\linux_door_2.0\src/core/jhws.h \
- D:\MyProgram\C++\linux_door_2.0\src/core/houseinfo.h \
  D:\MyProgram\C++\linux_door_2.0\src/core/update_assistant.h
 
 ../src/activity/mainActivity.h:
@@ -273,8 +271,4 @@ D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/os/UpgradeMon
 
 D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/os/MountMonitor.h:
 
-D:\MyProgram\C++\linux_door_2.0\src/core/jhws.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/core/houseinfo.h:
-
 D:\MyProgram\C++\linux_door_2.0\src/core/update_assistant.h:

BIN
Release/src/activity/mainActivity.o


BIN
Release/src/activity/medicalCareActivity.o


BIN
Release/src/activity/moreActivity.o


BIN
Release/src/activity/navibar.o


BIN
Release/src/activity/promptActivity.o


BIN
Release/src/activity/settingActivity.o


BIN
Release/src/activity/sipTestActivity.o


BIN
Release/src/activity/startActivity.o


BIN
Release/src/activity/statusbar.o


+ 0 - 6
Release/src/activity/updateActivity.d

@@ -88,8 +88,6 @@ src/activity/updateActivity.o: ../src/activity/updateActivity.cpp \
  D:\MyProgram\C++\linux_door_2.0\src/net/tcp_model.h \
  D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/os/UpgradeMonitor.h \
  D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/os/MountMonitor.h \
- D:\MyProgram\C++\linux_door_2.0\src/core/jhws.h \
- D:\MyProgram\C++\linux_door_2.0\src/core/houseinfo.h \
  D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/manager/LanguageManager.h
 
 ../src/activity/updateActivity.h:
@@ -270,8 +268,4 @@ D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/os/UpgradeMon
 
 D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/os/MountMonitor.h:
 
-D:\MyProgram\C++\linux_door_2.0\src/core/jhws.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/core/houseinfo.h:
-
 D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/manager/LanguageManager.h:

BIN
Release/src/activity/updateActivity.o


+ 0 - 195
Release/src/core/jhws.d

@@ -1,195 +0,0 @@
-src/core/jhws.o: ../src/core/jhws.cpp ../src/core/jhws.h \
- D:\MyProgram\C++\linux_door_2.0\src/core/houseinfo.h \
- D:\MyProgram\C++\linux_door_2.0\src/base/strings.hpp \
- D:\MyProgram\C++\linux_door_2.0\src/base/http_client.h \
- D:\MyProgram\C++\linux_door_2.0\src/base/http_request.h \
- D:\MyProgram\C++\linux_door_2.0\src/base/http_response.h \
- D:\MyProgram\C++\linux_door_2.0\src/curl/curl.h \
- D:\MyProgram\C++\linux_door_2.0\src/curl/curlver.h \
- D:\MyProgram\C++\linux_door_2.0\src/curl/curlbuild.h \
- D:\MyProgram\C++\linux_door_2.0\src/curl/curlrules.h \
- D:\MyProgram\C++\linux_door_2.0\src/curl/easy.h \
- D:\MyProgram\C++\linux_door_2.0\src/curl/multi.h \
- D:\MyProgram\C++\linux_door_2.0\src/curl/curl.h \
- D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/system/Thread.h \
- D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/system/Mutex.h \
- D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/system/Condition.h \
- D:\MyProgram\C++\linux_door_2.0\src/base/json_object.h \
- D:\MyProgram\C++\linux_door_2.0\src/base/json_array.h \
- D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/document.h \
- D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/reader.h \
- D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/allocators.h \
- D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/rapidjson.h \
- D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/stream.h \
- D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/encodings.h \
- D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/encodedstream.h \
- D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/memorystream.h \
- D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/internal/meta.h \
- d:\myprogram\c++\linux_door_2.0\src\base\rapidjson\rapidjson.h \
- D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/internal/stack.h \
- d:\myprogram\c++\linux_door_2.0\src\base\rapidjson\allocators.h \
- D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/internal/swap.h \
- D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/internal/strtod.h \
- D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/internal/ieee754.h \
- D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/internal/biginteger.h \
- D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/internal/diyfp.h \
- D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/internal/pow10.h \
- D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/error/error.h \
- d:\myprogram\c++\linux_door_2.0\src\base\rapidjson\rapidjson.h \
- D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/internal/strfunc.h \
- d:\myprogram\c++\linux_door_2.0\src\base\rapidjson\stream.h \
- d:\myprogram\c++\linux_door_2.0\src\base\rapidjson\rapidjson.h \
- D:\MyProgram\C++\linux_door_2.0\src/base/json_object.h \
- D:\MyProgram\C++\linux_door_2.0\src/base/base.hpp \
- D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/json/json.h \
- D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/json/autolink.h \
- D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/json/config.h \
- D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/json/version.h \
- D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/json/value.h \
- D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/json/forwards.h \
- D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/json/reader.h \
- D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/json/features.h \
- D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/json/writer.h \
- D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/utils/Log.h \
- D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\log\0.0.0\include/android/log.h \
- D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/storage/StoragePreferences.h \
- ../src/core/sip_config.h \
- D:\MyProgram\C++\linux_door_2.0\src/core/urlencode.h \
- D:\MyProgram\C++\linux_door_2.0\src/core/utilities.h \
- D:\MyProgram\C++\linux_door_2.0\src\dependencies\include/telephone.h \
- D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\audio-utility\0.1.6\include/acoustic_echo_cancellater.h \
- D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\audio-utility\0.1.6\include/audio_process_chain.h \
- D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\display_utility\0.1.1\include/video_display_utility.h \
- D:\MyProgram\C++\linux_door_2.0\src/core/sip_config.h \
- D:\MyProgram\C++\linux_door_2.0\src/base/prefs.hpp \
- D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/json/Json.h
-
-../src/core/jhws.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/core/houseinfo.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/base/strings.hpp:
-
-D:\MyProgram\C++\linux_door_2.0\src/base/http_client.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/base/http_request.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/base/http_response.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/curl/curl.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/curl/curlver.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/curl/curlbuild.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/curl/curlrules.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/curl/easy.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/curl/multi.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/curl/curl.h:
-
-D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/system/Thread.h:
-
-D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/system/Mutex.h:
-
-D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/system/Condition.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/base/json_object.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/base/json_array.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/document.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/reader.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/allocators.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/rapidjson.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/stream.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/encodings.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/encodedstream.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/memorystream.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/internal/meta.h:
-
-d:\myprogram\c++\linux_door_2.0\src\base\rapidjson\rapidjson.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/internal/stack.h:
-
-d:\myprogram\c++\linux_door_2.0\src\base\rapidjson\allocators.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/internal/swap.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/internal/strtod.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/internal/ieee754.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/internal/biginteger.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/internal/diyfp.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/internal/pow10.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/error/error.h:
-
-d:\myprogram\c++\linux_door_2.0\src\base\rapidjson\rapidjson.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/base/rapidjson/internal/strfunc.h:
-
-d:\myprogram\c++\linux_door_2.0\src\base\rapidjson\stream.h:
-
-d:\myprogram\c++\linux_door_2.0\src\base\rapidjson\rapidjson.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/base/json_object.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/base/base.hpp:
-
-D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/json/json.h:
-
-D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/json/autolink.h:
-
-D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/json/config.h:
-
-D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/json/version.h:
-
-D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/json/value.h:
-
-D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/json/forwards.h:
-
-D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/json/reader.h:
-
-D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/json/features.h:
-
-D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/json/writer.h:
-
-D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/utils/Log.h:
-
-D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\log\0.0.0\include/android/log.h:
-
-D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/storage/StoragePreferences.h:
-
-../src/core/sip_config.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/core/urlencode.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/core/utilities.h:
-
-D:\MyProgram\C++\linux_door_2.0\src\dependencies\include/telephone.h:
-
-D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\audio-utility\0.1.6\include/acoustic_echo_cancellater.h:
-
-D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\audio-utility\0.1.6\include/audio_process_chain.h:
-
-D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\display_utility\0.1.1\include/video_display_utility.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/core/sip_config.h:
-
-D:\MyProgram\C++\linux_door_2.0\src/base/prefs.hpp:
-
-D:\zkswe\FlyThingsPreview\bin\.dep\public\z21\easyui\0.0.0\include/json/Json.h:

BIN
Release/src/core/jhws.o


+ 0 - 3
Release/src/core/subdir.mk

@@ -5,7 +5,6 @@
 # Add inputs and outputs from these tool invocations to the build variables 
 CPP_SRCS += \
 ../src/core/WeatherManager.cpp \
-../src/core/jhws.cpp \
 ../src/core/net.cpp \
 ../src/core/netspeed.cpp \
 ../src/core/ntp.cpp \
@@ -16,7 +15,6 @@ CPP_SRCS += \
 
 OBJS += \
 ./src/core/WeatherManager.o \
-./src/core/jhws.o \
 ./src/core/net.o \
 ./src/core/netspeed.o \
 ./src/core/ntp.o \
@@ -27,7 +25,6 @@ OBJS += \
 
 CPP_DEPS += \
 ./src/core/WeatherManager.d \
-./src/core/jhws.d \
 ./src/core/net.d \
 ./src/core/netspeed.d \
 ./src/core/ntp.d \

BIN
Release/src/core/update_assistant.o


BIN
Release/src/net/tcp_client.o


BIN
Release/src/net/tcp_model.o


BIN
Release/src/server/http_server.o


BIN
Release/src/service/BusinessConfig.o


BIN
Release/src/service/time.o


BIN
Release/src/uart/UartContext.o


+ 2 - 0
i18n/zh_CN.tr

@@ -84,6 +84,8 @@
     <string name="PostitionedMsg">已定位当前位置:</string>
     <string name="RoomPatrolMsg">已巡房:</string>
 	<string name="PromptQuit">提示语已结束</string>
+    <string name="RebootDevice">重启本机</string>
+    <string name="RebootPower">重启线路电源</string>
     <!-- 医护界面 -->
     <string name="MedicalLoginMsg">请输入正确的密码,进入医护功能</string>
     <string name="InputMedicalPassword">输入密码进入医护</string>

+ 17 - 0
src/activity/functionActivity.cpp

@@ -4,6 +4,11 @@
 #include "functionActivity.h"
 
 /*TAG:GlobalVariable全局变量*/
+static ZKButton* mRebootDeviceButtonPtr;
+static ZKButton* mRebootPowerButtonPtr;
+static ZKTextView* mRebootDeviceTextViewPtr;
+static ZKTextView* mRebootPowerTextViewPtr;
+static ZKWindow* mRebootWindowPtr;
 static ZKButton* mServerCancelButtonPtr;
 static ZKButton* mServerConfirmButtonPtr;
 static ZKTextView* mServerPromptTextViewPtr;
@@ -76,6 +81,8 @@ typedef struct {
 
 /*TAG:ButtonCallbackTab按键映射表*/
 static S_ButtonCallback sButtonCallbackTab[] = {
+    ID_FUNCTION_RebootDeviceButton, onButtonClick_RebootDeviceButton,
+    ID_FUNCTION_RebootPowerButton, onButtonClick_RebootPowerButton,
     ID_FUNCTION_ServerCancelButton, onButtonClick_ServerCancelButton,
     ID_FUNCTION_ServerConfirmButton, onButtonClick_ServerConfirmButton,
     ID_FUNCTION_PwdBackButton, onButtonClick_PwdBackButton,
@@ -162,6 +169,11 @@ functionActivity::~functionActivity() {
     unregisterProtocolDataUpdateListener(onProtocolDataUpdate);
     onUI_quit();
     mActivityPtr = NULL;
+    mRebootDeviceButtonPtr = NULL;
+    mRebootPowerButtonPtr = NULL;
+    mRebootDeviceTextViewPtr = NULL;
+    mRebootPowerTextViewPtr = NULL;
+    mRebootWindowPtr = NULL;
     mServerCancelButtonPtr = NULL;
     mServerConfirmButtonPtr = NULL;
     mServerPromptTextViewPtr = NULL;
@@ -206,6 +218,11 @@ const char* functionActivity::getAppName() const{
 //TAG:onCreate
 void functionActivity::onCreate() {
 	Activity::onCreate();
+    mRebootDeviceButtonPtr = (ZKButton*)findControlByID(ID_FUNCTION_RebootDeviceButton);
+    mRebootPowerButtonPtr = (ZKButton*)findControlByID(ID_FUNCTION_RebootPowerButton);
+    mRebootDeviceTextViewPtr = (ZKTextView*)findControlByID(ID_FUNCTION_RebootDeviceTextView);
+    mRebootPowerTextViewPtr = (ZKTextView*)findControlByID(ID_FUNCTION_RebootPowerTextView);
+    mRebootWindowPtr = (ZKWindow*)findControlByID(ID_FUNCTION_RebootWindow);
     mServerCancelButtonPtr = (ZKButton*)findControlByID(ID_FUNCTION_ServerCancelButton);
     mServerConfirmButtonPtr = (ZKButton*)findControlByID(ID_FUNCTION_ServerConfirmButton);
     mServerPromptTextViewPtr = (ZKTextView*)findControlByID(ID_FUNCTION_ServerPromptTextView);

+ 5 - 0
src/activity/functionActivity.h

@@ -27,6 +27,11 @@
 #include "window/ZKSlideWindow.h"
 
 /*TAG:Macro宏ID*/
+#define ID_FUNCTION_RebootDeviceButton    20012
+#define ID_FUNCTION_RebootPowerButton    20011
+#define ID_FUNCTION_RebootDeviceTextView    50011
+#define ID_FUNCTION_RebootPowerTextView    50012
+#define ID_FUNCTION_RebootWindow    110007
 #define ID_FUNCTION_ServerCancelButton    20010
 #define ID_FUNCTION_ServerConfirmButton    20009
 #define ID_FUNCTION_ServerPromptTextView    50009

+ 0 - 102
src/core/houseinfo.h

@@ -1,102 +0,0 @@
-/*
- * houseinfo.h
- *
- *  Created on: 2022年5月27日
- *      Author: dingxy
- */
-
-#ifndef JNI_CORE_HOUSEINFO_H_
-#define JNI_CORE_HOUSEINFO_H_
-
-#include "base/strings.hpp"
-
-namespace j {
-
-	struct house_setting{
-
-		  std::string UserID;
-		  std::string UserPassword;
-
-		  std::string Token;
-
-		  std::string code;
-		  std::string name;
-
-		  std::string replace;
-
-		  std::string password;
-
-		  std::string community;
-		  std::string communityId;
-		  int communitycode;
-
-		  std::string area;
-		  std::string areaId;
-		  int areacode;
-
-		  std::string build;
-		  std::string buildId;
-		  int buildcode;
-
-		  std::string unit;
-		  std::string unitId;
-		  int unitcode;
-
-		  std::string floor;
-		  std::string floorId;
-		  int floorcode;
-
-		  std::string room;
-		  std::string roomId;
-		  int roomcode;
-
-	public:
-		  house_setting() {
-
-			code = "";
-			name = "";
-
-			replace = "false";
-
-			password = "";
-
-			community = "";
-			communityId = "";
-			communitycode = 0;
-
-			area = "";
-			areaId = "";
-			areacode = 0;
-
-			build = "";
-			buildId = "";
-			buildcode = 0;
-
-			unit = "";
-			unitId = "";
-			unitcode = 0;
-
-			floor = "";
-			floorId = "";
-			floorcode = 0;
-
-			room = "";
-		    roomId = "";
-		    roomcode = 0;
-	  }
-	  std::string ToAddressString() const {
-		  return base::format("%s %s %s层 %s室", build.c_str(), unit.c_str(), floor.c_str(), room.c_str());
-      }
-	  std::string ToWuyeString() const {
-		  return base::format("MN-%d-0-0-0-0-1", communitycode);
-	  }
-	  std::string ToUserString() const {
-		  return base::format("RM-%d-%d-%d-%d-%d-%d", communitycode, areacode, buildcode, unitcode, floorcode, roomcode);
-	  }
-	  std::string ToDoorPartString() const {
-		  return base::format("OD-%d-%d-%d-%d-0-", communitycode, areacode, buildcode, unitcode);
-	  }
-	};
-};
-
-#endif /* JNI_CORE_HOUSEINFO_H_ */

+ 0 - 659
src/core/jhws.cpp

@@ -1,659 +0,0 @@
-/*
- * jhws.cpp
- *
- *  Created on: 2022年4月22日
- *      Author: pengzc
- */
-
-#include "jhws.h"
-#include "base/http_client.h"
-#include "base/json_object.h"
-#include "base/base.hpp"
-
-#include "json/json.h"
-
-#include "core/houseinfo.h"
-
-#include "utils/Log.h"
-
-#include <list>
-#include <vector>
-#include <iterator>
-#include <stdlib.h>
-
-#include "storage/StoragePreferences.h"
-#include "sip_config.h"
-
-#include "core/urlencode.h"
-#include "core/utilities.h"
-
-namespace jhws {
-
-	const char* kBaseUrl = "http://wuye.jhws.top";
-	const char* bearer = "bearer ";
-	std::string authorization = StoragePreferences::getString(SIP_JHWS_TOKEN, "");
-
-	int ErrorInfo(base::HttpResponse response) {
-		Json::Reader reader;
-		Json::Value root;
-		LOGD("连接失败");
-		LOGD("返回体:%s",response.Body().c_str());
-		LOGD("状态码:%d", response.StatusCode());
-		LOGD("错误码:%d", response.ErrorCode());
-		LOGD("错误信息:%s", response.ErrorMessage().c_str());
-		LOGD("http信息:%s", response.ToString().c_str());
-		reader.parse(response.Body(), root);
-		if(response.StatusCode() == 0 && response.ErrorCode() == 28) {
-			return 1;
-		}
-		if(response.StatusCode() == 400 && response.ErrorCode() == 0) {
-			if(root["code"].asInt() == 400)
-			{
-				return -1;
-			}
-			return root["code"].asInt();
-		}
-		if(response.StatusCode() == 401 && response.ErrorCode() == 0 && root["code"].asInt() == 1001) {
-			return 4;
-		}
-
-		return 2;
-	}
-
-//	int ErrorJson(base::HttpResponse response) {
-//		Json::Reader reader;
-//		Json::Value root;
-//
-//		if(!reader.parse(response.Body(), root)) {
-//			LOGD("解析错误不是Json格式!");
-//			return 2;
-//		}
-//
-//		if(!root.isMember("data") || root["data"][0].isNull() || !root["data"].isArray()) {
-//			LOGD("解析数据体:%s", root.toStyledString().c_str());
-//			return 3;
-//		}
-//		return 2;
-//	}
-
-	int GetToken(const std::string& id, const std::string& secret, const std::string& encrypted, j::house_setting* profile) {
-
-		base::HttpClient client;
-		base::HttpRequest req("GET", std::string(kBaseUrl) + "/api/client/anon/client_token", "");
-
-		req.AppendHeader("client_id", id);
-		req.AppendHeader("client_secret", secret);
-		req.AppendHeader("encrypted", encrypted);
-
-		client.SetConnectionTimeout(2000);
-		client.SetTimeout(3000);
-		base::HttpResponse response = client.Do(req);
-
-		Json::Reader reader;
-		Json::Value root;
-
-		//判断返回是否正确
-		if(response.StatusCode() != 200) {
-			return ErrorInfo(response);
-		}
-		//判断是否为Json格式
-		if(!reader.parse(response.Body(), root)) {
-			LOGD("解析错误不是Json格式!");
-			return 2;
-		}
-
-		if(!root.isMember("data")){
-			return 2;
-		}
-
-		std::string accessToken;
-		accessToken = root["data"]["accessToken"].asString();
-		profile->Token = bearer + std::string(accessToken);
-		authorization = profile->Token;
-//		StoragePreferences::putString(SIP_JHWS_TOKEN, profile->Token);
-
-		return 0;
-	}
-
-	int GetCommunities(jhws::CommunityList& list, j::house_setting* profile) {
-
-		if(authorization == ""){
-			int j = GetToken("778558024368394240", "d1330c96195c3b7b653cd60bb0ea5ded", "false", profile);
-			if(j == 1) return 1;
-		}
-
-//		LOGD("author: %s", authorization.c_str());
-
-		std::string paramurl;
-
-		encodeUrl(profile->name, paramurl);
-
-		paramurl = "?code=" + std::string(profile->code) + "&name=" + std::string(paramurl);
-
-//		LOGD("paramurl: %s", paramurl.c_str());
-
-		base::HttpClient client;
-
-		base::HttpRequest req("GET", std::string(kBaseUrl) + "/api/community/grant/communitys" + std::string(paramurl), "");
-		req.AppendHeader("Authorization", authorization);
-
-		client.SetConnectionTimeout(2000);
-		client.SetTimeout(3000);
-
-		base::HttpResponse response = client.Do(req);
-
-		if(response.StatusCode() != 200) {
-			return ErrorInfo(response);
-		}
-
-		Json::Reader reader;
-		Json::Value root;
-
-		jhws::Community s;
-
-		if(!reader.parse(response.Body(), root)) {
-			LOGD("解析错误不是Json格式!");
-			return 2;
-		}
-
-		if(!root.isMember("data") || root["data"][0].isNull() || !root["data"].isArray()) {
-			LOGD("解析数据体:%s", root.toStyledString().c_str());
-			return 3;
-		}
-
-		for(unsigned int i = 0; i < root["data"].size(); i++) {
-			s.code = root["data"][i]["code"].asInt();
-			s.name = root["data"][i]["name"].asString();
-			s.communityId = root["data"][i]["id"].asString();
-			list.push_back(s);
-		}
-
-		return 0;
-	}
-
-	int GetAreas(jhws::AreaList& list, j::house_setting* profile) {
-
-		std::string Paramurl;
-
-		std::string communityId = profile->communityId;
-//		LOGD("Area这里:%s", communityId.c_str());
-
-		base::HttpClient client;
-
-		base::HttpRequest req("GET", std::string(kBaseUrl) + "/api/houseinfo/grant/area/"+std::string(communityId)+"/areas", "");
-		req.AppendHeader("Authorization", authorization);
-
-		client.SetConnectionTimeout(2000);
-		client.SetTimeout(3000);
-
-		base::HttpResponse response = client.Do(req);
-
-		if(response.StatusCode() != 200) {
-			return ErrorInfo(response);
-		}
-
-		Json::Reader reader;
-		Json::Value root;
-
-		jhws::Area s;
-
-		if(!reader.parse(response.Body(), root)) {
-			LOGD("解析错误不是Json格式!");
-			return 2;
-		}
-		if(!root.isMember("data") || root["data"][0].isNull()) {
-			return 3;
-		}
-
-		for(unsigned int i = 0; i < root["data"].size(); i++) {
-			s.code = root["data"][i]["code"].asInt();
-			s.name = root["data"][i]["name"].asString();
-			s.areaId = root["data"][i]["id"].asString();
-			list.push_back(s);
-		}
-
-		return 0;
-	}
-
-	int GetBuildings(BuildingList& list, j::house_setting* profile) {
-
-		std::string Paramurl;
-
-		std::string areaId = profile->areaId;
-//		LOGD("build这里:%s", areaId.c_str());
-
-		base::HttpClient client;
-		base::HttpRequest req("GET", std::string(kBaseUrl) + "/api/houseinfo/grant/building/"+std::string(areaId)+"/buildings", "");
-
-		req.AppendHeader("Authorization", authorization);
-		client.SetConnectionTimeout(2000);
-		client.SetTimeout(3000);
-
-		base::HttpResponse response = client.Do(req);
-
-//		LOGD("得到的数据:%s", response.Body().c_str());
-
-		if(response.StatusCode() != 200) {
-			return ErrorInfo(response);
-		}
-
-		Json::Reader reader;
-		Json::Value root;
-
-		jhws::Building s;
-
-		if(!reader.parse(response.Body(), root)) {
-			LOGD("解析错误不是Json格式!");
-			return 2;
-		}
-		if(!root.isMember("data") || root["data"][0].isNull()) {
-			return 3;
-		}
-
-		for(unsigned int i = 0; i < root["data"].size(); i++) {
-			s.code = root["data"][i]["code"].asInt();
-			s.name = root["data"][i]["name"].asString();
-			s.buildId = root["data"][i]["id"].asString();
-			list.push_back(s);
-		}
-
-		return 0;
-	}
-
-	int GetUnits(UnitList& list, j::house_setting* profile) {
-
-		std::string buildId = profile->buildId;
-
-		base::HttpClient client;
-		base::HttpRequest req("GET", std::string(kBaseUrl) + "/api/houseinfo/grant/unit/"+std::string(buildId)+"/units", "");
-
-		req.AppendHeader("Authorization", authorization);
-
-		client.SetConnectionTimeout(2000);
-		client.SetTimeout(3000);
-
-		base::HttpResponse response = client.Do(req);
-
-//		LOGD("得到的数据:%s", response.Body().c_str());
-
-		if(response.StatusCode() != 200) {
-			return ErrorInfo(response);
-		}
-
-		Json::Reader reader;
-		Json::Value root;
-
-		jhws::Unit s;
-
-		if(!reader.parse(response.Body(), root)) {
-			LOGD("解析错误不是Json格式!");
-			return 2;
-		}
-		if(!root.isMember("data") || root["data"][0].isNull()) {
-			return 3;
-		}
-
-		for(unsigned int i = 0; i < root["data"].size(); i++) {
-			s.code = root["data"][i]["code"].asInt();
-			s.name = root["data"][i]["name"].asString();
-			s.unitId = root["data"][i]["id"].asString();
-			list.push_back(s);
-		}
-
-		return 0;
-	}
-
-	int GetFloors(FloorList& list, j::house_setting* profile) {
-
-		std::string unitId = profile->unitId;
-
-		base::HttpClient client;
-		base::HttpRequest req("GET", std::string(kBaseUrl) + "/api/houseinfo/grant/floor/"+std::string(unitId)+"/floors", "");
-
-		req.AppendHeader("Authorization", authorization);
-
-		client.SetConnectionTimeout(2000);
-		client.SetTimeout(3000);
-
-		base::HttpResponse response = client.Do(req);
-
-//		LOGD("得到的数据:%s", response.Body().c_str());
-
-		if(response.StatusCode() != 200) {
-			return ErrorInfo(response);
-		}
-
-		Json::Reader reader;
-		Json::Value root;
-
-		jhws::Floor s;
-
-		if(!reader.parse(response.Body(), root)) {
-			LOGD("解析错误不是Json格式!");
-			return 2;
-		}
-		if(!root.isMember("data") || root["data"][0].isNull()) {
-			return 3;
-		}
-
-		for(unsigned int i = 0; i < root["data"].size(); i++) {
-			s.code = root["data"][i]["code"].asInt();
-			s.name = root["data"][i]["name"].asString();
-			s.floorId = root["data"][i]["id"].asString();
-			list.push_back(s);
-		}
-
-		return 0;
-	}
-
-	int GetRooms(RoomList& list, j::house_setting* profile) {
-
-		std::string floorId = profile->floorId;
-
-		base::HttpClient client;
-		base::HttpRequest req("GET", std::string(kBaseUrl) + "/api/houseinfo/grant/room/"+std::string(floorId)+"/rooms", "");
-
-		req.AppendHeader("Authorization", authorization);
-
-		client.SetConnectionTimeout(2000);
-		client.SetTimeout(3000);
-
-		base::HttpResponse response = client.Do(req);
-
-//		LOGD("得到的数据:%s", response.Body().c_str());
-
-		if(response.StatusCode() != 200) {
-			return ErrorInfo(response);
-		}
-
-		Json::Reader reader;
-		Json::Value root;
-
-		jhws::Room s;
-
-		if(!reader.parse(response.Body(), root)) {
-			LOGD("解析错误不是Json格式!");
-			return 2;
-		}
-		if(!root.isMember("data") || root["data"][0].isNull()) {
-			return 3;
-		}
-
-		for(unsigned int i = 0; i < root["data"].size(); i++) {
-			s.code = root["data"][i]["code"].asInt();
-			s.name = root["data"][i]["name"].asString();
-			s.roomId = root["data"][i]["id"].asString();
-			list.push_back(s);
-		}
-
-		return 0;
-	}
-
-	int BindDevice(j::house_setting* profile) {
-
-		Json::Value body;
-		Json::FastWriter writer;
-
-		body["uid"] = GetDeviceUid();
-		body["versionNumber"] = StoragePreferences::getString(JHWS_VERSION_NUMBER, to_string(GetVersionNo()));
-		body["type"] = "indoor";
-		body["hardwareType"] = "linux";
-		body["communityId"] = profile->communityId;
-		body["areaId"] = profile->areaId;
-		body["buildingId"] = profile->buildId;
-		body["unitId"] = profile->unitId;
-		body["floorId"] = profile->floorId;
-		body["roomId"] = profile->roomId;
-		body["password"] = profile->password;
-
-		writer.write(body);
-
-		LOGD("body: %s", body.toStyledString().c_str());
-
-		base::HttpClient client;
-		base::HttpRequest req("POST", std::string(kBaseUrl) + "/api/device/grant/" + std::string(profile->replace), body.toStyledString());
-
-		req.AppendHeader("Authorization", authorization);
-		req.ContentType("application/json");
-
-		client.SetConnectionTimeout(2000);
-		client.SetTimeout(3000);
-
-		base::HttpResponse response = client.Do(req);
-
-		Json::Reader reader;
-		Json::Value root;
-
-		if(response.StatusCode() != 200) {
-			return ErrorInfo(response);
-		}
-
-		if(!reader.parse(response.Body(), root)) {
-			LOGD("解析错误不是Json格式!");
-			return 2;
-		}
-
-		//LOGD("收到返回信息:%s", response.Body().c_str());
-
-		if(!root.isMember("code") && root["code"].isNull()) {
-			return 3;
-		}
-
-		return 0;
-	}
-
-	int GetDevice(DeviceList& list, j::house_setting* profile) {
-
-		std::string paramurl;
-		std::string type = "indoor";
-
-		paramurl = "?type=" + std::string(type) + "&communityId=" + std::string(profile->communityId) + "&unitId=" + std::string(profile->unitId);
-
-		base::HttpClient client;
-		base::HttpRequest req("GET", std::string(kBaseUrl) + "/api/device/grant/gates" + std::string(paramurl), "");
-
-		req.AppendHeader("Authorization", authorization);
-
-		client.SetConnectionTimeout(2000);
-		client.SetTimeout(3000);
-
-		base::HttpResponse response = client.Do(req);
-
-		Json::Reader reader;
-		Json::Value root;
-
-		jhws::Device s;
-
-		if(response.StatusCode() != 200) {
-			return ErrorInfo(response);
-		}
-
-		if(!reader.parse(response.Body(), root)) {
-			LOGD("解析错误不是Json格式!");
-			LOGD("解析错误不是Json格式!%s", response.Body().c_str());
-			return 2;
-		}
-
-		if(!root.isMember("data") || root["data"][0].isNull() || !root["data"].isArray()) {
-			return 3;
-		}
-
-		for(unsigned int i = 0; i < root["data"].size(); i++) {
-			if(root["data"][i]["type"].asString() == "outdoor") {
-				s.type = root["data"][i]["type"].asString();
-				s.deviceNumber = root["data"][i]["deviceNumber"].asString();
-				s.areaname = root["data"][i]["areaName"].asString();
-				s.buildname = root["data"][i]["buildingName"].asString();
-				s.unitname = root["data"][i]["unitName"].asString();
-				s.communitycode = root["data"][i]["communityCode"].asInt();
-				s.areacode = root["data"][i]["areaCode"].asInt();
-				s.buildcode = root["data"][i]["buildingCode"].asInt();
-				s.unitcode = root["data"][i]["unitCode"].asInt();
-				list.push_back(s);
-			} else if(root["data"][i]["type"].asString() == "wall") {
-				s.type = root["data"][i]["type"].asString();
-				s.deviceNumber = root["data"][i]["deviceNumber"].asString();
-				s.areaname = root["data"][i]["areaName"].asString();
-				s.communitycode = root["data"][i]["communityCode"].asInt();
-				s.areacode = root["data"][i]["areaCode"].asInt();
-				list.push_back(s);
-			}
-		}
-		return 0;
-	}
-
-	int GetUpdate(Update& list) {
-
-		std::string paramurl;
-
-		std::string uid = GetDeviceUid();
-//		LOGD("deviceuid: %s", uid.c_str());
-		std::string communityId = StoragePreferences::getString(SIP_JHWS_COMMUNITYID, "");
-		std::string roomId = StoragePreferences::getString(SIP_JHWS_ROOMID, "");
-
-		paramurl = "?uid="+ std::string(uid) + "&deviceType=indoor&communityId=" + std::string(communityId) + "&roomId=" + std::string(roomId);
-
-//		LOGD("updateTime: %s", roomId.c_str());
-
-		base::HttpClient client;
-		base::HttpRequest req("GET", std::string(kBaseUrl) + "/api/update/grant" + std::string(paramurl), "");
-
-		req.AppendHeader("Authorization", authorization);
-
-		client.SetConnectionTimeout(2000);
-		client.SetTimeout(3000);
-
-		base::HttpResponse response = client.Do(req);
-
-		Json::Reader reader;
-		Json::Value root;
-
-		if(response.StatusCode() != 200) {
-			return ErrorInfo(response);
-		}
-
-		if(!reader.parse(response.Body(), root)) {
-			LOGD("解析错误不是Json格式!%s", response.Body().c_str());
-			return 2;
-		}
-
-		if(!root.isMember("data") || root["data"].isNull()) {
-			return 3;
-		}
-
-		long long num1 = (long long)root["data"]["device"].asDouble();
-		long long num2 = (long long)root["data"]["notice"].asDouble();
-		list.device = to_string(num1);
-		list.notice = to_string(num2);
-
-//		LOGD("---------1---------");
-		return 0;
-	}
-
-
-	int GetMessage(MessageList& list) {
-
-//		LOGD("---------2---------");
-		std::string paramurl;
-
-		std::string communityId = StoragePreferences::getString(SIP_JHWS_COMMUNITYID, "");
-		std::string roomId = StoragePreferences::getString(SIP_JHWS_ROOMID, "");
-		std::string updateTime = StoragePreferences::getString(SIP_JHWS_UPDATETIME, "0");
-//		std::string updateTime = "0";
-
-		paramurl = "?communityId=" + std::string(communityId) + "&roomId=" + std::string(roomId) + "&updateTime=" + std::string(updateTime);
-
-//		LOGD("updateTime: %s", updateTime.c_str());
-
-		base::HttpClient client;
-		base::HttpRequest req("GET", std::string(kBaseUrl) + "/api/notice/grant/notices" + std::string(paramurl), "");
-
-		req.AppendHeader("Authorization", authorization);
-
-		client.SetConnectionTimeout(2000);
-		client.SetTimeout(3000);
-
-		base::HttpResponse response = client.Do(req);
-
-		Json::Reader reader;
-		Json::Value root;
-
-		jhws::Message s;
-
-		if(response.StatusCode() != 200) {
-			return ErrorInfo(response);
-		}
-
-		if(!reader.parse(response.Body(), root)) {
-			LOGD("解析错误不是Json格式!%s", response.Body().c_str());
-			return 2;
-		}
-
-		if(!root.isMember("data") || root["data"][0].isNull() || !root["data"].isArray()) {
-			return 3;
-		}
-
-		for(unsigned int i = 0; i < root["data"].size(); i++) {
-			s.content = root["data"][i]["content"].asString();
-			s.title = root["data"][i]["title"].asString();
-			long long num = (long long)root["data"][i]["updateTime"].asDouble();
-			s.updateTime = to_string(num);
-			list.push_back(s);
-		}
-		StoragePreferences::putString(SIP_JHWS_UPDATETIME, list.back().updateTime);
-
-//		LOGD("---------3---------");
-
-		return 0;
-	}
-
-	int Alarm(j::house_setting* profile) {
-
-		std::string paramurl;
-		std::string type = "indoor";
-
-		paramurl = "?type=" + std::string(type) + "&communityId=" + std::string(profile->communityId) + "&roomId=" + std::string(profile->roomId);
-
-		base::HttpClient client;
-		base::HttpRequest req("POST", std::string(kBaseUrl) + "/api/alarm/grant" + std::string(paramurl), "");
-
-		req.AppendHeader("Authorization", authorization);
-
-		client.SetConnectionTimeout(2000);
-		client.SetTimeout(3000);
-
-		base::HttpResponse response = client.Do(req);
-
-		Json::Reader reader;
-		Json::Value root;
-
-		if(response.StatusCode() != 200) {
-			return ErrorInfo(response);
-		}
-		if(!reader.parse(response.Body(), root)) {
-			return 2;
-		}
-
-		if(!root.isMember("data") || root["data"][0].isNull() || !root["data"].isArray()) {
-			return 3;
-		}
-
-		if(root.isMember("data")) {
-			if(root["data"].isMember("type")) {
-				std::string type = root["data"]["type"].asString();
-			}
-			if(root["data"].isMember("communityId")) {
-				std::string communityId = root["data"]["communityId"].asString();
-			}
-			if(root["data"].isMember("unitId")) {
-				std::string unitId = root["data"]["unitId"].asString();
-			}
-
-		} else {
-			LOGD("错误没有名为data的key!");
-		}
-
-		return 0;
-	}
-
-} /* namespace jhws */

+ 0 - 133
src/core/jhws.h

@@ -1,133 +0,0 @@
-/*
- * jhws.h
- *
- *  Created on: 2022年4月22日
- *      Author: pengzc
- */
-
-#ifndef JNI_CORE_JHWS_H_
-#define JNI_CORE_JHWS_H_
-
-#define WDKL_VERSION "wdkl_version"
-#define JHWS_VERSION_NUMBER "wdkl_version_number"
-
-#include <string>
-#include <list>
-
-#include <vector>
-
-#include "core/houseinfo.h"
-
-namespace jhws {
-
-struct Community {
-	int code;
-	std::string name;
-	std::string communityId;
-};
-typedef std::vector<Community> CommunityList;
-
-struct Area {
-	int code;
-	std::string name;
-	std::string areaId;
-};
-typedef std::vector<Area> AreaList;
-
-struct Building {
-	int code;
-	std::string name;
-	std::string buildId;
-};
-typedef std::vector<Building> BuildingList;
-
-struct Unit {
-	int code;
-	std::string name;
-	std::string unitId;
-};
-typedef std::vector<Unit> UnitList;
-
-struct Floor {
-	int code;
-	std::string name;
-	std::string floorId;
-};
-typedef std::vector<Floor> FloorList;
-
-struct Room {
-	int code;
-	std::string name;
-	std::string roomId;
-};
-typedef std::vector<Room> RoomList;
-
-struct Device {
-	std::string type;
-	std::string deviceNumber;
-
-	int communitycode;
-	int areacode;
-	std::string areaname;
-	int buildcode;
-	std::string buildname;
-	int unitcode;
-	std::string unitname;
-
-};
-typedef std::vector<Device> DeviceList;
-
-struct Message {
-	std::string updateTime;
-	std::string content;
-	std::string title;
-};
-typedef std::vector<Message> MessageList;
-
-struct Update {
-	std::string notice;
-	std::string device;
-};
-typedef std::vector<Update> UpdateList;
-
-//获取token
-int GetToken(const std::string& id, const std::string& secret, const std::string& encrypted, j::house_setting* profile);
-
-//获取社区列表
-int GetCommunities(CommunityList& list, j::house_setting* profile);
-
-//获取区域列表
-int GetAreas(AreaList& list, j::house_setting* profile);
-
-//获取楼栋列表
-int GetBuildings(BuildingList& list, j::house_setting* profile);
-
-//获取单元列表
-int GetUnits(UnitList& list, j::house_setting* profile);
-
-//获取楼层列表
-int GetFloors(FloorList& list, j::house_setting* profile);
-
-//获取房间列表
-int GetRooms(RoomList& list, j::house_setting* profile);
-
-//绑定设备
-int BindDevice(j::house_setting* profile);
-
-//获取设备列表
-int GetDevice(DeviceList& list, j::house_setting* profile);
-
-//获取消息最新时间
-int GetUpdate(Update& list);
-
-//获取消息列表
-int GetMessage(MessageList& list);
-
-//报警
-int Alarm(j::house_setting* profile);
-
-} /* namespace jhws */
-
-
-
-#endif /* JNI_CORE_JHWS_H_ */

+ 1 - 0
src/logic/callLogic.cc

@@ -447,6 +447,7 @@ static bool onUI_Timer(int id){
 	case CALLING_TIME: {
 		//TCP call
 		TcpModel tcpModel;
+		tcpModel.tid = base::format("t%d", TimeHelper::getCurrentTime());
 		tcpModel.type = TcpType::VOICE;
 		tcpModel.action = VoiceAction::CANCEL;
 		tcpModel.from_id = StoragePreferences::getInt(STORE_DEVICE_ID,0);

+ 9 - 7
src/logic/deviceInfoLogic.cc

@@ -12,7 +12,6 @@
 #include "base/base.hpp"
 #include "storage/StoragePreferences.h"
 #include "service/BusinessConfig.h"
-#include "core/jhws.h"
 #include "manager/LanguageManager.h"
 #include <net/NetUtils.h>
 
@@ -260,7 +259,7 @@ static void onUI_init(){
 	string voicePwd = StoragePreferences::getString(SIP_REG_PASSWORD, SIP_REG_PASSWORD_DEFAULT);
 	mVoiceDomainPtr->setText(StoragePreferences::getString(SIP_REG_DOMAIN, SIP_REG_DOMAIN_DEFAULT));
 
-	mVersionPtr->setText(version);
+	mVersionPtr->setText(getVersionCode());
 
 	//server ip
 	string sIP = StoragePreferences::getString(STORE_GATEWAY, serverIP);
@@ -378,11 +377,14 @@ static bool onButtonClick_VersionButton(ZKButton *pButton) {
 
 static bool onButtonClick_RestartButton(ZKButton *pButton) {
     LOGD(" ButtonClick RestartButton !!!\n");
+    Intent* intent = new Intent();
+	intent->putExtra(functionWindows, "reboot");
+	EASYUICONTEXT->openActivity("functionActivity", intent);
 
-	const char* req = "-1";
-	TcpClient::instance()->sendMsg(req);
-    //重启
-	sync();
-	reboot(RB_AUTOBOOT);
+//	const char* req = "-1";
+//	TcpClient::instance()->sendMsg(req);
+//    //重启
+//	sync();
+//	reboot(RB_AUTOBOOT);
     return false;
 }

+ 42 - 3
src/logic/functionLogic.cc

@@ -181,7 +181,8 @@ static S_ACTIVITY_TIMEER REGISTER_ACTIVITY_TIMER_TAB[] = {
  */
 static void onUI_init(){
     //Tips :添加 UI初始化的显示代码到这里,如:mText1Ptr->setText("123");
-	mFunctionPainterPtr->setAlpha(102);
+//	mFunctionPainterPtr->setAlpha(102);
+	LOGD("2222222222222222222");
 }
 
 /**
@@ -193,7 +194,6 @@ static void onUI_intent(const Intent *intentPtr) {
 
 		// 键值解析
 		_functionWindows = intentPtr->getExtra(functionWindows);
-		LOGD("_functionWindows == %s", _functionWindows.c_str());
 		if (_functionWindows == "callBed") {
 			callBed();
 		}
@@ -238,7 +238,8 @@ static void onUI_intent(const Intent *intentPtr) {
 		}
 		else if (_functionWindows == "serverChange" ||
 				_functionWindows == "setting" ||
-				_functionWindows == "init") {
+				_functionWindows == "init" ||
+				_functionWindows == "reboot") {
 			pwdWindowInfo();
 		}
     }
@@ -501,6 +502,20 @@ static bool onButtonClick_PwdConfirmButton(ZKButton *pButton) {
 			mPwdPromptTextViewPtr->setTextColor(0xFFFF0000);
 		}
 	}
+	else if (_functionWindows == "reboot") {
+
+		// 密码为888
+		string cpwd = "888";
+		if (pwd == cpwd){
+			// 关闭密码输入界面
+			mPwdWindowPtr->hideWnd();
+			// 打开初始化界面
+			mRebootWindowPtr->showWnd();
+		} else {
+			mPwdPromptTextViewPtr->setTextTr("PasswordWrong");
+			mPwdPromptTextViewPtr->setTextColor(0xFFFF0000);
+		}
+	}
     return false;
 }
 
@@ -550,3 +565,27 @@ static bool onButtonClick_ServerCancelButton(ZKButton *pButton) {
 	EASYUICONTEXT->closeActivity("functionActivity");
     return false;
 }
+static bool onButtonClick_RebootDeviceButton(ZKButton *pButton) {
+    LOGD(" ButtonClick RebootDeviceButton !!!\n");
+	const char* req = "-1";
+	TcpClient::instance()->sendMsg(req);
+	//重启
+	sync();
+	reboot(RB_AUTOBOOT);
+    return false;
+}
+
+static bool onButtonClick_RebootPowerButton(ZKButton *pButton) {
+    LOGD(" ButtonClick RebootPowerButton !!!\n");
+	TcpModel tcpModel;
+	tcpModel.type = TcpType::DEVICE;
+	tcpModel.action = DeviceAction::POWER_RESET;
+	tcpModel.from_id = StoragePreferences::getInt(STORE_DEVICE_ID,0);
+	tcpModel.to_id = NULL;
+
+	std::string req = getTcpModelString(tcpModel);
+	LOGD("TCP DEVICE : %s",req.c_str());
+
+    TcpClient::instance()->sendMsg(req.c_str());
+    return false;
+}

+ 304 - 381
src/logic/mainLogic.cc

@@ -17,7 +17,6 @@
 #include "base/strings.hpp"
 #include "base/http_client.h"
 #include "os/UpgradeMonitor.h"
-#include "core/jhws.h"
 #include "core/update_assistant.h"
 #include "utils/TimeHelper.h"
 
@@ -80,429 +79,342 @@ static int emptyBedCount = 0;
 
 
 
-//======================================= udp 请示服务器信息
-static net::Conn* udpConn;
-class UdpThread: public Thread {
-public:
-	static void getServerInfo(){
+static void getServerInfo(){
 
-		string url = getHttpGateway() + "/ncs_url/server_info";
-		LOGD("请求服务器信息. url = %s", url.c_str());
-		//发起HTTP GET请求
-		RestClient::Response r = RestClient::get(url);
-		//解析json
-		Json::Reader reader;
-		Json::Value root;
-		if (reader.parse(r.body, root, false)){
-			// http
-			StoragePreferences::putString(STORE_GATEWAY, root["http_local_ip"].asString());
-			StoragePreferences::putInt(STORE_HTTP_PORT, root["http_port"].asInt());
+	string url = getHttpGateway() + "/ncs_url/server_info";
+	LOGD("请求服务器信息. url = %s", url.c_str());
+	//发起HTTP GET请求
+	RestClient::Response r = RestClient::get(url);
+	//解析json
+	Json::Reader reader;
+	Json::Value root;
+	if (reader.parse(r.body, root, false)){
+		// http
+		StoragePreferences::putString(STORE_GATEWAY, root["http_local_ip"].asString());
+		StoragePreferences::putInt(STORE_HTTP_PORT, root["http_port"].asInt());
 
-			// tcp
-			StoragePreferences::putString(STORE_TCP_LOCAL_IP, root["tcp_local_ip"].asString());
-			StoragePreferences::putInt(STORE_TCP_PORT, root["tcp_port"].asInt());
+		// tcp
+		StoragePreferences::putString(STORE_TCP_LOCAL_IP, root["tcp_local_ip"].asString());
+		StoragePreferences::putInt(STORE_TCP_PORT, root["tcp_port"].asInt());
 
-			// sip
-			StoragePreferences::putString(SIP_REG_DOMAIN, root["sip_ip"].asString());
-			StoragePreferences::putInt(SIP_REG_PORT, root["sip_port"].asInt());
-
-			serverInfo = false;	// 只有请求成功了,才不需要重复请求
-		}
+		// sip
+		StoragePreferences::putString(SIP_REG_DOMAIN, root["sip_ip"].asString());
+		StoragePreferences::putInt(SIP_REG_PORT, root["sip_port"].asInt());
 
+		serverInfo = false;	// 只有请求成功了,才不需要重复请求
 	}
+}
 
-	static void getDeviceInfo(){
-		if (dataInit){
-			getFrameInfo();
-			getBedCount();
-			return;
-		}
-		string url = getHttpGateway() + "/deviceRoom/get_device_by_eth_mac/" + StoragePreferences::getString(STORE_MAC_ADDR, "0.0.0.0");
-		LOGD("请求设备信息. url = %s", url.c_str());
-		//发起HTTP GET请求
-		RestClient::Response r = RestClient::get(url);
-		LOGD("获得设备信息. result = %s", r.body.c_str());
-		//解析json
-		Json::Reader reader;
-		Json::Value root;
-		if (reader.parse(r.body, root, false)){
-			string partName = root["part_display"].asString();
-			StoragePreferences::putString(STORE_PARTNAME,partName);
-			NavibarSetPartName(partName);
-			//设备
-			StoragePreferences::putInt(STORE_DEVICE_ID, root["id"].asInt());
-			StoragePreferences::putInt(STORE_DEVICE_TYPE, root["device_type"].asInt());
-
-			//SIP存储
-//			StoragePreferences::putString(SIP_REG_DOMAIN, root["sip_ip"].asString());	// 应该去找配置文件里的sip-ip
-			StoragePreferences::putString(SIP_REG_ACCOUNT,root["sip_id"].asString());
-			StoragePreferences::putString(SIP_REG_PASSWORD, root["sip_password"].asString());
-
-			frameInfo["frame_id"] = root["frame_id"].asInt();
-			frameInfo["full_name"] = root["full_name"].asString();
-			frameInfo["part_id"] = root["part_id"].asInt();
-			getFrameInfo();
-
-			//获取科室设置
-			string partId = root["part_id"].asString();
-			StoragePreferences::putString(STORE_PARTID, partId);
-			getPartSetting(partId);
-			getVersion();
-			getNfcInteraction();
-		}
-	}
-	// 读取空间缓存的数据
-	static void getFrameInfo() {
-		mRoomNameTextViewPtr->setText(frameInfo["full_name"].asString());
+// 读取空间缓存的数据
+static void getFrameInfo() {
+	mRoomNameTextViewPtr->setText(frameInfo["full_name"].asString());
+}
+
+static void getBedCount() {
+	if (mActivityPtr == NULL) {
+		return;
 	}
+	mInBedNumTextViewPtr->setText(inBedCount);
+	mEmptyBedNumTextViewPtr->setText(emptyBedCount);
+}
 
-	static void getFrameRoom(int frame_id) {
-		string url = getHttpGateway() + "/deviceRoom/get_frame_room/" + to_string(frame_id);
-		LOGD("请求房间信息. url = %s", url.c_str());
-		//发起HTTP GET请求
-		RestClient::Response r = RestClient::get(url);
-		LOGD("获得房间信息. result = %s", r.body.c_str());
-		//解析json
-		Json::Reader reader;
-		Json::Value root;
-		if (reader.parse(r.body, root, false)){
-			frameRoom = root;
-			frameBedList = root["frame_bed_list"];
-
-			inBedCount = 0;
-			emptyBedCount = 0;
-			if (frameBedList.size() > 0) {
-				for (int i = 0; i < frameBedList.size(); i++) {
-					string customerId = frameBedList[i]["customer_id"].asString();
-					if (customerId != "") {
-						inBedCount += 1;
-					}
+static void getFrameRoom(int frame_id) {
+	string url = getHttpGateway() + "/deviceRoom/get_frame_room/" + to_string(frame_id);
+	LOGD("请求房间信息. url = %s", url.c_str());
+	//发起HTTP GET请求
+	RestClient::Response r = RestClient::get(url);
+	LOGD("获得房间信息. result = %s", r.body.c_str());
+	//解析json
+	Json::Reader reader;
+	Json::Value root;
+	if (reader.parse(r.body, root, false)){
+		frameRoom = root;
+		frameBedList = root["frame_bed_list"];
+
+		inBedCount = 0;
+		emptyBedCount = 0;
+		if (frameBedList.size() > 0) {
+			for (int i = 0; i < frameBedList.size(); i++) {
+				string customerId = frameBedList[i]["customer_id"].asString();
+				if (customerId != "") {
+					inBedCount += 1;
 				}
-				emptyBedCount = frameBedList.size() - inBedCount;
-				getBedCount();
-			}
-
-			if (mBedListViewPtr != NULL) {
-				mBedListViewPtr->refreshListView();
 			}
+			emptyBedCount = frameBedList.size() - inBedCount;
+			getBedCount();
 		}
-	}
 
-	static void getBedCount() {
-		if (mActivityPtr == NULL) {
-			return;
+		if (mBedListViewPtr != NULL) {
+			mBedListViewPtr->refreshListView();
 		}
-		mInBedNumTextViewPtr->setText(inBedCount);
-		mEmptyBedNumTextViewPtr->setText(emptyBedCount);
 	}
+}
 
 
-	static void getPartSetting(string partId){
-		string url = getHttpGateway() + "/deviceBed/getPartSetting/" + partId;
-		LOGD("请求科室信息. url = %s", url.c_str());
-		//发起HTTP GET请求
-		RestClient::Response r = RestClient::get(url);
-		LOGD("获得科室信息. result = %s", r.body.c_str());
-		//解析json
-		Json::Reader reader;
-		Json::Value root;
-		if (reader.parse(r.body, root, false)){
-			partSetting.partId = root["part_id"].asInt();
-			partSetting.dayStart = root["day_start"].asString();
-			partSetting.dayLight = root["day_light"].asInt();
-			partSetting.dayVol = root["day_vol"].asInt();
-			partSetting.dayRingVol = root["day_ring_vol"].asInt();
-			partSetting.dayRingTimes = root["day_ring_times"].asInt();
-			partSetting.dayNurseLed = root["day_nurse_led"].asInt();
-			partSetting.dayDoorVol = root["day_door_vol"].asInt();
-			partSetting.dayBedVol = root["day_bed_vol"].asInt();
-			partSetting.dayTransferBoxVol = root["day_transfer_box_vol"].asInt();
-			partSetting.dayTransferBoxSystemVol = root["day_transfer_box_system_vol"].asInt();
-			partSetting.nightStart = root["night_start"].asString();
-			partSetting.nightLight = root["night_light"].asInt();
-			partSetting.nightVol = root["night_vol"].asInt();
-			partSetting.nightRingVol = root["night_ring_vol"].asInt();
-			partSetting.nightRingTimes = root["night_ring_times"].asInt();
-			partSetting.nightNurseLed = root["night_nurse_led"].asInt();
-			partSetting.nightDoorVol = root["night_door_vol"].asInt();
-			partSetting.nightBedVol = root["night_bed_vol"].asInt();
-			partSetting.nightTransferBoxVol = root["night_transfer_box_vol"].asInt();
-			partSetting.nightTransferBoxSystemVol = root["night_transfer_box_system_vol"].asInt();
-			partSetting.sleepSecondsNurse = root["sleep_seconds_nurse"].asInt();
-			partSetting.sleepSecondsDoor = root["sleep_seconds_door"].asInt();
-			partSetting.sleepSecondsBed = root["sleep_seconds_bed"].asInt();
-			partSetting.sipOvertime = root["sip_overtime"].asInt();
-			partSetting.transferDuration = root["transfer_duration"].asInt();
-			partSetting.transferDurationLeader = root["transfer_duration_leader"].asInt();
-			partSetting.communicationModeBed = root["communication_mode_bed"].asInt();
-			partSetting.communicationModeNurse = root["communication_mode_nurse"].asInt();
-			partSetting.communicationModeMobile = root["communication_model_mobile"].asInt();
-			partSetting.customizeRoleCallFirst = root["customize_role_call_first"].asInt();
-			partSetting.customizeRoleCallSecond = root["customize_role_call_second"].asInt();
-			partSetting.customizeRoleCallThird = root["customize_role_call_third"].asInt();
-			partSetting.customizeRoleCallFourth = root["customize_role_call_fourth"].asInt();
-			partSetting.customizeRoleCallFifth = root["customize_role_call_fifth"].asInt();
-			partSetting.customizeHospitalCallFirst = root["customize_hospital_call_first"].asInt();
-			partSetting.customizeHospitalCallFirstName = root["customize_hospital_call_first_name"].asString();
-			partSetting.customizeHospitalCallSecond = root["customize_hospital_call_second"].asInt();
-			partSetting.customizeHospitalCallSecondName = root["customize_hospital_second_name"].asString();
-			partSetting.customizeHospitalCallThird = root["customize_hospital_call_third"].asInt();
-			partSetting.customizeHospitalCallThirdName = root["customize_hospital_call_third_name"].asString();
-			partSetting.doctorTitle = root["doctor_title"].asString();
-			partSetting.doctorValid = root["doctor_valid"].asInt();
-			partSetting.nurseTitle = root["nurse_title"].asString();
-			partSetting.nurseValid = root["nurse_valid"].asInt();
-			partSetting.doorNurseTitle = root["door_nurse_title"].asString();
-			partSetting.doorNurseValid = root["door_nurse_valid"].asInt();
-			partSetting.doorNursingTitle = root["door_nursing_title"].asString();
-			partSetting.doorNursingValid = root["door_nursing_valid"].asInt();
-			partSetting.upSeconds = root["up_seconds"].asInt();
-			partSetting.autoAccept = root["auto_accept"].asInt();
-			partSetting.eventForward = root["event_forward"].asInt();
-			partSetting.nursingColorRgb = root["nursing_color_rgb"].asString();
-			partSetting.twoColorDoorLightValid = root["two_color_door_light_valid"].asInt();
-			partSetting.qrUrl = root["qr_url"].asString();
-			partSetting.screenLight = root["screen_light"].asInt();
-			partSetting.roomCallBed = root["room_call_bed"].asInt();
-			partSetting.autoPosition = root["auto_position"].asInt();
-
-            if (root.isMember("linux_bed_volume_native")) {
-				partSetting.linuxDoorVolumeNative = root["linux_door_volume_native"].asInt();
-				partSetting.linuxDoorGainSize = root["linux_door_gain_size"].asInt();
-
-				zk_audio_input_set_volume_native(0, 0);
-				zk_audio_input_set_volume_native(1, partSetting.linuxDoorVolumeNative);
-				GetTelephone()->SetInputPcmGainSize(partSetting.linuxDoorGainSize);
-
-				StoragePreferences::putInt(STORE_VOLUME_NATIVE, partSetting.linuxDoorVolumeNative);
-				StoragePreferences::putInt(STORE_GAIN_SIZE, partSetting.linuxDoorGainSize);
-			}
+// 将医生和护士别称缓存起来
+static void setRightTitle(Json::Value partSetting) {
+	rightTitleInfo["doctor_title"] = partSetting["doctor_title"].asString();
+	rightTitleInfo["doctor_valid"] = partSetting["doctor_valid"].asInt();
+	rightTitleInfo["nurse_title"] = partSetting["nurse_title"].asString();
+	rightTitleInfo["nurse_valid"] = partSetting["nurse_valid"].asInt();
+}
+
 
-			StoragePreferences::putString(STORE_DAY_START, partSetting.dayStart);
-			StoragePreferences::putInt(STORE_DAY_LIGHT,partSetting.dayLight);
-			StoragePreferences::putInt(STORE_DAY_VOL,partSetting.dayBedVol);
-			StoragePreferences::putInt(STORE_DAY_RING_TIMES,partSetting.dayRingTimes);
 
-			StoragePreferences::putString(STORE_NIGHT_START, partSetting.nightStart);
-			StoragePreferences::putInt(STORE_NIGHT_LIGHT,partSetting.nightLight);
-			StoragePreferences::putInt(STORE_NIGHT_VOL,partSetting.nightBedVol);
-			StoragePreferences::putInt(STORE_NIGHT_RING_TIMES,partSetting.nightRingTimes);
+static void getPartSetting(string partId){
+	string url = getHttpGateway() + "/deviceBed/getPartSetting/" + partId;
+	LOGD("请求科室信息. url = %s", url.c_str());
+	//发起HTTP GET请求
+	RestClient::Response r = RestClient::get(url);
+	LOGD("获得科室信息. result = %s", r.body.c_str());
+	//解析json
+	Json::Reader reader;
+	Json::Value root;
+	if (reader.parse(r.body, root, false)){
+		partSetting.partId = root["part_id"].asInt();
+		partSetting.dayStart = root["day_start"].asString();
+		partSetting.dayLight = root["day_light"].asInt();
+		partSetting.dayVol = root["day_vol"].asInt();
+		partSetting.dayRingVol = root["day_ring_vol"].asInt();
+		partSetting.dayRingTimes = root["day_ring_times"].asInt();
+		partSetting.dayNurseLed = root["day_nurse_led"].asInt();
+		partSetting.dayDoorVol = root["day_door_vol"].asInt();
+		partSetting.dayBedVol = root["day_bed_vol"].asInt();
+		partSetting.dayTransferBoxVol = root["day_transfer_box_vol"].asInt();
+		partSetting.dayTransferBoxSystemVol = root["day_transfer_box_system_vol"].asInt();
+		partSetting.nightStart = root["night_start"].asString();
+		partSetting.nightLight = root["night_light"].asInt();
+		partSetting.nightVol = root["night_vol"].asInt();
+		partSetting.nightRingVol = root["night_ring_vol"].asInt();
+		partSetting.nightRingTimes = root["night_ring_times"].asInt();
+		partSetting.nightNurseLed = root["night_nurse_led"].asInt();
+		partSetting.nightDoorVol = root["night_door_vol"].asInt();
+		partSetting.nightBedVol = root["night_bed_vol"].asInt();
+		partSetting.nightTransferBoxVol = root["night_transfer_box_vol"].asInt();
+		partSetting.nightTransferBoxSystemVol = root["night_transfer_box_system_vol"].asInt();
+		partSetting.sleepSecondsNurse = root["sleep_seconds_nurse"].asInt();
+		partSetting.sleepSecondsDoor = root["sleep_seconds_door"].asInt();
+		partSetting.sleepSecondsBed = root["sleep_seconds_bed"].asInt();
+		partSetting.sipOvertime = root["sip_overtime"].asInt();
+		partSetting.transferDuration = root["transfer_duration"].asInt();
+		partSetting.transferDurationLeader = root["transfer_duration_leader"].asInt();
+		partSetting.communicationModeBed = root["communication_mode_bed"].asInt();
+		partSetting.communicationModeNurse = root["communication_mode_nurse"].asInt();
+		partSetting.communicationModeMobile = root["communication_model_mobile"].asInt();
+		partSetting.customizeRoleCallFirst = root["customize_role_call_first"].asInt();
+		partSetting.customizeRoleCallSecond = root["customize_role_call_second"].asInt();
+		partSetting.customizeRoleCallThird = root["customize_role_call_third"].asInt();
+		partSetting.customizeRoleCallFourth = root["customize_role_call_fourth"].asInt();
+		partSetting.customizeRoleCallFifth = root["customize_role_call_fifth"].asInt();
+		partSetting.customizeHospitalCallFirst = root["customize_hospital_call_first"].asInt();
+		partSetting.customizeHospitalCallFirstName = root["customize_hospital_call_first_name"].asString();
+		partSetting.customizeHospitalCallSecond = root["customize_hospital_call_second"].asInt();
+		partSetting.customizeHospitalCallSecondName = root["customize_hospital_second_name"].asString();
+		partSetting.customizeHospitalCallThird = root["customize_hospital_call_third"].asInt();
+		partSetting.customizeHospitalCallThirdName = root["customize_hospital_call_third_name"].asString();
+		partSetting.doctorTitle = root["doctor_title"].asString();
+		partSetting.doctorValid = root["doctor_valid"].asInt();
+		partSetting.nurseTitle = root["nurse_title"].asString();
+		partSetting.nurseValid = root["nurse_valid"].asInt();
+		partSetting.doorNurseTitle = root["door_nurse_title"].asString();
+		partSetting.doorNurseValid = root["door_nurse_valid"].asInt();
+		partSetting.doorNursingTitle = root["door_nursing_title"].asString();
+		partSetting.doorNursingValid = root["door_nursing_valid"].asInt();
+		partSetting.upSeconds = root["up_seconds"].asInt();
+		partSetting.autoAccept = root["auto_accept"].asInt();
+		partSetting.eventForward = root["event_forward"].asInt();
+		partSetting.nursingColorRgb = root["nursing_color_rgb"].asString();
+		partSetting.twoColorDoorLightValid = root["two_color_door_light_valid"].asInt();
+		partSetting.qrUrl = root["qr_url"].asString();
+		partSetting.screenLight = root["screen_light"].asInt();
+		partSetting.roomCallBed = root["room_call_bed"].asInt();
+		partSetting.autoPosition = root["auto_position"].asInt();
+		partSetting.customerAgeHiddenOnDoor = root["customer_age_hidden_on_door"].asInt();
+
+		if (root.isMember("linux_bed_volume_native")) {
+			partSetting.linuxDoorVolumeNative = root["linux_door_volume_native"].asInt();
+			partSetting.linuxDoorGainSize = root["linux_door_gain_size"].asInt();
+
+			zk_audio_input_set_volume_native(0, 0);
+			zk_audio_input_set_volume_native(1, partSetting.linuxDoorVolumeNative);
+			GetTelephone()->SetInputPcmGainSize(partSetting.linuxDoorGainSize);
+
+			StoragePreferences::putInt(STORE_VOLUME_NATIVE, partSetting.linuxDoorVolumeNative);
+			StoragePreferences::putInt(STORE_GAIN_SIZE, partSetting.linuxDoorGainSize);
+		}
 
-			StoragePreferences::putInt(STORE_SLEEP_TIME, partSetting.sleepSecondsDoor);
+		StoragePreferences::putString(STORE_DAY_START, partSetting.dayStart);
+		StoragePreferences::putInt(STORE_DAY_LIGHT,partSetting.dayLight);
+		StoragePreferences::putInt(STORE_DAY_VOL,partSetting.dayBedVol);
+		StoragePreferences::putInt(STORE_DAY_RING_TIMES,partSetting.dayRingTimes);
 
-			StoragePreferences::putString(STORE_DOCTOR_TITLE, partSetting.doctorTitle);
-			StoragePreferences::putBool(STORE_DOCTOR_VISIBLE, partSetting.doctorValid==1);
-			StoragePreferences::putString(STORE_NURSE_TITLE, partSetting.nurseTitle);
-			StoragePreferences::putBool(STORE_NURSE_VISIBLE, partSetting.nurseValid==1);
+		StoragePreferences::putString(STORE_NIGHT_START, partSetting.nightStart);
+		StoragePreferences::putInt(STORE_NIGHT_LIGHT,partSetting.nightLight);
+		StoragePreferences::putInt(STORE_NIGHT_VOL,partSetting.nightBedVol);
+		StoragePreferences::putInt(STORE_NIGHT_RING_TIMES,partSetting.nightRingTimes);
 
-			StoragePreferences::putString(STORE_NURSING_COLOR_RGB, partSetting.nursingColorRgb);
-			StoragePreferences::putBool(STORE_AUDO_ANSWER, partSetting.autoAccept==1);
-			StoragePreferences::putInt(STORE_SCREEN_LIGHT, partSetting.screenLight);
-			StoragePreferences::putInt(STORE_ROOM_CALL_BED, partSetting.roomCallBed);
-			StoragePreferences::putInt(STORE_AUTO_POSITION, partSetting.autoPosition);
+		StoragePreferences::putInt(STORE_SLEEP_TIME, partSetting.sleepSecondsDoor);
 
-			setRightTitle(root);
-			callBedButtonSetVisible();
+		StoragePreferences::putString(STORE_DOCTOR_TITLE, partSetting.doctorTitle);
+		StoragePreferences::putBool(STORE_DOCTOR_VISIBLE, partSetting.doctorValid==1);
+		StoragePreferences::putString(STORE_NURSE_TITLE, partSetting.nurseTitle);
+		StoragePreferences::putBool(STORE_NURSE_VISIBLE, partSetting.nurseValid==1);
 
-			getFrameRoom(frameInfo["frame_id"].asInt());
+		StoragePreferences::putString(STORE_NURSING_COLOR_RGB, partSetting.nursingColorRgb);
+		StoragePreferences::putBool(STORE_AUDO_ANSWER, partSetting.autoAccept==1);
+		StoragePreferences::putInt(STORE_SCREEN_LIGHT, partSetting.screenLight);
+		StoragePreferences::putInt(STORE_ROOM_CALL_BED, partSetting.roomCallBed);
+		StoragePreferences::putInt(STORE_AUTO_POSITION, partSetting.autoPosition);
 
-			dataInit = true;
-		}
-	}
+		setRightTitle(root);
+		callBedButtonSetVisible();
 
+		getFrameRoom(frameInfo["frame_id"].asInt());
 
-	// 将医生和护士别称缓存起来
-	static void setRightTitle(Json::Value partSetting) {
-		rightTitleInfo["doctor_title"] = partSetting["doctor_title"].asString();
-		rightTitleInfo["doctor_valid"] = partSetting["doctor_valid"].asInt();
-		rightTitleInfo["nurse_title"] = partSetting["nurse_title"].asString();
-		rightTitleInfo["nurse_valid"] = partSetting["nurse_valid"].asInt();
+		dataInit = true;
 	}
+}
 
+static void getVersion() {
+	std::string url = getHttpGateway() + "/deviceRoom/get_app_version?device_type=303&part_id=" + StoragePreferences::getString(STORE_PARTID, "");
+	std::string content_type = std::string("application/json");
 
-	static void getVersion() {
-		std::string url = getHttpGateway() + "/deviceRoom/get_app_version?device_type=303&part_id=" + StoragePreferences::getString(STORE_PARTID, "");
-		std::string content_type = std::string("application/json");
-
-		LOGD("请求版本信息. url = %s", url.c_str());
-		//发起HTTP POST请求
-		RestClient::Response r = RestClient::post(url, content_type, "");
-		if (r.code != 200) {
-			LOGD("请求版本信息-> 错误代码: %d", r.code);
-			return;
-		}
+	LOGD("请求版本信息. url = %s", url.c_str());
+	//发起HTTP POST请求
+	RestClient::Response r = RestClient::post(url, content_type, "");
+	if (r.code != 200) {
+		LOGD("请求版本信息-> 错误代码: %d", r.code);
+		return;
+	}
 
-		LOGD("获得版本信息. result = %s", r.body.c_str());
-		//解析json
-		Json::Reader reader;
-		Json::Value root;
-
-		if(reader.parse(r.body, root, false)) {
-			int currentVersionNo = getVersionNo();
-			int responseVersionNo = root["version_no"].asInt();
-			std::string responseVersion = root["version_code"].asString();
-			LOGD("服务器版本 : %s %d, 当前设备版本: %d", responseVersion.c_str(), responseVersionNo, currentVersionNo);
-
-			if (currentVersionNo < responseVersionNo) {
-				Intent* intent = new Intent();
-				intent->putExtra(appUpdate, "true");
-				EASYUICONTEXT->openActivity("updateActivity", intent);
-			}
+	LOGD("获得版本信息. result = %s", r.body.c_str());
+	//解析json
+	Json::Reader reader;
+	Json::Value root;
+
+	if(reader.parse(r.body, root, false)) {
+		int currentVersionNo = getVersionNo();
+		int responseVersionNo = root["version_no"].asInt();
+		std::string responseVersion = root["version_code"].asString();
+		LOGD("服务器版本 : %s %d, 当前设备版本: %d", responseVersion.c_str(), responseVersionNo, currentVersionNo);
+
+		if (currentVersionNo < responseVersionNo) {
+			Intent* intent = new Intent();
+			intent->putExtra(appUpdate, "true");
+			EASYUICONTEXT->openActivity("updateActivity", intent);
 		}
 	}
+}
 
-	static void getNfcInteraction() {
-		std::string url = getHttpGateway() + "/deviceRoom/get_nfc_interaction_end_time_is_null/" + to_string(StoragePreferences::getInt(STORE_DEVICE_ID,0));
+static void getNfcInteraction() {
+	std::string url = getHttpGateway() + "/deviceRoom/get_nfc_interaction_end_time_is_null/" + to_string(StoragePreferences::getInt(STORE_DEVICE_ID,0));
 
-		LOGD("请求未完成的nfc记录. url = %s", url.c_str());
-		//发起HTTP POST请求
-		RestClient::Response r = RestClient::get(url);
-		if (r.code != 200) {
-			LOGD("请求未完成的nfc记录-> 错误代码: %d", r.code);
-			return;
-		}
+	LOGD("请求未完成的nfc记录. url = %s", url.c_str());
+	//发起HTTP POST请求
+	RestClient::Response r = RestClient::get(url);
+	if (r.code != 200) {
+		LOGD("请求未完成的nfc记录-> 错误代码: %d", r.code);
+		return;
+	}
 
-		LOGD("获得未完成的nfc记录. result = %s", r.body.c_str());
-		//解析json
-		Json::Reader reader;
-		Json::Value root;
-
-		if(reader.parse(r.body, root, false)) {
-			int clerkId = 0;
-			for (int i = 0; i < root.size(); i++) {
-				if (root[i]["components_type"].asCString() == TcpType::AUTH) {
-					clerkId = root[i]["clerk_id"].asInt();
-					setClerk(root[i]["clerk_name"].asCString(), root[i]["pass_no"].asCString(), root[i]["id"].asInt());
-				}
-				else if (root[i]["components_type"].asString() == "POSITION_COMPONENT") {
-					setPosistionItId(root[i]["id"].asInt());
-					setPositionButton(true);
-				}
-				else if (root[i]["components_type"].asString() == "ROOMCHECK_COMPONENT") {
-					setRoomCheckItId(root[i]["id"].asInt());
-					setRoomPatrolButton(true);
-				}
-				else if (root[i]["components_type"].asString() == "SCREEN_TIP_SET_COMPONENT") {
-					time_t now = getDateline();
-					if (now <= 0) {
-                        continue;
-					}
-
-					Json::Reader Reader;
-					Json::Value operationData;
-					Reader.parse(root[i]["operation_data"].asString(), operationData);
-					int seconds = operationData["seconds"].asInt();
-
-					if (now - root[i]["start_time"].asInt() < seconds) {
-						setPromptTimeItId(root[i]["id"].asInt());
-
-						Intent* intent = new Intent();
-						intent->putExtra(promptText2, operationData["tips"].asString());
-						intent->putExtra(promptTime2, to_string(seconds - (now - root[i]["start_time"].asInt())));
-						EASYUICONTEXT->openActivity("promptActivity", intent);
-					}
-					else {
-						sendPromptQuit(root[i]["id"].asInt());
-					}
-				}
+	LOGD("获得未完成的nfc记录. result = %s", r.body.c_str());
+	//解析json
+	Json::Reader reader;
+	Json::Value root;
+
+	if(reader.parse(r.body, root, false)) {
+		int clerkId = 0;
+		for (int i = 0; i < root.size(); i++) {
+			if (root[i]["components_type"].asCString() == TcpType::AUTH) {
+				clerkId = root[i]["clerk_id"].asInt();
+				setClerk(root[i]["clerk_name"].asCString(), root[i]["pass_no"].asCString(), root[i]["id"].asInt());
 			}
-			if (clerkId != 0) {
-				goCare();
+			else if (root[i]["components_type"].asString() == "POSITION_COMPONENT") {
+				setPosistionItId(root[i]["id"].asInt());
+				setPositionButton(true);
 			}
-		}
-	}
-
+			else if (root[i]["components_type"].asString() == "ROOMCHECK_COMPONENT") {
+				setRoomCheckItId(root[i]["id"].asInt());
+				setRoomPatrolButton(true);
+			}
+			else if (root[i]["components_type"].asString() == "SCREEN_TIP_SET_COMPONENT") {
+				time_t now = getDateline();
+				if (now <= 0) {
+					continue;
+				}
 
-	/**
-	 * 线程创建成功后会调用该函数,可以在该函数中做一些初始化操作
-	 * return true   继续线程
-	 *        false  退出线程
-	 */
-	virtual bool readyToRun() {
-		LOGD("Thread 已经创建完成");
-		return true;
-	}
+				Json::Reader Reader;
+				Json::Value operationData;
+				Reader.parse(root[i]["operation_data"].asString(), operationData);
+				int seconds = operationData["seconds"].asInt();
 
-	/**
-	 * 线程循环函数
-	 *
-	 * return true  继续线程循环
-	 *        false 推出线程
-	 */
-	virtual bool threadLoop() {
-		LOGD("线程循环函数");
-
-		//检查是否有退出线程的请求,如果有,则返回false,立即退出线程
-		if (exitPending()) {
-			return false;
-		}
+				if (now - root[i]["start_time"].asInt() < seconds) {
+					setPromptTimeItId(root[i]["id"].asInt());
 
-		udpConn = net::Dial("udp", "192.168.1.255:10010");
-		if (udpConn) {
-			byte buf[1024] = {0};
-			const char* req = "search_server";
-			//发送
-			udpConn->Write((byte*)req, strlen(req));
-			while (true && !exitPending()) {
-				//读取,超时10*1000毫秒
-				int n = udpConn->Read(buf, sizeof(buf) - 1, 10*1000);
-				if (n > 0) {
-					buf[n] = 0;
-					char serverStr[1024];
-					sprintf(serverStr,"%s",buf);
-					LOGD("读取 %d字节: %s", n, serverStr);
-
-					//解析json
-					Json::Reader reader;
-					Json::Value root;
-					if (reader.parse(serverStr, root, false)){
-						if (root.isMember("success") && root["success"].asBool()){
-							serverIP = root["data"]["third_server"].asString();
-							serverHttpPort = root["data"]["third_server_port"].asInt();
-
-							StoragePreferences::putString(STORE_GATEWAY, serverIP);
-							StoragePreferences::putInt(STORE_HTTP_PORT, serverHttpPort);
-
-							//先获取服务器信息
-							//getServerInfo();
-							//就当在获取服务器信息完成后获取用户信息,这里测试用
-							//getCustomerInfo();
-							//退出UDP线程
-							pthread_exit(NULL);
-							break;
-						}
-					}
-				} else if (n == 0) {
-					LOGD("连接正常断开");
-					break;
-				} else if (n == net::E_TIMEOUT) {
-					udpConn->Write((byte*)req, strlen(req));
-					LOGD("读取超时");
-				} else {
-					LOGD("出错");
-					break;
+					Intent* intent = new Intent();
+					intent->putExtra(promptText2, operationData["tips"].asString());
+					intent->putExtra(promptTime2, to_string(seconds - (now - root[i]["start_time"].asInt())));
+					EASYUICONTEXT->openActivity("promptActivity", intent);
+				}
+				else {
+					sendPromptQuit(root[i]["id"].asInt());
 				}
 			}
-			//关闭连接
-			udpConn->Close();
-			//释放内存
-			delete udpConn;
-			udpConn = NULL;
 		}
-
-		//返回真,继续下次线程循环
-		return true;
+		if (clerkId != 0) {
+			goCare();
+		}
 	}
-};
+}
 
-static UdpThread udp_thread;
 
-Json::Value getFrame() {
-	return frameRoom;
+
+static void getDeviceInfo(){
+	if (dataInit){
+		getFrameInfo();
+		getBedCount();
+		return;
+	}
+	string url = getHttpGateway() + "/deviceRoom/get_device_by_eth_mac/" + StoragePreferences::getString(STORE_MAC_ADDR, "0.0.0.0");
+	LOGD("请求设备信息. url = %s", url.c_str());
+	//发起HTTP GET请求
+	RestClient::Response r = RestClient::get(url);
+	LOGD("获得设备信息. result = %s", r.body.c_str());
+	//解析json
+	Json::Reader reader;
+	Json::Value root;
+	if (reader.parse(r.body, root, false)){
+		string partName = root["part_display"].asString();
+		StoragePreferences::putString(STORE_PARTNAME,partName);
+		NavibarSetPartName(partName);
+		//设备
+		StoragePreferences::putInt(STORE_DEVICE_ID, root["id"].asInt());
+		StoragePreferences::putInt(STORE_DEVICE_TYPE, root["device_type"].asInt());
+
+		//SIP存储
+//			StoragePreferences::putString(SIP_REG_DOMAIN, root["sip_ip"].asString());	// 应该去找配置文件里的sip-ip
+		StoragePreferences::putString(SIP_REG_ACCOUNT,root["sip_id"].asString());
+		StoragePreferences::putString(SIP_REG_PASSWORD, root["sip_password"].asString());
+
+		frameInfo["frame_id"] = root["frame_id"].asInt();
+		frameInfo["full_name"] = root["full_name"].asString();
+		frameInfo["part_id"] = root["part_id"].asInt();
+		getFrameInfo();
+
+		//获取科室设置
+		string partId = root["part_id"].asString();
+		StoragePreferences::putString(STORE_PARTID, partId);
+		getPartSetting(partId);
+		getVersion();
+		getNfcInteraction();
+	}
 }
 
 
 
+Json::Value getFrame() {
+	return frameRoom;
+}
 
 // 收到tcp的时候,刷新数据
 void dataRefresh() {
@@ -513,15 +425,15 @@ void dataRefresh() {
 	}
 
 	if (serverInfo) {
-		udp_thread.getServerInfo();
+		getServerInfo();
 	}
 	dataInit = false;
-	udp_thread.getDeviceInfo();
+	getDeviceInfo();
 	mBedListViewPtr->refreshListView();
 }
 
 void getPartSetting() {
-	udp_thread.getPartSetting(StoragePreferences::getString(STORE_PARTID, ""));
+	getPartSetting(StoragePreferences::getString(STORE_PARTID, ""));
 }
 
 
@@ -539,14 +451,14 @@ static S_ACTIVITY_TIMEER REGISTER_ACTIVITY_TIMER_TAB[] = {
  * 当界面构造时触发
  */
 static void onUI_init(){
-	//udp_thread.run("this is thread name");
+	//run("this is thread name");
 	//测试用
 	LOGD("进入mainLogic页面, 触发 onUI_init");
 	if (ETHERNETMANAGER->isConnected() || WIFIMANAGER->isConnected()) {
 		if(serverInfo) {	// 如果是false,就是不需要
-			udp_thread.getServerInfo();
+			getServerInfo();
 		}
-		udp_thread.getDeviceInfo();
+		getDeviceInfo();
 	}
 
 }
@@ -666,7 +578,18 @@ static void obtainListItemData_BedListView(ZKListView *pListView,ZKListView::ZKL
 		} else {
 			name->setText(customerName);
 		}
-		age->setText(frameBedList[index]["customer_age"].asString() + frameBedList[index]["customer_age_unit"].asString());
+
+
+		if (partSetting.customerAgeHiddenOnDoor != 0) {
+			if (frameBedList[index]["customer_age"].asString() == "") {
+				age->setText("");
+			} else {
+				age->setText("*" + frameBedList[index]["customer_age_unit"].asString());
+			}
+		}
+		else {
+			age->setText(frameBedList[index]["customer_age"].asString() + frameBedList[index]["customer_age_unit"].asString());
+		}
 
 		string customerSex = frameBedList[index]["customer_sex"].asString();
 		if (customerSex == "0") {	// 如果性别为女性,替换成女性,底色为粉色

+ 10 - 6
src/logic/navibar.cc

@@ -47,7 +47,7 @@ void goHome() {
 	mMoreButtonPtr->setTextColor(0xFFFFFF);
 
 	EASYUICONTEXT->openActivity("mainActivity");
-	EASYUICONTEXT->closeActivity("moreActivity");
+//	EASYUICONTEXT->closeActivity("moreActivity");
 	EASYUICONTEXT->closeActivity("medicalCareActivity");
 }
 
@@ -60,7 +60,7 @@ void goMore() {
 	mMoreButtonPtr->setTextColor(0x3A78EF);
 
 	EASYUICONTEXT->openActivity("moreActivity");
-	EASYUICONTEXT->closeActivity("mainActivity");
+//	EASYUICONTEXT->closeActivity("mainActivity");
 	EASYUICONTEXT->closeActivity("medicalCareActivity");
 }
 
@@ -74,8 +74,8 @@ void goCare() {
 	mMoreButtonPtr->setTextColor(0xFFFFFF);
 
 	EASYUICONTEXT->openActivity("medicalCareActivity");
-	EASYUICONTEXT->closeActivity("mainActivity");
-	EASYUICONTEXT->closeActivity("moreActivity");
+//	EASYUICONTEXT->closeActivity("mainActivity");
+//	EASYUICONTEXT->closeActivity("moreActivity");
 
 }
 
@@ -187,7 +187,10 @@ static bool onnavibarActivityTouchEvent(const MotionEvent &ev) {
 
 static bool onButtonClick_HomeButton(ZKButton *pButton) {
     LOGD(" ButtonClick HomeButton !!!\n");
-    if (getAuthItId() != 0) {
+
+    int authItId = getAuthItId();
+    if (authItId != 0) {
+    	LOGD("1111111111111111");
     	Intent* intent = new Intent();
     	intent->putExtra(functionWindows, "logoutMedicalCare");
     	intent->putExtra(goActivity, "home");
@@ -207,7 +210,8 @@ static bool onButtonClick_HealthCareButton(ZKButton *pButton) {
 static bool onButtonClick_MoreButton(ZKButton *pButton) {
     LOGD(" ButtonClick MoreButton !!!\n");
 
-    if (getAuthItId() != 0) {
+    int authItId = getAuthItId();
+    if (authItId != 0) {
     	Intent* intent = new Intent();
     	intent->putExtra(functionWindows, "logoutMedicalCare");
     	intent->putExtra(goActivity, "more");

+ 1 - 2
src/logic/updateLogic.cc

@@ -13,7 +13,6 @@
 #include "os/UpgradeMonitor.h"
 
 #include "core/utilities.h"
-#include "core/jhws.h"
 #include "service/BusinessConfig.h"
 #include "manager/LanguageManager.h"
 /*
@@ -216,7 +215,7 @@ static S_ACTIVITY_TIMEER REGISTER_ACTIVITY_TIMER_TAB[] = {
 static void onUI_init(){
     //Tips :添加 UI初始化的显示代码到这里,如:mText1Ptr->setText("123");
 
-	std::string currentVersion = getVersion();
+	std::string currentVersion = getVersionCode();
 	int currentVersionNo = getVersionNo();
 
 	mVersionPtr->setText(currentVersion);	// 写入界面的版本

+ 2 - 1
src/net/tcp_client.cpp

@@ -95,12 +95,13 @@ public:
 		if (conn) {
 			byte buf[2048] = {0};
 			TcpModel tcpModel;
+			tcpModel.tid = base::format("t%d", TimeHelper::getCurrentTime());
 			tcpModel.type = TcpType::DEVICE;
 			tcpModel.action = DeviceAction::CONNECT;
 //			tcpModel.data = ETHERNETMANAGER->getMacAddr();
 			Json::Value json;
 			json["identification"] = StoragePreferences::getString(STORE_MAC_ADDR, "0.0.0.0");
-			json["software_version"] = version;
+			json["software_version"] = getVersionCode();
 			json["model"] = "linux_door";;
 			json["code"] = "SW10600101C-CM";
 			tcpModel.json = json;

+ 7 - 2
src/net/tcp_model.cpp

@@ -15,9 +15,10 @@ std::string getTcpModelString(TcpModel model){
 	Json::Value root;
 	if (model.tid != ""){
 		root["tid"] = model.tid;
-	} else {
-		root["tid"] = base::format("t%d",TimeHelper::getCurrentTime());
 	}
+//	else {
+//		root["tid"] = base::format("t%d",TimeHelper::getCurrentTime());
+//	}
 	root["type"] = model.type;
 	root["action"] = model.action;
 	if (model.from_id>0){
@@ -61,9 +62,13 @@ TcpModel getTcpModel(byte* inBytes){
 			tcpModel.to_id = root["toId"].asInt();
 		}
 		if (root.isMember("data")){
+			LOGD("tcp model str2 = %s", str);
 			if (root["data"].isInt()){
 				std::string s = std::to_string(root["data"].asInt());
 				tcpModel.data = s.c_str();
+			} else if (root["data"].isString()){
+				std::string s = root["data"].asString();
+				tcpModel.data = s.c_str();
 			} else {
 				tcpModel.json = root["data"];
 			}

+ 8 - 5
src/service/BusinessConfig.h

@@ -65,8 +65,8 @@
 
 #define STORE_MAC_ADDR "mac_addr"
 
-static std::string version = "v2.0.1";
-static int versionNo = 36;
+static std::string versionCode = "v2.0.2";
+static int versionNo = 37;
 static std::string serverIP = "172.28.100.100";
 static std::string tcpIP = "172.28.100.100";
 static int serverHttpPort = 8006;
@@ -93,9 +93,9 @@ static std::string getTcpGateway(){
 }
 
 
-static std::string getVersion() {
-	LOGD("version -> %s",version);
-	return version;
+static std::string getVersionCode() {
+	LOGD("version -> %s",versionCode);
+	return versionCode;
 }
 
 static int getVersionNo() {
@@ -264,6 +264,9 @@ public:
 	inline static int linuxBedGainSize;
 	inline static int linuxDoorVolumeNative;
 	inline static int linuxDoorGainSize;
+    inline static int customerNameHiddenOnDoor;
+    inline static int customerAgeHiddenOnDoor;
+    inline static int clerkNameHiddenOnDoor;
 };
 
 /**

BIN
ui/function.ftu