Change seperator between commands 27/208227/1
authorKiseok Chang <kiso.chang@samsung.com>
Thu, 20 Jun 2019 05:49:42 +0000 (14:49 +0900)
committerKiseok Chang <kiso.chang@samsung.com>
Thu, 20 Jun 2019 05:51:32 +0000 (14:51 +0900)
- ex) setting-cmd ad name --> setting-cmd ad/name

Change-Id: I2b8f5383e20c92a928d5ccb6fc52fbc340624c27
Signed-off-by: Kiseok Chang <kiso.chang@samsung.com>
38 files changed:
LICENSE [changed mode: 0755->0644]
include/settingcmd-debug.h [changed mode: 0755->0644]
packaging/org.tizen.setting-cmd.manifest [changed mode: 0755->0644]
selfreview/check_file.sh [new file with mode: 0755]
src/CMakeLists.txt
src/GenSettingMenu.cpp
src/GenSettingMenu.h
src/SettingCommand.cpp [new file with mode: 0644]
src/SettingCommand.h [new file with mode: 0644]
src/SettingMenu.cpp
src/SettingMenu.h
src/sc_aboutdevice.cpp
src/sc_aboutdevice.h
src/sc_airplane.cpp
src/sc_airplane.h
src/sc_apps.cpp
src/sc_apps.h
src/sc_battery.cpp
src/sc_battery.h
src/sc_bluetooth.cpp
src/sc_bluetooth.h
src/sc_common.cpp
src/sc_common.h
src/sc_datausage.cpp
src/sc_datausage.h
src/sc_datetime.cpp
src/sc_datetime.h
src/sc_display.cpp
src/sc_display.h
src/sc_sound.cpp
src/sc_sound.h
src/sc_storage.cpp
src/sc_storage.h
src/sc_wifi.cpp
src/sc_wifi.h
src/setting_cmd.cpp
src/setting_cmd.h [deleted file]
src/settingcmd_def.h [deleted file]

diff --git a/LICENSE b/LICENSE
old mode 100755 (executable)
new mode 100644 (file)
index 9c13a9b..a06208b
--- a/LICENSE
+++ b/LICENSE
-Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
-\r
-                                 Apache License\r
-                           Version 2.0, January 2004\r
-                        http://www.apache.org/licenses/\r
-\r
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\r
-\r
-   1. Definitions.\r
-\r
-      "License" shall mean the terms and conditions for use, reproduction,\r
-      and distribution as defined by Sections 1 through 9 of this document.\r
-\r
-      "Licensor" shall mean the copyright owner or entity authorized by\r
-      the copyright owner that is granting the License.\r
-\r
-      "Legal Entity" shall mean the union of the acting entity and all\r
-      other entities that control, are controlled by, or are under common\r
-      control with that entity. For the purposes of this definition,\r
-      "control" means (i) the power, direct or indirect, to cause the\r
-      direction or management of such entity, whether by contract or\r
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the\r
-      outstanding shares, or (iii) beneficial ownership of such entity.\r
-\r
-      "You" (or "Your") shall mean an individual or Legal Entity\r
-      exercising permissions granted by this License.\r
-\r
-      "Source" form shall mean the preferred form for making modifications,\r
-      including but not limited to software source code, documentation\r
-      source, and configuration files.\r
-\r
-      "Object" form shall mean any form resulting from mechanical\r
-      transformation or translation of a Source form, including but\r
-      not limited to compiled object code, generated documentation,\r
-      and conversions to other media types.\r
-\r
-      "Work" shall mean the work of authorship, whether in Source or\r
-      Object form, made available under the License, as indicated by a\r
-      copyright notice that is included in or attached to the work\r
-      (an example is provided in the Appendix below).\r
-\r
-      "Derivative Works" shall mean any work, whether in Source or Object\r
-      form, that is based on (or derived from) the Work and for which the\r
-      editorial revisions, annotations, elaborations, or other modifications\r
-      represent, as a whole, an original work of authorship. For the purposes\r
-      of this License, Derivative Works shall not include works that remain\r
-      separable from, or merely link (or bind by name) to the interfaces of,\r
-      the Work and Derivative Works thereof.\r
-\r
-      "Contribution" shall mean any work of authorship, including\r
-      the original version of the Work and any modifications or additions\r
-      to that Work or Derivative Works thereof, that is intentionally\r
-      submitted to Licensor for inclusion in the Work by the copyright owner\r
-      or by an individual or Legal Entity authorized to submit on behalf of\r
-      the copyright owner. For the purposes of this definition, "submitted"\r
-      means any form of electronic, verbal, or written communication sent\r
-      to the Licensor or its representatives, including but not limited to\r
-      communication on electronic mailing lists, source code control systems,\r
-      and issue tracking systems that are managed by, or on behalf of, the\r
-      Licensor for the purpose of discussing and improving the Work, but\r
-      excluding communication that is conspicuously marked or otherwise\r
-      designated in writing by the copyright owner as "Not a Contribution."\r
-\r
-      "Contributor" shall mean Licensor and any individual or Legal Entity\r
-      on behalf of whom a Contribution has been received by Licensor and\r
-      subsequently incorporated within the Work.\r
-\r
-   2. Grant of Copyright License. Subject to the terms and conditions of\r
-      this License, each Contributor hereby grants to You a perpetual,\r
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
-      copyright license to reproduce, prepare Derivative Works of,\r
-      publicly display, publicly perform, sublicense, and distribute the\r
-      Work and such Derivative Works in Source or Object form.\r
-\r
-   3. Grant of Patent License. Subject to the terms and conditions of\r
-      this License, each Contributor hereby grants to You a perpetual,\r
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
-      (except as stated in this section) patent license to make, have made,\r
-      use, offer to sell, sell, import, and otherwise transfer the Work,\r
-      where such license applies only to those patent claims licensable\r
-      by such Contributor that are necessarily infringed by their\r
-      Contribution(s) alone or by combination of their Contribution(s)\r
-      with the Work to which such Contribution(s) was submitted. If You\r
-      institute patent litigation against any entity (including a\r
-      cross-claim or counterclaim in a lawsuit) alleging that the Work\r
-      or a Contribution incorporated within the Work constitutes direct\r
-      or contributory patent infringement, then any patent licenses\r
-      granted to You under this License for that Work shall terminate\r
-      as of the date such litigation is filed.\r
-\r
-   4. Redistribution. You may reproduce and distribute copies of the\r
-      Work or Derivative Works thereof in any medium, with or without\r
-      modifications, and in Source or Object form, provided that You\r
-      meet the following conditions:\r
-\r
-      (a) You must give any other recipients of the Work or\r
-          Derivative Works a copy of this License; and\r
-\r
-      (b) You must cause any modified files to carry prominent notices\r
-          stating that You changed the files; and\r
-\r
-      (c) You must retain, in the Source form of any Derivative Works\r
-          that You distribute, all copyright, patent, trademark, and\r
-          attribution notices from the Source form of the Work,\r
-          excluding those notices that do not pertain to any part of\r
-          the Derivative Works; and\r
-\r
-      (d) If the Work includes a "NOTICE" text file as part of its\r
-          distribution, then any Derivative Works that You distribute must\r
-          include a readable copy of the attribution notices contained\r
-          within such NOTICE file, excluding those notices that do not\r
-          pertain to any part of the Derivative Works, in at least one\r
-          of the following places: within a NOTICE text file distributed\r
-          as part of the Derivative Works; within the Source form or\r
-          documentation, if provided along with the Derivative Works; or,\r
-          within a display generated by the Derivative Works, if and\r
-          wherever such third-party notices normally appear. The contents\r
-          of the NOTICE file are for informational purposes only and\r
-          do not modify the License. You may add Your own attribution\r
-          notices within Derivative Works that You distribute, alongside\r
-          or as an addendum to the NOTICE text from the Work, provided\r
-          that such additional attribution notices cannot be construed\r
-          as modifying the License.\r
-\r
-      You may add Your own copyright statement to Your modifications and\r
-      may provide additional or different license terms and conditions\r
-      for use, reproduction, or distribution of Your modifications, or\r
-      for any such Derivative Works as a whole, provided Your use,\r
-      reproduction, and distribution of the Work otherwise complies with\r
-      the conditions stated in this License.\r
-\r
-   5. Submission of Contributions. Unless You explicitly state otherwise,\r
-      any Contribution intentionally submitted for inclusion in the Work\r
-      by You to the Licensor shall be under the terms and conditions of\r
-      this License, without any additional terms or conditions.\r
-      Notwithstanding the above, nothing herein shall supersede or modify\r
-      the terms of any separate license agreement you may have executed\r
-      with Licensor regarding such Contributions.\r
-\r
-   6. Trademarks. This License does not grant permission to use the trade\r
-      names, trademarks, service marks, or product names of the Licensor,\r
-      except as required for reasonable and customary use in describing the\r
-      origin of the Work and reproducing the content of the NOTICE file.\r
-\r
-   7. Disclaimer of Warranty. Unless required by applicable law or\r
-      agreed to in writing, Licensor provides the Work (and each\r
-      Contributor provides its Contributions) on an "AS IS" BASIS,\r
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\r
-      implied, including, without limitation, any warranties or conditions\r
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\r
-      PARTICULAR PURPOSE. You are solely responsible for determining the\r
-      appropriateness of using or redistributing the Work and assume any\r
-      risks associated with Your exercise of permissions under this License.\r
-\r
-   8. Limitation of Liability. In no event and under no legal theory,\r
-      whether in tort (including negligence), contract, or otherwise,\r
-      unless required by applicable law (such as deliberate and grossly\r
-      negligent acts) or agreed to in writing, shall any Contributor be\r
-      liable to You for damages, including any direct, indirect, special,\r
-      incidental, or consequential damages of any character arising as a\r
-      result of this License or out of the use or inability to use the\r
-      Work (including but not limited to damages for loss of goodwill,\r
-      work stoppage, computer failure or malfunction, or any and all\r
-      other commercial damages or losses), even if such Contributor\r
-      has been advised of the possibility of such damages.\r
-\r
-   9. Accepting Warranty or Additional Liability. While redistributing\r
-      the Work or Derivative Works thereof, You may choose to offer,\r
-      and charge a fee for, acceptance of support, warranty, indemnity,\r
-      or other liability obligations and/or rights consistent with this\r
-      License. However, in accepting such obligations, You may act only\r
-      on Your own behalf and on Your sole responsibility, not on behalf\r
-      of any other Contributor, and only if You agree to indemnify,\r
-      defend, and hold each Contributor harmless for any liability\r
-      incurred by, or claims asserted against, such Contributor by reason\r
-      of your accepting any such warranty or additional liability.\r
-\r
-   END OF TERMS AND CONDITIONS\r
-\r
-   APPENDIX: How to apply the Apache License to your work.\r
-\r
-      To apply the Apache License to your work, attach the following\r
-      boilerplate notice, with the fields enclosed by brackets "[]"\r
-      replaced with your own identifying information. (Don't include\r
-      the brackets!)  The text should be enclosed in the appropriate\r
-      comment syntax for the file format. We also recommend that a\r
-      file or class name and description of purpose be included on the\r
-      same "printed page" as the copyright notice for easier\r
-      identification within third-party archives.\r
-\r
-   Copyright [yyyy] [name of copyright owner]\r
-\r
-   Licensed under the Apache License, Version 2.0 (the "License");\r
-   you may not use this file except in compliance with the License.\r
-   You may obtain a copy of the License at\r
-\r
-       http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-   Unless required by applicable law or agreed to in writing, software\r
-   distributed under the License is distributed on an "AS IS" BASIS,\r
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-   See the License for the specific language governing permissions and\r
-   limitations under the License.\r
-\r
+Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
old mode 100755 (executable)
new mode 100644 (file)
index 5724b3e..29b075f
  * limitations under the License.
  *
  */
-/**
- * @defgroup setting-debug
- * setting debug utility
- */
 
 #ifndef _SETTINGCMD_DEBUG_H_
 #define _SETTINGCMD_DEBUG_H_
 #endif
 
 
-#define LOG_TAG "SETTING"
-#endif
-
-#define USE_TIMER_UPDATE_TIME_IN_TIME_VIEW
-
-#define SECURITY_SERVER                        1
-
-/* launching */
-#ifdef LAUNCHING_DEBUG_LOG
-#define LAUNCH_SETTINGCMD_IN(fmt, arg...)      LOG(LOG_DEBUG, "LAUNCH", \
-               "[setting:Application:%s:IN]" fmt, __FUNCTION__, ##arg)
-#define LAUNCH_SETTINGCMD_OUT(fmt, arg...) LOG(LOG_DEBUG, "LAUNCH", \
-               "[setting:Application:%s:OUT]" fmt, __FUNCTION__, ##arg)
-#else
-#define LAUNCH_SETTINGCMD_IN(fmt, arg...)
-#define LAUNCH_SETTINGCMD_OUT(fmt, arg...)
-#endif
-
-#if !defined(LOCALEDIR)
-#define LOCALEDIR      _TZ_SYS_RO_APP"/org.tizen.setting/res/locale"
-#endif
-
-#if !defined(EDJDIR)
-#define EDJDIR _TZ_SYS_RO_APP"/org.tizen.setting/res/edje"
+#define LOG_TAG "SETTINGCMD"
 #endif
 
 /*macros to control program flow*/
 
-/* Genlist Update is in progress. */
 #define SETTINGCMD_ENABLE_TRACE
 
 #ifdef SETTINGCMD_ENABLE_TRACE
 #define G_FREE(arg) __FREE(g_free, arg)
 
 
+/////////////////////////////////////////////////////////////////////////////////////
+#include <stdio.h>
+
+//#define __SC_DEBUG__
+
+#ifdef __SC_DEBUG__
+#define eprintf(...) fprintf (stderr, __VA_ARGS__)
+#else
+#define eprintf(...) do {} while (0)
+#endif
 
 #endif /* _SETTINGCMD_DEBUG_H_ */
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/selfreview/check_file.sh b/selfreview/check_file.sh
new file mode 100755 (executable)
index 0000000..e12af79
--- /dev/null
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+failed=0
+
+self=`basename $0`
+
+echo "### CRLF Checker Start ###"
+for file in $(grep --exclude-dir=.git --exclude=$self -c "\r" $1 -R)
+do
+       crlf_found=`echo $file | awk 'BEGIN {FS=":"}{print $NF}'`
+
+       if [ $crlf_found -ge 1 ]
+       then
+               echo "CRLF is found" : $file
+               failed=1
+       fi
+done
+echo "### CRLF Checker Stop ###"
+
+echo "### Execute Permission Checker Start ###"
+found=$(find $1 \( ! -name '*.sh' ! -name '*.py' ! -name '*.pl' ! -path '*.git/*' \) -type f -perm /o+x | wc -l)
+
+if [ $found -ge 1 ]
+then
+       find $1 \( ! -name '*.sh' ! -name '*.py' ! -name '*.pl' ! -path '*.git/*' \) -type f -perm /o+x
+       echo "execute file(s) is(are) found"
+       failed=1
+fi
+echo "### Execute Permission Checker Stop ###"
+
+
+echo "### EOF newline Checker Start ###"
+for file in $(find $1 ! -path '*.git/*' -type f)
+do
+       if [ ! -z "$(tail -c 1 "$file")" ]
+       then
+               echo "No EOF Newline : $file"
+               failed=1
+       fi
+done
+echo "### EOF newline Checker Stop ###"
+
+exit $failed
index 49abae0..5b1b30f 100644 (file)
@@ -60,6 +60,7 @@ ADD_DEFINITIONS("-DXP_UNIX")
 SET(BIN_NAME "setting-cmd")
 
 ADD_EXECUTABLE(${BIN_NAME}
+       ./SettingCommand.cpp
        ./SettingMenu.cpp
        ./GenSettingMenu.cpp
        ./setting_cmd.cpp
index 1060db1..4d9b556 100644 (file)
@@ -1,8 +1,8 @@
-#include "GenSettingMenu.h"\r
-#include "sc_common.h"\r
-\r
-using namespace std;\r
-\r
+#include "GenSettingMenu.h"
+#include <settingcmd-debug.h>
+
+using namespace std;
+
 GenSettingMenu::GenSettingMenu(const char * optstr, const char * namestr, MenuFunc funcptr, MenuCreate precreateptr)
        :strOpt(optstr), strName(namestr), ptrFunc(funcptr), ptrPrecreate(precreateptr)
 {
@@ -42,23 +42,23 @@ const char *GenSettingMenu::opt()
 const char *GenSettingMenu::name()
 {
        return strName;
-}\r
-\r
-void GenSettingMenu::addSubmenu(const char * optstr, const char * namestr, MenuFunc funcptr, MenuCreate precreateptr)\r
-{\r
-       subMenus.push_back(new GenSettingMenu(optstr, namestr, funcptr, precreateptr));\r
-}\r
-\r
-void GenSettingMenu::addSubmenu(MenuItem item)\r
-{\r
-       addSubmenu(item.optstr, item.namestr, item.funcptr, item.precreateptr);\r
-}\r
-\r
-void GenSettingMenu::addSubmenus(MenuItem *items, int count)\r
-{\r
-       if (items == nullptr || count < 1)\r
-               return;\r
-\r
-       for (int i = 0; i < count; i++)\r
-               addSubmenu(items[i]);\r
+}
+
+void GenSettingMenu::addSubmenu(const char * optstr, const char * namestr, MenuFunc funcptr, MenuCreate precreateptr)
+{
+       subMenus.push_back(new GenSettingMenu(optstr, namestr, funcptr, precreateptr));
+}
+
+void GenSettingMenu::addSubmenu(MenuItem item)
+{
+       addSubmenu(item.optstr, item.namestr, item.funcptr, item.precreateptr);
+}
+
+void GenSettingMenu::addSubmenus(MenuItem *items, int count)
+{
+       if (items == nullptr || count < 1)
+               return;
+
+       for (int i = 0; i < count; i++)
+               addSubmenu(items[i]);
 }
index 9ae74ff..0a79be4 100644 (file)
@@ -10,11 +10,11 @@ class GenSettingMenu;
 typedef  MENURUN_ERROR (*MenuFunc)(int argc, char *argv[], GenSettingMenu *menu);
 typedef  void (*MenuCreate)(GenSettingMenu  *menu);
 
-typedef struct {\r
-       const char *optstr;\r
-       const char *namestr;\r
-       MenuFunc funcptr;\r
-       MenuCreate precreateptr;\r
+typedef struct {
+       const char *optstr;
+       const char *namestr;
+       MenuFunc funcptr;
+       MenuCreate precreateptr;
 } MenuItem;
 
 
diff --git a/src/SettingCommand.cpp b/src/SettingCommand.cpp
new file mode 100644 (file)
index 0000000..9b936f1
--- /dev/null
@@ -0,0 +1,105 @@
+#include "SettingCommand.h"
+#include <settingcmd-debug.h>
+
+#include <sstream>
+
+using namespace std;
+
+SettingCommand::SettingCommand(string& execstr, string& commandstr)
+{
+       eprintf("Entered into SettingCommand()\n");
+       
+       string token = execstr;
+       stringstream ss_exec(execstr);
+       while (getline(ss_exec, token, '/')) {}
+       settingCommands.push_back(token);
+
+
+       stringstream ss_cmd(commandstr);
+       eprintf("%s  %s (", execstr.c_str(), commandstr.c_str());
+       while (getline(ss_cmd, token, '/')) {
+               eprintf(" %s", token.c_str());
+               settingCommands.push_back(token);
+       }
+       eprintf(")\n");
+
+       curPos = 0;
+}
+
+int SettingCommand::count()
+{
+       return (int)settingCommands.size();
+}
+
+bool SettingCommand::next()
+{
+       int cmdcount = count();
+       if (curPos >= cmdcount - 1) return false;
+       
+       curPos++;
+       return true;
+}
+
+bool SettingCommand::prev()
+{
+       if (curPos <= 0) return false;
+       
+       curPos--;
+       return true;
+}
+
+void SettingCommand::first()
+{
+       curPos = 0;
+}
+
+
+void SettingCommand::last()
+{
+       curPos = 0;
+       
+       int cmdcount = count();
+       if (cmdcount > 0) curPos = cmdcount - 1;
+}
+
+
+string SettingCommand::commands()
+{
+       string wholecommand;
+       int cmdcount = count();
+       if (cmdcount > 0) {
+               wholecommand = settingCommands.at(0);
+               for (int i = 1; i < cmdcount; i++) {
+                       wholecommand += (i == 1)? ' ' : '/';
+                       wholecommand += settingCommands.at(i);
+               }
+       }
+       return wholecommand;
+}
+
+int SettingCommand::curCount()
+{
+       int cmdcount = count();
+       if (cmdcount > 0)
+               return cmdcount - curPos;
+       return 0;
+}
+
+string SettingCommand::curCommand()
+{
+       return settingCommands.at(curPos);
+}
+
+string SettingCommand::curCommands()
+{
+       string curcommand;
+       int cmdcount = count();
+       if (cmdcount > 0) {
+               curcommand = settingCommands.at(0);
+               for (int i = 1; i <= curPos; i++) {
+                       curcommand += (i == 1) ? ' ' : '/';
+                       curcommand += settingCommands.at(i);
+               }
+       }
+       return curcommand;
+}
diff --git a/src/SettingCommand.h b/src/SettingCommand.h
new file mode 100644 (file)
index 0000000..d15bb3a
--- /dev/null
@@ -0,0 +1,30 @@
+#ifndef __SETTINGCOMMAND_H__
+#define __SETTINGCOMMAND_H__
+
+#include <string>
+#include <vector>
+
+class SettingCommand
+{
+public:
+       SettingCommand(std::string& execstr, std::string& commandstr);
+
+public:
+       int count();
+       bool next();
+       bool prev();
+       void first();
+       void last();
+       std::string commands();
+
+       int curCount();
+       std::string curCommand();
+       std::string curCommands();
+
+private:
+       std::vector<std::string> settingCommands;
+       int curPos;
+};
+
+
+#endif // __SETTINGCOMMAND_H__
index 0c59d2e..9740097 100644 (file)
@@ -1,5 +1,5 @@
 #include "SettingMenu.h"
-#include "sc_common.h"
+#include <settingcmd-debug.h>
 
 #include <algorithm>
 #include <list>
@@ -23,44 +23,49 @@ bool SettingMenu::create()
 
 void SettingMenu::destroy()
 {
-       while (!subMenus.empty())\r
-       {\r
-               SettingMenu *menu = subMenus.back();\r
-               menu->destroy();\r
-               delete menu;\r
-               subMenus.pop_back();\r
+       while (!subMenus.empty())
+       {
+               SettingMenu *menu = subMenus.back();
+               menu->destroy();
+               delete menu;
+               subMenus.pop_back();
        }
 }
 
-MENURUN_ERROR SettingMenu::run(string &title, int argc, char *argv[])
+MENURUN_ERROR SettingMenu::run(SettingCommand &settingcmds, string &title, int argc, char *argv[])
 {
        eprintf("run() of %s\n", name());
 
        title += string(" - ") + name();
-
        MENURUN_ERROR result = func(title, argc, argv);
        if (result != MEMUFUNC_ERR_NONE) return result;
 
        if (subMenus.empty()) return MEMUFUNC_ERR_NONE;
 
-       if (argc < 2) {
-               printUsage();
+
+       if (!settingcmds.next()) {
+               printUsage(settingcmds);
                return MEMUFUNC_ERR_ARG_SHORT;
        }
+       string curcmd = settingcmds.curCommand();
        auto it = find_if(subMenus.begin(), subMenus.end(),
                [=](SettingMenu *menu) -> bool {
-                       if (!strcmp(argv[1], menu->opt())) return true;
+                       if (!curcmd.compare(menu->opt())) return true;
                        return false;
                }
        );
        if (it == subMenus.end()) {
-               eprintf("%s is not a valid command.\n\n", argv[1]);
-               printUsage();
+               eprintf("%s is not a valid command.\n\n", curcmd.c_str());
+               printUsage(settingcmds);
+               settingcmds.prev();
                return MEMUFUNC_ERR_ARG_INVAILD;
        }
-       eprintf("command %s is founded.\n", argv[1]);
 
-       return ((*it)->run)(title, argc - 1, &argv[1]);
+       eprintf("command %s is founded.\n", curcmd.c_str());
+
+       result = ((*it)->run)(settingcmds, title, argc, argv);
+       settingcmds.prev();
+       return result;
 }
 
 MENURUN_ERROR SettingMenu::func(string &title, int argc, char *argv[])
@@ -69,12 +74,12 @@ MENURUN_ERROR SettingMenu::func(string &title, int argc, char *argv[])
        return MEMUFUNC_ERR_NONE;
 }
 
-void SettingMenu::printUsage()
+void SettingMenu::printUsage(SettingCommand &settingcmds)
 {
        const char *notimplemented_str = "[Not implemented]";
 
-       printf("Usage : %s [opt]\n", opt());
-       printf("\t[opt] : [Menu]\n");
+       printf("Usage : %s/[opt]\n", settingcmds.curCommands().c_str());
+       printf("\t[opt] : [Functionality]\n");
 
        for_each(subMenus.begin(), subMenus.end(),
                [=](SettingMenu *menu) {
@@ -89,19 +94,22 @@ void SettingMenu::printUsage()
 
 void SettingMenu::printError(MENURUN_ERROR error)
 {
+       printf("[SettingMenu Error] ");
        switch (error) {
        case MEMUFUNC_ERR_NORMAL:
-               eprintf("\tThere's errors during running.\n");
+               printf("Normal error");
                break;
        case MEMUFUNC_ERR_ARG_SHORT:
-               eprintf("\tThis option is short.\n");
+               printf("Lack of arguments");
                break;
        case MEMUFUNC_ERR_ARG_INVAILD:
+               printf("Invalid argument");
                break;
        case MEMUFUNC_ERR_NOTIMPL:
-               eprintf("\tThis option is not implemented yet.\n");
+               printf("Not implemented");
                break;
        default:
                break;
        }
+       printf("\n");
 }
index 26266bb..7985db3 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef __SETTINGMENU_H_
 #define __SETTINGMENU_H_
 
+#include "SettingCommand.h"
+
 #include <string>
 #include <list>
 
@@ -21,7 +23,7 @@ public:
 public:
        virtual bool create();
        virtual void destroy();
-       virtual MENURUN_ERROR run(std::string &title, int argc, char *argv[]);
+       virtual MENURUN_ERROR run(SettingCommand &settingcmds, std::string &title, int argc, char *argv[]);
 
        virtual MENURUN_ERROR func(std::string &title, int argc, char *argv[]);
 
@@ -31,7 +33,7 @@ public:
        virtual const char *opt() = 0;
 
 public:
-       void printUsage();
+       void printUsage(SettingCommand &settingcmds);
        static void printError(MENURUN_ERROR error);
 
 public:
index ebea50a..91e9a51 100644 (file)
@@ -1,5 +1,5 @@
 #include "sc_aboutdevice.h"
-#include "sc_common.h"
+#include <settingcmd-debug.h>
 
 #include <sys/types.h>
 #include <sys/stat.h>
 
 #include <storage.h>
 
-/*---------------------------------------------------------------------------------------------------------------------------*/
-/* These codes are from setting app */
-
-#define SETTING_TRACE(fmt, arg...) do {} while (0)
-#define SETTING_TRACE_SECURE_DEBUG(fmt, arg...) do {} while (0)
-#define SETTING_TRACE_DEBUG(fmt, arg...) do {} while (0)
-#define SETTING_TRACE_WARNING(fmt, arg...) do {} while (0)
-#define SETTING_TRACE_BEGIN do {} while (0)
-#define SETTING_TRACE_END do {} while (0)
-
-#define __FREE(del, arg) do { \
-       if (arg) { \
-               /*cast any argument to (void*) to avoid build warring*/\
-               del((void *)(arg)); \
-               arg = nullptr; \
-       } \
-} while (0)
-#define FREE(arg) __FREE(free, arg)
+#include <settingcmd-debug.h>
+
 
 #define SETTING_ABOUT_POWER_SUPPLY_PATH "/sys/class/power_supply"
 #define SETTING_ABOUT_STAT_PATH "/proc/stat"
@@ -67,7 +51,7 @@ static void __get_phone_model_name(char *szStr, int nSize)
        char *value = nullptr;
        int ret = system_info_get_platform_string(
                        "http://tizen.org/system/model_name", &value);
-       SETTING_TRACE("value : %s", value);
+       SETTINGCMD_TRACE("value : %s", value);
        if (ret != SYSTEM_INFO_ERROR_NONE) {
                eprintf("fail to call system_info_get_platform_string");
                FREE(value);
@@ -627,7 +611,7 @@ MenuItem ad_menulist[] ={
 
 void precreate_ad(GenSettingMenu *menu)
 {
-       eprintf("entered precreate_du\n");
+       eprintf("entered precreate_ad\n");
        menu->destroy();
        menu->addSubmenus(ad_menulist, sizeof(ad_menulist) / sizeof(MenuItem));
 }
index 3b0b912..10dde4a 100644 (file)
@@ -1,9 +1,8 @@
-#ifndef __SC_ABOUTDEVICE_H_\r
-#define __SC_ABOUTDEVICE_H_\r
-\r
-#include "settingcmd_def.h"\r
-#include "GenSettingMenu.h"\r
-\r
-void precreate_ad(GenSettingMenu *menu);\r
-\r
-#endif         /* __SC_ABOUTDEVICE_H_ */\r
+#ifndef __SC_ABOUTDEVICE_H_
+#define __SC_ABOUTDEVICE_H_
+
+#include "GenSettingMenu.h"
+
+void precreate_ad(GenSettingMenu *menu);
+
+#endif         /* __SC_ABOUTDEVICE_H_ */
index 71876af..2ec8b34 100644 (file)
@@ -1,5 +1,5 @@
 #include "sc_airplane.h"
-#include "sc_common.h"
+#include <settingcmd-debug.h>
 
 #include <stdio.h>
 #include <stdlib.h>
index f3152fa..6db89b9 100644 (file)
@@ -1,9 +1,8 @@
 #ifndef __SC_AIRPLANE_H_
 #define __SC_AIRPLANE_H_
 
-#include "settingcmd_def.h"
-#include "GenSettingMenu.h"\r
-\r
+#include "GenSettingMenu.h"
+
 void precreate_am(GenSettingMenu *menu);
 
 #endif         /* __SC_AIRPLANE_H_ */
index 63c18d7..0c9895b 100644 (file)
@@ -1,5 +1,5 @@
 #include "sc_apps.h"
-#include "sc_common.h"
+#include <settingcmd-debug.h>
 
 #include <stdio.h>
 #include <stdlib.h>
index 0b260a6..2a084a9 100644 (file)
@@ -1,9 +1,8 @@
-#ifndef __SC_APPS_H_\r
-#define __SC_APPS_H_\r
-\r
-#include "settingcmd_def.h"\r
-#include "GenSettingMenu.h"\r
-\r
-void precreate_apps(GenSettingMenu *menu);\r
-\r
-#endif         /* __SC_APPS_H_ */\r
+#ifndef __SC_APPS_H_
+#define __SC_APPS_H_
+
+#include "GenSettingMenu.h"
+
+void precreate_apps(GenSettingMenu *menu);
+
+#endif         /* __SC_APPS_H_ */
index 3edb77c..571202e 100644 (file)
@@ -1,5 +1,5 @@
 #include "sc_battery.h"
-#include "sc_common.h"
+#include <settingcmd-debug.h>
 
 #include <stdio.h>
 #include <stdlib.h>
index 32fc47c..c53ebf3 100644 (file)
@@ -1,9 +1,8 @@
-#ifndef __SC_BATTERY_H_\r
-#define __SC_BATTERY_H_\r
-\r
-#include "settingcmd_def.h"\r
-#include "GenSettingMenu.h"\r
-\r
-MENURUN_ERROR menufunc_ba(int argc, char *argv[], GenSettingMenu *menu);\r
-\r
-#endif         /* __SC_BATTERY_H_ */\r
+#ifndef __SC_BATTERY_H_
+#define __SC_BATTERY_H_
+
+#include "GenSettingMenu.h"
+
+MENURUN_ERROR menufunc_ba(int argc, char *argv[], GenSettingMenu *menu);
+
+#endif         /* __SC_BATTERY_H_ */
index fa9d99c..ae03269 100644 (file)
@@ -1,5 +1,5 @@
 #include "sc_bluetooth.h"
-#include "sc_common.h"
+#include <settingcmd-debug.h>
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -21,7 +21,7 @@ static MENURUN_ERROR menufunc_bt_st(int argc, char *argv[], GenSettingMenu *menu
                bt_deinitialize();
                return MEMUFUNC_ERR_NORMAL;
        }
-       bt_deinitialize();\r
+       bt_deinitialize();
 
        printf("\tState : %s\n", (bt_state == BT_ADAPTER_ENABLED) ? "On" : "Off");
     return MEMUFUNC_ERR_NONE;
index 612e5db..a3dc32b 100644 (file)
@@ -1,9 +1,8 @@
 #ifndef __SC_BLUETOOTH_H_
 #define __SC_BLUETOOTH_H_
 
-#include "settingcmd_def.h"
 #include "GenSettingMenu.h"
-\r
+
 void precreate_bt(GenSettingMenu *menu);
 
 #endif         /* __SC_BLUETOOTH_H_ */
index cd18bdf..a033d26 100644 (file)
@@ -1,4 +1,5 @@
 #include "sc_common.h"
+#include <settingcmd-debug.h>
 
 #include <stdio.h>
 #include <string.h>
index 14dbcc2..f4f71a2 100644 (file)
@@ -1,14 +1,14 @@
 #ifndef __SC_COMMON_H_
 #define __SC_COMMON_H_
 
-#include <stdio.h>
-#include "settingcmd_def.h"
+enum profile {
+       MOBILE_PROFILE = 1,
+       WEARABLE_PROFILE,
+       TV_PROFILE,
+       COMMON_PROFILE,
+       MAX_PROFILE
+};
 
-#ifdef __SC_DEBUG__
-#define eprintf(...) fprintf (stderr, __VA_ARGS__)
-#else
-#define eprintf(...) do {} while (0)
-#endif
 
 int getProfile();
 #endif /* __SC_COMMON_H_ */
index 1601ccc..fe86c08 100644 (file)
@@ -1,5 +1,5 @@
 #include "sc_datausage.h"
-#include "sc_common.h"
+#include <settingcmd-debug.h>
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <app_preference.h>
 #include <stc_internal.h>
 
-#define TH_POSTFIX_IDX 0
+#include <settingcmd-debug.h>
 
-/*---------------------------------------------------------------------------------------------------------------------------*/
-/* These codes are from setting app */
-
-#define SETTING_TRACE(fmt, arg...) do {} while (0)
-#define SETTING_TRACE_SECURE_DEBUG(fmt, arg...) do {} while (0)
-#define SETTING_TRACE_DEBUG(fmt, arg...) do {} while (0)
-//#define SETTING_TRACE_DEBUG(fmt, arg...) do { printf(fmt,##arg); printf("\n");} while (0)
-#define SETTING_TRACE_WARNING(fmt, arg...) do {} while (0)
-#define SETTING_TRACE_ERROR(fmt, arg...) do {} while (0)
-//#define SETTING_TRACE_ERROR(fmt, arg...) do { printf(fmt,##arg); printf("\n");} while (0)
-#define SETTING_TRACE_BEGIN do {} while (0)
-#define SETTING_TRACE_END do {} while (0)
-
-#define __FREE(del, arg) do { \
-       if (arg) { \
-               /*cast any argument to (void*) to avoid build warring*/\
-               del((void *)(arg)); \
-               arg = nullptr; \
-       } \
-} while (0)
-#define FREE(arg) __FREE(free, arg)
+#define TH_POSTFIX_IDX 0
 
 static GMainLoop* multi_main_loop = nullptr;
 typedef enum {
@@ -265,7 +245,7 @@ static bool _create_stats_list(stc_h stc, stc_iface_type_e iface,
 
        int ret = stc_stats_rule_create(stc, &rule);
        if (ret != STC_ERROR_NONE) {
-               SETTING_TRACE_ERROR("stc_stats_rule_create() error: %s",
+               SETTINGCMD_TRACE_ERROR("stc_stats_rule_create() error: %s",
                                                        get_error_message(ret));
                stc_stats_rule_destroy(rule);
                return true;
@@ -273,7 +253,7 @@ static bool _create_stats_list(stc_h stc, stc_iface_type_e iface,
 
        ret = stc_stats_rule_set_time_interval(rule, t_from, t_to);
        if (ret != STC_ERROR_NONE) {
-               SETTING_TRACE_ERROR("stc_stats_rule_set_time_interval() error: %s",
+               SETTINGCMD_TRACE_ERROR("stc_stats_rule_set_time_interval() error: %s",
                                                        get_error_message(ret));
                stc_stats_rule_destroy(rule);
                return true;
@@ -281,17 +261,17 @@ static bool _create_stats_list(stc_h stc, stc_iface_type_e iface,
 
        ret = stc_stats_rule_set_iface_type(rule, iface);
        if (ret != STC_ERROR_NONE) {
-               SETTING_TRACE_ERROR("stc_stats_rule_set_iface_type() error: %s",
+               SETTINGCMD_TRACE_ERROR("stc_stats_rule_set_iface_type() error: %s",
                                                        get_error_message(ret));
                stc_stats_rule_destroy(rule);
                return true;
        }
 
-       SETTING_TRACE_DEBUG("\033[1;33mObtaining per app data usage for ifce: %d",
+       SETTINGCMD_TRACE_DEBUG("\033[1;33mObtaining per app data usage for ifce: %d",
                iface);
        ret = stc_foreach_stats(stc, rule, stats_cb, cb_data);
        if (ret != STC_ERROR_NONE) {
-               SETTING_TRACE_ERROR("stc_get_stats() error: %s",
+               SETTINGCMD_TRACE_ERROR("stc_get_stats() error: %s",
                                                        get_error_message(ret));
                if (STC_ERROR_IN_PROGRESS == ret) {
                        stc_stats_rule_destroy(rule);
@@ -315,14 +295,14 @@ static bool _get_total_stats(stc_h stc, stc_iface_type_e iface_type,
 
        ret = stc_stats_rule_create(stc, &rule);
        if (ret != STC_ERROR_NONE) {
-               SETTING_TRACE_ERROR("stc_stats_rule_create() error: %s",
+               SETTINGCMD_TRACE_ERROR("stc_stats_rule_create() error: %s",
                                                        get_error_message(ret));
                return true;
        }
 
        ret = stc_stats_rule_set_time_interval(rule, t_from, t_to);
        if (ret != STC_ERROR_NONE) {
-               SETTING_TRACE_ERROR("stc_stats_rule_set_time_interval() error: %s",
+               SETTINGCMD_TRACE_ERROR("stc_stats_rule_set_time_interval() error: %s",
                                                        get_error_message(ret));
                (void)stc_stats_rule_destroy(rule);
                return true;
@@ -330,17 +310,17 @@ static bool _get_total_stats(stc_h stc, stc_iface_type_e iface_type,
 
        ret = stc_stats_rule_set_iface_type(rule, iface_type);
        if (ret != STC_ERROR_NONE) {
-               SETTING_TRACE_ERROR("stc_stats_rule_set_iface_type() error: %s",
+               SETTINGCMD_TRACE_ERROR("stc_stats_rule_set_iface_type() error: %s",
                                                        get_error_message(ret));
                (void)stc_stats_rule_destroy(rule);
                return true;
        }
 
-       SETTING_TRACE_DEBUG("\033[1;34mObtaining total stats for ifce: %d",
+       SETTINGCMD_TRACE_DEBUG("\033[1;34mObtaining total stats for ifce: %d",
                iface_type);
        ret = stc_get_total_stats(stc, rule, stats_cb, cb_data);
        if (ret != STC_ERROR_NONE) {
-               SETTING_TRACE_ERROR("stc_get_total_stats() error: %s",
+               SETTINGCMD_TRACE_ERROR("stc_get_total_stats() error: %s",
                                                get_error_message(ret));
                (void)stc_stats_rule_destroy(rule);
                if (STC_ERROR_IN_PROGRESS == ret)
@@ -362,7 +342,7 @@ static bool _get_restrictions(stc_h stc, stc_iface_type_e iface_type,
 
        ret = stc_restriction_rule_create(stc, &rule);
        if (STC_ERROR_NONE != ret) {
-               SETTING_TRACE_ERROR("stc_restriction_rule_create() error: %s",
+               SETTINGCMD_TRACE_ERROR("stc_restriction_rule_create() error: %s",
                                                        get_error_message(ret));
                return true;
        }
@@ -373,7 +353,7 @@ static bool _get_restrictions(stc_h stc, stc_iface_type_e iface_type,
                ret = stc_restriction_rule_set_app_id(rule, "TOTAL_WIFI");
 
        if (STC_ERROR_NONE != ret) {
-               SETTING_TRACE_ERROR("stc_restriction_rule_set_app_id() error: %s",
+               SETTINGCMD_TRACE_ERROR("stc_restriction_rule_set_app_id() error: %s",
                                                        get_error_message(ret));
                stc_restriction_rule_destroy(rule);
                return true;
@@ -381,18 +361,18 @@ static bool _get_restrictions(stc_h stc, stc_iface_type_e iface_type,
 
        ret = stc_restriction_rule_set_iface_type(rule, iface_type);
        if (STC_ERROR_NONE != ret) {
-               SETTING_TRACE_ERROR("stc_restriction_rule_get_iface_type() error: %s",
+               SETTINGCMD_TRACE_ERROR("stc_restriction_rule_get_iface_type() error: %s",
                                                        get_error_message(ret));
                stc_restriction_rule_destroy(rule);
                return true;
        }
 
-       SETTING_TRACE_DEBUG("\033[1;35mObtaining restrictions for iface: %d",
+       SETTINGCMD_TRACE_DEBUG("\033[1;35mObtaining restrictions for iface: %d",
                iface_type);
        ret = stc_foreach_restriction(stc, rule, restrictions_cb,
                                                                        restriction_info_cb_data);
        if (STC_ERROR_NONE != ret) {
-               SETTING_TRACE_ERROR("SIM stc_foreach_restriction() error: %s",
+               SETTINGCMD_TRACE_ERROR("SIM stc_foreach_restriction() error: %s",
                                                        get_error_message(ret));
                (void)stc_restriction_rule_destroy(rule);
                if (STC_ERROR_IN_PROGRESS == ret)
@@ -411,7 +391,7 @@ bool get_subscriber_id_from_telephony_handle(telephony_h handle,
 
        ret = telephony_sim_get_subscriber_id(handle, subscriber_id);
        if (TELEPHONY_ERROR_NONE != ret) {
-               SETTING_TRACE_ERROR("telephony_sim_get_msin(%p) %s",
+               SETTINGCMD_TRACE_ERROR("telephony_sim_get_msin(%p) %s",
                                                        handle, get_error_message(ret));
                return false;
        }
@@ -454,13 +434,13 @@ restrictions_result set_mobile_restriction_rule_parameters(
                                                                                        int64_t limit,
                                                                                        int64_t warning_limit)
 {
-       SETTING_TRACE_BEGIN;
+       SETTINGCMD_TRACE_BEGIN;
        int ret = STC_ERROR_NONE;
 
        ret = stc_restriction_rule_set_app_id(rule, "TOTAL_DATACALL");
        if (STC_ERROR_NONE != ret) {
                (void)stc_restriction_rule_destroy(rule);
-               SETTING_TRACE_ERROR("stc_restriction_rule_set_app_id() error: %s",
+               SETTINGCMD_TRACE_ERROR("stc_restriction_rule_set_app_id() error: %s",
                                                                                        get_error_message(ret));
                return RESTRICTIONS_ERROR;
        }
@@ -468,7 +448,7 @@ restrictions_result set_mobile_restriction_rule_parameters(
        ret = stc_restriction_rule_set_iface_type(rule, STC_IFACE_DATACALL);
        if (STC_ERROR_NONE != ret) {
                (void)stc_restriction_rule_destroy(rule);
-               SETTING_TRACE_ERROR("stc_restriction_rule_set_iface_type() error: %s",
+               SETTINGCMD_TRACE_ERROR("stc_restriction_rule_set_iface_type() error: %s",
                                                                                        get_error_message(ret));
                return RESTRICTIONS_ERROR;
        }
@@ -476,7 +456,7 @@ restrictions_result set_mobile_restriction_rule_parameters(
        ret = stc_restriction_rule_set_subscriber_id(rule, subscriber_id);
        if (STC_ERROR_NONE != ret) {
                (void)stc_restriction_rule_destroy(rule);
-               SETTING_TRACE_ERROR("stc_restriction_rule_set_subscriber_id() error:"\
+               SETTINGCMD_TRACE_ERROR("stc_restriction_rule_set_subscriber_id() error:"\
                                                        "%s", get_error_message(ret));
 
                return RESTRICTIONS_ERROR;
@@ -485,7 +465,7 @@ restrictions_result set_mobile_restriction_rule_parameters(
        ret = stc_restriction_rule_set_limit(rule, limit);
        if (STC_ERROR_NONE != ret) {
                (void)stc_restriction_rule_destroy(rule);
-               SETTING_TRACE_ERROR("stc_restriction_rule_set_limit() error: %s",
+               SETTINGCMD_TRACE_ERROR("stc_restriction_rule_set_limit() error: %s",
                                                                                        get_error_message(ret));
                return RESTRICTIONS_ERROR;
        }
@@ -493,27 +473,27 @@ restrictions_result set_mobile_restriction_rule_parameters(
        ret = stc_restriction_rule_set_warning_limit(rule, warning_limit);
        if (STC_ERROR_NONE != ret) {
                (void)stc_restriction_rule_destroy(rule);
-               SETTING_TRACE_ERROR(
+               SETTINGCMD_TRACE_ERROR(
                        "stc_restriction_rule_set_warning_limit() error: %s",
                        get_error_message(ret));
                return RESTRICTIONS_ERROR;
        }
 
-       SETTING_TRACE_END;
+       SETTINGCMD_TRACE_END;
        return RESTRICTIONS_OK;
 }
 
 restrictions_result set_mobile_limit_restrictions(stc_h stc_handle,
                const char *subscriber_id, int64_t limit, int64_t warning_limit)
 {
-       SETTING_TRACE_BEGIN;
+       SETTINGCMD_TRACE_BEGIN;
        int ret = STC_ERROR_NONE;
        stc_restriction_rule_h rule = nullptr;
        restrictions_result result = RESTRICTIONS_OK;
 
        ret = stc_restriction_rule_create(stc_handle, &rule);
        if (STC_ERROR_NONE != ret) {
-               SETTING_TRACE_ERROR("stc_restriction_rule_create() error: %s",
+               SETTINGCMD_TRACE_ERROR("stc_restriction_rule_create() error: %s",
                                                                        get_error_message(ret));
                return RESTRICTIONS_ERROR;
        }
@@ -521,20 +501,20 @@ restrictions_result set_mobile_limit_restrictions(stc_h stc_handle,
        result = set_mobile_restriction_rule_parameters(rule, subscriber_id, limit,
                                                                                                        warning_limit);
        if (RESTRICTIONS_OK != result) {
-               SETTING_TRACE_ERROR("set_restriction_rule_parameters() error");
+               SETTINGCMD_TRACE_ERROR("set_restriction_rule_parameters() error");
                return result;
        }
 
        ret = stc_set_restriction(stc_handle, rule);
        if (STC_ERROR_NONE != ret) {
                (void)stc_restriction_rule_destroy(rule);
-               SETTING_TRACE_ERROR("stc_set_restriction() error: %s",
+               SETTINGCMD_TRACE_ERROR("stc_set_restriction() error: %s",
                                                                                        get_error_message(ret));
                return RESTRICTIONS_ERROR;
        }
 
        (void)stc_restriction_rule_destroy(rule);
-       SETTING_TRACE_END;
+       SETTINGCMD_TRACE_END;
        return RESTRICTIONS_OK;
 }
 
@@ -560,7 +540,7 @@ static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
        restrictions_result restrictions_res = RESTRICTIONS_ERROR;
 
        if (!user_data) {
-               SETTING_TRACE_ERROR("_get_restrictions_to_unset_cb error: user_data == nullptr");
+               SETTINGCMD_TRACE_ERROR("_get_restrictions_to_unset_cb error: user_data == nullptr");
                g_main_loop_quit(multi_main_loop);
                return STC_CALLBACK_CONTINUE;
        }
@@ -568,9 +548,9 @@ static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
 
        stc_h stc = *((stc_h *)user_data);
 
-       SETTING_TRACE_DEBUG("_get_restrictions_to_unset_cb:");
+       SETTINGCMD_TRACE_DEBUG("_get_restrictions_to_unset_cb:");
        if (STC_ERROR_NONE != result) {
-               SETTING_TRACE_ERROR("_get_restrictions_to_unset_cb error: %s",
+               SETTINGCMD_TRACE_ERROR("_get_restrictions_to_unset_cb error: %s",
                                                        get_error_message(result));
                g_main_loop_quit(multi_main_loop);
                return STC_CALLBACK_CONTINUE;
@@ -587,7 +567,7 @@ static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
 
        ret = stc_restriction_rule_get_type(rule, &type);
        if (STC_ERROR_NONE != ret) {
-               SETTING_TRACE_ERROR("stc_restriction_rule_get_type error: %s",
+               SETTINGCMD_TRACE_ERROR("stc_restriction_rule_get_type error: %s",
                                                        get_error_message(ret));
                g_main_loop_quit(multi_main_loop);
                return STC_CALLBACK_CONTINUE;
@@ -595,7 +575,7 @@ static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
 
        ret = stc_restriction_rule_get_iface_type(rule, &iface_type);
        if (STC_ERROR_NONE != ret) {
-               SETTING_TRACE_ERROR("stc_restriction_rule_get_iface_type error: %s",
+               SETTINGCMD_TRACE_ERROR("stc_restriction_rule_get_iface_type error: %s",
                                                        get_error_message(ret));
                g_main_loop_quit(multi_main_loop);
                return STC_CALLBACK_CONTINUE;
@@ -608,7 +588,7 @@ static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
 
        ret = stc_restriction_rule_get_subscriber_id(rule, &subscriber_id);
        if (STC_ERROR_NONE != ret) {
-               SETTING_TRACE_ERROR("stc_restriction_rule_get_subscriber_id error: %s",
+               SETTINGCMD_TRACE_ERROR("stc_restriction_rule_get_subscriber_id error: %s",
                        get_error_message(ret));
                g_main_loop_quit(multi_main_loop);
                return STC_CALLBACK_CONTINUE;
@@ -616,7 +596,7 @@ static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
 
        ret = stc_restriction_rule_get_limit(rule, &limit);
        if (STC_ERROR_NONE != ret) {
-               SETTING_TRACE_ERROR("stc_restriction_rule_get_limit() error: %s",
+               SETTINGCMD_TRACE_ERROR("stc_restriction_rule_get_limit() error: %s",
                        get_error_message(ret));
                free(subscriber_id);
                g_main_loop_quit(multi_main_loop);
@@ -625,7 +605,7 @@ static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
 
        ret = stc_restriction_rule_get_warning_limit(rule, &warning_limit);
        if (STC_ERROR_NONE != ret) {
-               SETTING_TRACE_ERROR(
+               SETTINGCMD_TRACE_ERROR(
                        "stc_restriction_rule_get_warning_limit() error: %s",
                        get_error_message(ret));
                free(subscriber_id);
@@ -635,7 +615,7 @@ static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
 
        ret = stc_restriction_rule_create(stc, &mobile_rule);
        if (STC_ERROR_NONE != ret) {
-               SETTING_TRACE_ERROR("stc_restriction_rule_create() error: %s",
+               SETTINGCMD_TRACE_ERROR("stc_restriction_rule_create() error: %s",
                                                                        get_error_message(ret));
                free(subscriber_id);
                g_main_loop_quit(multi_main_loop);
@@ -645,7 +625,7 @@ static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
        restrictions_res = set_mobile_restriction_rule_parameters(mobile_rule,
                subscriber_id, limit, warning_limit);
        if (restrictions_res != RESTRICTIONS_OK) {
-               SETTING_TRACE_ERROR(
+               SETTINGCMD_TRACE_ERROR(
                        "set_mobile_restriction_rule_parameters() error");
                free(subscriber_id);
                g_main_loop_quit(multi_main_loop);
@@ -654,7 +634,7 @@ static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
 
        ret = stc_unset_restriction(stc, mobile_rule);
        if (STC_ERROR_NONE != ret) {
-               SETTING_TRACE_ERROR("stc_unset_restriction() error: %s",
+               SETTINGCMD_TRACE_ERROR("stc_unset_restriction() error: %s",
                                                                        get_error_message(ret));
                free(subscriber_id);
                g_main_loop_quit(multi_main_loop);
@@ -662,7 +642,7 @@ static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
        }
        free(subscriber_id);
 
-       SETTING_TRACE_ERROR(
+       SETTINGCMD_TRACE_ERROR(
                "stc_unset_restriction() successful unset restriction");
        g_main_loop_quit(multi_main_loop);
        return STC_CALLBACK_CONTINUE;
@@ -723,7 +703,7 @@ static void _set_stats_time_frame_from_cycle(Data_Limits_T *limits)
                break;
        case CYCLE_MODE_CUSTOM:
                if (limits->custom_mode_interval <= 0) {
-                       SETTING_TRACE_ERROR("Error: custom mode interval is %d",
+                       SETTINGCMD_TRACE_ERROR("Error: custom mode interval is %d",
                                                                limits->custom_mode_interval);
                        return;
                }
@@ -751,23 +731,23 @@ static stc_callback_ret_e _total_stats_cb(stc_error_e result,
        int ret = STC_ERROR_NONE;
        stc_iface_type_e iface_type = STC_IFACE_UNKNOWN;
 
-       SETTING_TRACE_DEBUG("total stats cb, looking for subscriber id: %s",
+       SETTINGCMD_TRACE_DEBUG("total stats cb, looking for subscriber id: %s",
                                                subscriber_id_to_look_for);
 
        if (STC_ERROR_NONE != result) {
-               SETTING_TRACE_ERROR("Error in cb: %s", get_error_message(result));
+               SETTINGCMD_TRACE_ERROR("Error in cb: %s", get_error_message(result));
                g_main_loop_quit(multi_main_loop);
                return STC_CALLBACK_CANCEL;
        }
 
        ret = stc_stats_info_get_iface_type(info, &iface_type);
        if (STC_ERROR_NONE != ret) {
-               SETTING_TRACE_ERROR("get interface error: %s", get_error_message(ret));
+               SETTINGCMD_TRACE_ERROR("get interface error: %s", get_error_message(ret));
                eprintf(" There is no data usage.\n");
                g_main_loop_quit(multi_main_loop);
                return STC_CALLBACK_CANCEL;
        }
-       SETTING_TRACE_DEBUG("Obtained iface: %d", iface_type);
+       SETTINGCMD_TRACE_DEBUG("Obtained iface: %d", iface_type);
        ret = stc_stats_info_get_counter(info, &incoming, &outgoing);
 
        if (STC_ERROR_NONE == ret) {
@@ -779,11 +759,11 @@ static stc_callback_ret_e _total_stats_cb(stc_error_e result,
                                                                                subscriber_id_to_look_for)
                                ) {
 
-                               SETTING_TRACE_DEBUG("Obtained SUBSCRIBER ID: %s",
+                               SETTINGCMD_TRACE_DEBUG("Obtained SUBSCRIBER ID: %s",
                                                                        subscriber_id);
                                printf(" total in: %lld byte out: %lld byte\n", incoming, outgoing);
                        } else {
-                               SETTING_TRACE_ERROR("stc_stats_info_get_subscriber_id() error: %s",
+                               SETTINGCMD_TRACE_ERROR("stc_stats_info_get_subscriber_id() error: %s",
                                                                                        get_error_message(ret));
                        }
                        free(subscriber_id);
@@ -793,7 +773,7 @@ static stc_callback_ret_e _total_stats_cb(stc_error_e result,
                        printf(" total in: %lld byte out: %lld byte\n", incoming, outgoing);
                }
        } else {
-               SETTING_TRACE_ERROR("get counter error: %s", get_error_message(ret));
+               SETTINGCMD_TRACE_ERROR("get counter error: %s", get_error_message(ret));
                g_main_loop_quit(multi_main_loop);
                return STC_CALLBACK_CANCEL;
        }
@@ -801,100 +781,6 @@ static stc_callback_ret_e _total_stats_cb(stc_error_e result,
        return STC_CALLBACK_CONTINUE;
 }
 
-static MENURUN_ERROR menufunc_du_mo(int argc, char *argv[], GenSettingMenu *menu)
-{
-       telephony_handle_list_s tel_h_list;
-       telephony_sim_state_e sim_state = TELEPHONY_SIM_STATE_UNKNOWN;
-       stc_h stc;
-       int ret = 0;
-       if (telephony_init(&tel_h_list) != TELEPHONY_ERROR_NONE) {
-               eprintf("telephony_init failed");
-               return MEMUFUNC_ERR_NORMAL;
-       }
-
-       if (tel_h_list.count < 0) {
-               printf("\tThere is no SIM card\n");
-               if (telephony_deinit(&tel_h_list) != TELEPHONY_ERROR_NONE) {
-                       eprintf("telephony_deinit failed");
-                       return MEMUFUNC_ERR_NORMAL;
-               }
-               return MEMUFUNC_ERR_NORMAL;
-       }
-
-       printf("First argument = cycle mode, below.\n");
-       printf("CYCLE_MODE_MONTHLY = 0\n");
-       printf("CYCLE_MODE_WEEKLY = 1\n");
-       printf("CYCLE_MODE_DAILY = 2\n");
-       printf("CYCLE_MODE_CUSTOM = 3\n\n");
-
-       printf("Second argument = start date (monthly, weekly, daily)\n \t\t\t or interval(custom 1 to 90)\n\n");
-
-       if (argc<2) {
-               eprintf("Too short to execute this function\n");
-               return MEMUFUNC_ERR_ARG_SHORT;
-       }
-
-       int cycle = atoi(argv[1]);
-       int start_interval = atoi(argv[2]);
-
-       for (int i = 0; i<2; i++) {
-               _initialize_cycle(&sim_limits[i]);
-
-               sim_limits[i].cycle_mode = (Cycle_Mode_E) cycle;
-               if (cycle != CYCLE_MODE_CUSTOM) {
-                       sim_limits[i].cycle_start = start_interval;
-               } else {
-                       sim_limits[i].custom_mode_interval = start_interval;
-               }
-               _set_stats_time_frame_from_cycle(&sim_limits[i]);
-       }
-
-       ret = stc_initialize(&stc);
-       if (ret != STC_ERROR_NONE) {
-               eprintf("stc_initialize() error: %s\n", get_error_message(ret));
-               return MEMUFUNC_ERR_NORMAL;
-       }
-       int available_sim = 0;
-       char *subscriber_id[2]; /* Subscriber ID numbers of sim cards*/
-
-
-       for (int i = 0; i < tel_h_list.count ; i++) {
-               ret = telephony_sim_get_state(tel_h_list.handle[i], &sim_state);
-               if (TELEPHONY_ERROR_NONE == ret &&
-                               TELEPHONY_SIM_STATE_AVAILABLE == sim_state) {
-                       available_sim++;
-
-                       ret = get_subscriber_id_from_telephony_handle(
-                                               tel_h_list.handle[i], &subscriber_id[i]);
-
-                       if (ret == 0) {
-                               eprintf("get_subscriber_id_from_telephony_handle error! sim(%d) %d\n", i, ret);
-                               continue;
-                       }
-
-                       multi_main_loop = g_main_loop_new(nullptr, FALSE);
-                       sim_limits[i].total_data_used = 0;
-                       get_sim_total_stats(stc,
-                                                               _total_stats_cb, subscriber_id[i],
-                                                                       sim_limits[i].interval_from,
-                                                                       sim_limits[i].interval_to);
-                       printf("SIM %d ", i+1);
-                       g_main_loop_run(multi_main_loop);
-                       if (subscriber_id[i]){
-                               free(subscriber_id[i]);
-                               subscriber_id[i] = 0;
-                       }
-               }
-       }
-
-       stc_deinitialize(stc);
-       if (telephony_deinit(&tel_h_list) != TELEPHONY_ERROR_NONE) {
-               eprintf("telephony_deinit failed");
-               return MEMUFUNC_ERR_NORMAL;
-       }
-
-       return MEMUFUNC_ERR_NONE;
-}
 
 
 static stc_callback_ret_e _get_restrictions_cb(stc_error_e result,
@@ -907,9 +793,9 @@ static stc_callback_ret_e _get_restrictions_cb(stc_error_e result,
        stc_iface_type_e iface_type = STC_IFACE_UNKNOWN;
        stc_restriction_type_e type = STC_RSTN_TYPE_UNKNOWN;
 
-       SETTING_TRACE_DEBUG("restriction cb:");
+       SETTINGCMD_TRACE_DEBUG("restriction cb:");
        if (STC_ERROR_NONE != result) {
-               SETTING_TRACE_ERROR("_get_restrictions_cb error: %s",
+               SETTINGCMD_TRACE_ERROR("_get_restrictions_cb error: %s",
                                                        get_error_message(result));
                g_main_loop_quit(multi_main_loop);
                return STC_CALLBACK_CONTINUE;
@@ -922,25 +808,25 @@ static stc_callback_ret_e _get_restrictions_cb(stc_error_e result,
                g_main_loop_quit(multi_main_loop);
                return STC_CALLBACK_CONTINUE;
        }
-       SETTING_TRACE_DEBUG("Obtaining restrictions for: %s", app_id);
+       SETTINGCMD_TRACE_DEBUG("Obtaining restrictions for: %s", app_id);
        free(app_id);
 
        ret = stc_restriction_rule_get_type(rule, &type);
        if (STC_ERROR_NONE != ret) {
-               SETTING_TRACE_ERROR("stc_restriction_rule_get_type error: %s",
+               SETTINGCMD_TRACE_ERROR("stc_restriction_rule_get_type error: %s",
                                                        get_error_message(ret));
                g_main_loop_quit(multi_main_loop);
                return STC_CALLBACK_CONTINUE;
        }
 
        (void)stc_restriction_rule_get_iface_type(rule, &iface_type);
-       SETTING_TRACE_DEBUG("Obtained iface: %d", iface_type);
+       SETTINGCMD_TRACE_DEBUG("Obtained iface: %d", iface_type);
        if (iface_type == STC_IFACE_DATACALL) {
 
                ret = stc_restriction_rule_get_subscriber_id(rule, &subscriber_id);
 
                if (STC_ERROR_NONE == ret) {
-                       SETTING_TRACE_DEBUG("Obtained Subscriber ID: %s", subscriber_id);
+                       SETTINGCMD_TRACE_DEBUG("Obtained Subscriber ID: %s", subscriber_id);
                        int64_t limit_size = 0;
                        int64_t warning_size = 0;
                        stc_restriction_rule_get_limit(rule, &limit_size);
@@ -956,7 +842,7 @@ static stc_callback_ret_e _get_restrictions_cb(stc_error_e result,
                        printf("\t   warning_size : %s %s\n", buf, unit_s);
                        SIM++;
                } else {
-                       SETTING_TRACE_ERROR("stc_stats_rule_get_subscriber_id() error: %s",
+                       SETTINGCMD_TRACE_ERROR("stc_stats_rule_get_subscriber_id() error: %s",
                                                                                get_error_message(ret));
                }
                free(subscriber_id);
@@ -999,20 +885,21 @@ static MENURUN_ERROR menufunc_du_gmwl(int argc, char *argv[], GenSettingMenu *me
 
 static MENURUN_ERROR menufunc_du_smwl(int argc, char *argv[], GenSettingMenu *menu)
 {
-       telephony_handle_list_s tel_h_list;
-       telephony_sim_state_e sim_state = TELEPHONY_SIM_STATE_UNKNOWN;
-       stc_h stc;
-       int ret = 0;
+       if (argc < 2) {
+               eprintf("Too short to execute this menu\n");
 
-       printf("First argument = warning(MB)\n");
-       printf("Second argument = limit(MB)\n");
-       printf("Zero MB means None\n");
+               printf("First argument = warning(MB)\n");
+               printf("Second argument = limit(MB)\n");
+               printf("Zero MB means None\n");
 
-       if (argc<2) {
-               eprintf("Too short to execute this menu\n");
                return MEMUFUNC_ERR_ARG_SHORT;
        }
 
+       telephony_handle_list_s tel_h_list;
+       telephony_sim_state_e sim_state = TELEPHONY_SIM_STATE_UNKNOWN;
+       stc_h stc;
+       int ret = 0;
+
        int64_t warning = atoi(argv[1])*1024*1024;
        int64_t limit = atoi(argv[2])*1024*1024;
 
@@ -1082,24 +969,126 @@ static MENURUN_ERROR menufunc_du_smwl(int argc, char *argv[], GenSettingMenu *me
        return MEMUFUNC_ERR_NONE;
 }
 
-static MENURUN_ERROR menufunc_du_wi(int argc, char *argv[], GenSettingMenu *menu)
+static MENURUN_ERROR menufunc_du_mo(int argc, char *argv[], GenSettingMenu *menu)
 {
+       eprintf("[menufunc_du_mo] arguments %d : %s %s\n", argc, argv[0], argv[1]);
+
+       if (argc < 2) {
+               eprintf("Too short to execute this function\n");
+
+               printf("First argument = cycle mode, below.\n");
+               printf("CYCLE_MODE_MONTHLY = 0\n");
+               printf("CYCLE_MODE_WEEKLY = 1\n");
+               printf("CYCLE_MODE_DAILY = 2\n");
+               printf("CYCLE_MODE_CUSTOM = 3\n\n");
+
+               printf("Second argument = start date (monthly, weekly, daily)\n \t\t\t or interval(custom 1 to 90)\n\n");
+
+               return MEMUFUNC_ERR_ARG_SHORT;
+       }
+
+       telephony_handle_list_s tel_h_list;
+       telephony_sim_state_e sim_state = TELEPHONY_SIM_STATE_UNKNOWN;
        stc_h stc;
        int ret = 0;
+       if (telephony_init(&tel_h_list) != TELEPHONY_ERROR_NONE) {
+               eprintf("telephony_init failed");
+               return MEMUFUNC_ERR_NORMAL;
+       }
 
-       printf("First argument = cycle mode, below.\n");
-       printf("CYCLE_MODE_MONTHLY = 0\n");
-       printf("CYCLE_MODE_WEEKLY = 1\n");
-       printf("CYCLE_MODE_DAILY = 2\n");
-       printf("CYCLE_MODE_CUSTOM = 3\n\n");
+       if (tel_h_list.count < 0) {
+               printf("\tThere is no SIM card\n");
+               if (telephony_deinit(&tel_h_list) != TELEPHONY_ERROR_NONE) {
+                       eprintf("telephony_deinit failed");
+                       return MEMUFUNC_ERR_NORMAL;
+               }
+               return MEMUFUNC_ERR_NORMAL;
+       }
 
-       printf("Second argument = start date (monthly, weekly, daily)\n \t\t\t or interval(custom 1 to 90)\n\n");
+       int cycle = atoi(argv[1]);
+       int start_interval = atoi(argv[2]);
+
+       for (int i = 0; i < 2; i++) {
+               _initialize_cycle(&sim_limits[i]);
+
+               sim_limits[i].cycle_mode = (Cycle_Mode_E)cycle;
+               if (cycle != CYCLE_MODE_CUSTOM) {
+                       sim_limits[i].cycle_start = start_interval;
+               }
+               else {
+                       sim_limits[i].custom_mode_interval = start_interval;
+               }
+               _set_stats_time_frame_from_cycle(&sim_limits[i]);
+       }
 
-       if (argc<2) {
+       ret = stc_initialize(&stc);
+       if (ret != STC_ERROR_NONE) {
+               eprintf("stc_initialize() error: %s\n", get_error_message(ret));
+               return MEMUFUNC_ERR_NORMAL;
+       }
+       int available_sim = 0;
+       char *subscriber_id[2]; /* Subscriber ID numbers of sim cards*/
+
+
+       for (int i = 0; i < tel_h_list.count; i++) {
+               ret = telephony_sim_get_state(tel_h_list.handle[i], &sim_state);
+               if (TELEPHONY_ERROR_NONE == ret &&
+                       TELEPHONY_SIM_STATE_AVAILABLE == sim_state) {
+                       available_sim++;
+
+                       ret = get_subscriber_id_from_telephony_handle(
+                               tel_h_list.handle[i], &subscriber_id[i]);
+
+                       if (ret == 0) {
+                               eprintf("get_subscriber_id_from_telephony_handle error! sim(%d) %d\n", i, ret);
+                               continue;
+                       }
+
+                       multi_main_loop = g_main_loop_new(nullptr, FALSE);
+                       sim_limits[i].total_data_used = 0;
+                       get_sim_total_stats(stc,
+                               _total_stats_cb, subscriber_id[i],
+                               sim_limits[i].interval_from,
+                               sim_limits[i].interval_to);
+                       printf("SIM %d ", i + 1);
+                       g_main_loop_run(multi_main_loop);
+                       if (subscriber_id[i]) {
+                               free(subscriber_id[i]);
+                               subscriber_id[i] = 0;
+                       }
+               }
+       }
+
+       stc_deinitialize(stc);
+       if (telephony_deinit(&tel_h_list) != TELEPHONY_ERROR_NONE) {
+               eprintf("telephony_deinit failed");
+               return MEMUFUNC_ERR_NORMAL;
+       }
+
+       return MEMUFUNC_ERR_NONE;
+}
+
+static MENURUN_ERROR menufunc_du_wi(int argc, char *argv[], GenSettingMenu *menu)
+{
+       if (argc < 2) {
                eprintf("Too short to execute this function\n");
+
+               printf("First argument = cycle mode, below.\n");
+               printf("CYCLE_MODE_MONTHLY = 0\n");
+               printf("CYCLE_MODE_WEEKLY = 1\n");
+               printf("CYCLE_MODE_DAILY = 2\n");
+               printf("CYCLE_MODE_CUSTOM = 3\n\n");
+
+               printf("Second argument = start date (monthly, weekly, daily)\n \t\t\t or interval(custom 1 to 90)\n\n");
+
                return MEMUFUNC_ERR_ARG_SHORT;
        }
 
+       stc_h stc;
+       int ret = 0;
+
+
+
        int cycle = atoi(argv[1]);
        int start_interval = atoi(argv[2]);
 
index baa63a7..1ccf7f5 100644 (file)
@@ -1,9 +1,8 @@
 #ifndef __SC_DATEUSAGE_H_
 #define __SC_DATEUSAGE_H_
 
-#include "settingcmd_def.h"
 #include "GenSettingMenu.h"
-\r
+
 void precreate_du(GenSettingMenu *menu);
 
 #endif         /* __SC_DATEUSAGE_H_ */
index e450344..abb230c 100644 (file)
@@ -1,5 +1,5 @@
 #include "sc_datetime.h"
-#include "sc_common.h"
+#include <settingcmd-debug.h>
 
 #include <stdio.h>
 #include <stdlib.h>
index b040bb1..b6378f8 100644 (file)
@@ -1,9 +1,8 @@
-#ifndef __SC_DATETIME_H_\r
-#define __SC_DATETIME_H_\r
-\r
-#include "settingcmd_def.h"\r
+#ifndef __SC_DATETIME_H_
+#define __SC_DATETIME_H_
+
 #include "GenSettingMenu.h"
-\r
-void precreate_dt(GenSettingMenu *menu);\r
-\r
-#endif         /* __SC_DATETIME_H_ */\r
+
+void precreate_dt(GenSettingMenu *menu);
+
+#endif         /* __SC_DATETIME_H_ */
index 19009a7..3843737 100644 (file)
@@ -1,5 +1,5 @@
 #include "sc_display.h"
-#include "sc_common.h"
+#include <settingcmd-debug.h>
 
 #include <stdio.h>
 #include <stdlib.h>
index ebfdc31..73a8a3a 100644 (file)
@@ -1,9 +1,8 @@
-#ifndef __SC_DISPLAY_H_\r
-#define __SC_DISPLAY_H_\r
-\r
-#include "settingcmd_def.h"\r
-#include "GenSettingMenu.h"\r
-\r
-void precreate_di(GenSettingMenu *menu);\r
-\r
-#endif         /* __SC_DISPLAY_H_ */\r
+#ifndef __SC_DISPLAY_H_
+#define __SC_DISPLAY_H_
+
+#include "GenSettingMenu.h"
+
+void precreate_di(GenSettingMenu *menu);
+
+#endif         /* __SC_DISPLAY_H_ */
index d0a015e..0ab8cf7 100644 (file)
@@ -1,5 +1,5 @@
 #include "sc_sound.h"
-#include "sc_common.h"
+#include <settingcmd-debug.h>
 
 #include <stdio.h>
 #include <stdlib.h>
index 159db52..dd3d5ce 100644 (file)
@@ -1,9 +1,8 @@
-#ifndef __SC_SOUND_H_\r
-#define __SC_SOUND_H_\r
-\r
-#include "settingcmd_def.h"\r
-#include "GenSettingMenu.h"\r
-\r
-void precreate_so(GenSettingMenu *menu);\r
-\r
-#endif         /* __SC_SOUND_H_ */\r
+#ifndef __SC_SOUND_H_
+#define __SC_SOUND_H_
+
+#include "GenSettingMenu.h"
+
+void precreate_so(GenSettingMenu *menu);
+
+#endif         /* __SC_SOUND_H_ */
index e612f05..23f876d 100644 (file)
@@ -1,5 +1,5 @@
 #include "sc_wifi.h"
-#include "sc_common.h"
+#include <settingcmd-debug.h>
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -203,7 +203,7 @@ static bool storage_get_misces_item(media_info_h media, void *data)
        media_info_get_file_path(media, &file_path);
        #if 0
        if (!ecore_file_exists(file_path)) {
-               SETTING_TRACE_DEBUG("!ecore_file_exists(file_path)");
+               SETTINGCMD_TRACE_DEBUG("!ecore_file_exists(file_path)");
                FREE(file_path);
                return true;
        }
index 95c997c..2348f8d 100644 (file)
@@ -1,9 +1,8 @@
 #ifndef __SC_STORAGE_H_
 #define __SC_STORAGE_H_
 
-#include "settingcmd_def.h"
-#include "GenSettingMenu.h"\r
-\r
+#include "GenSettingMenu.h"
+
 void precreate_st(GenSettingMenu *menu);
 
 #endif         /* __SC_STORAGE_H_ */
index 3bb65d2..fe85b5f 100644 (file)
@@ -1,5 +1,5 @@
 #include "sc_wifi.h"
-#include "sc_common.h"
+#include <settingcmd-debug.h>
 
 #include <stdio.h>
 #include <stdlib.h>
index 35a3625..e36d087 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef __SC_WIFI_H_
 #define __SC_WIFI_H_
 
-#include "settingcmd_def.h"
 #include "GenSettingMenu.h"
 
 void precreate_wf(GenSettingMenu *menu);
index e240df8..6fe8d3d 100644 (file)
@@ -1,6 +1,6 @@
-#include "settingcmd_def.h"
-#include "GenSettingMenu.h"
+#include <settingcmd-debug.h>
 
+#include "GenSettingMenu.h"
 #include "sc_common.h"
 #include "sc_aboutdevice.h"
 #include "sc_sound.h"
@@ -15,6 +15,7 @@
 #include "sc_battery.h"
 
 #include <stdio.h>
+#include <string>
 
 
 using namespace std;
@@ -119,13 +120,10 @@ void MainMemu_Precreate(GenSettingMenu *menu)
        }
 
        if (profile == MOBILE_PROFILE) {
-               menu->destroy();
                menu->addSubmenus(mobile_mainmenulist, sizeof(mobile_mainmenulist) / sizeof(MenuItem));
        }
        else if (profile == WEARABLE_PROFILE) {
-               menu->destroy();
                menu->addSubmenus(wearable_main_menulist, sizeof(wearable_main_menulist) / sizeof(MenuItem));
-
        }
        else {
                SettingMenu::printError(MEMUFUNC_ERR_NORMAL);
@@ -136,15 +134,25 @@ int main(int argc, char *argv[])
 {
        GenSettingMenu mainMenu("setting-cmd", "Main Menu", nullptr, MainMemu_Precreate);
 
-       if (mainMenu.create()) {
-               string title = "\nSeting Command\n";
-               MENURUN_ERROR result = mainMenu.run(title, argc, argv);
-               if (result != MEMUFUNC_ERR_NONE)
-                       SettingMenu::printError(result);
-               mainMenu.destroy();
-       }
-       else {
+       if (!mainMenu.create()) {
                eprintf("Main Menu failed to create\n");
+               return 0;
        }
+
+       string execstr(argv[0]);
+       string commandstr;
+       if (argc >= 2)
+               commandstr = argv[1];
+
+       SettingCommand settingcommands(execstr, commandstr);
+
+       string title = "\nSeting Command\n";
+
+       MENURUN_ERROR result = mainMenu.run(settingcommands, title, argc - 2, &argv[2]);
+       if (result != MEMUFUNC_ERR_NONE) {
+               SettingMenu::printError(result);
+       }
+       mainMenu.destroy();
+
        return 0;
 }
diff --git a/src/setting_cmd.h b/src/setting_cmd.h
deleted file mode 100755 (executable)
index ae29648..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef __SETTING_CMD_
-#define __SETTING_CMD_
-
-#include <system_settings.h>
-
-
-#endif
diff --git a/src/settingcmd_def.h b/src/settingcmd_def.h
deleted file mode 100644 (file)
index 477e5ce..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef __SETTINGCMD_DEF_H_
-#define __SETTINGCMD_DEF_H_
-
-enum profile {
-       MOBILE_PROFILE = 1,
-       WEARABLE_PROFILE,
-       TV_PROFILE,
-       COMMON_PROFILE,
-       MAX_PROFILE
-};
-
-
-#endif /* __SETTINGCMD_DEF_H_ */