#setting main view build start
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/src/common)
#INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.setting-cmd.xml DESTINATION /usr/share/packages/)
# setting bin
SET(BIN_NAME "setting-cmd")
ADD_EXECUTABLE(${BIN_NAME}
- ./SettingCommand.cpp
- ./SettingMenu.cpp
- ./GenSettingMenu.cpp
- ./setting_cmd.cpp
- ./sc_common.cpp
- ./sc_aboutdevice.cpp
- ./sc_sound.cpp
- ./sc_display.cpp
- ./sc_apps.cpp
- ./sc_datetime.cpp
- ./sc_wifi.cpp
- ./sc_bluetooth.cpp
- ./sc_airplane.cpp
- ./sc_storage.cpp
- ./sc_battery.cpp
- ./sc_datausage.cpp
+ ./sc_main.cpp
+ common/SettingCommand.cpp
+ common/SettingMenu.cpp
+ common/GenSettingMenu.cpp
+ settings/sc_common.cpp
+ settings/sc_aboutdevice.cpp
+ settings/sc_sound.cpp
+ settings/sc_display.cpp
+ settings/sc_apps.cpp
+ settings/sc_datetime.cpp
+ settings/sc_wifi.cpp
+ settings/sc_bluetooth.cpp
+ settings/sc_airplane.cpp
+ settings/sc_storage.cpp
+ settings/sc_battery.cpp
+ settings/sc_datausage.cpp
)
# dmalloc
-#include "GenSettingMenu.h"
-#include <settingcmd-debug.h>
+#include <GenSettingMenu.h>
+#include <sc-debug.h>
using namespace std;
return (*ptrFunc)(argc, argv, this);
}
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
bool GenSettingMenu::isImplemented()
{
#include "SettingCommand.h"
-#include <settingcmd-debug.h>
+#include <sc-debug.h>
#include <sstream>
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, '/')) {
{
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::last()
{
curPos = 0;
-
+
int cmdcount = count();
if (cmdcount > 0) curPos = cmdcount - 1;
}
#include "SettingMenu.h"
-#include <settingcmd-debug.h>
+#include <sc-debug.h>
#include <algorithm>
#include <list>
title += string(" - ") + name();
MENURUN_ERROR result = func(title, argc, argv);
- if (result != MEMUFUNC_ERR_NONE) return result;
+ if (result != MENURUN_ERR_NONE) return result;
- if (subMenus.empty()) return MEMUFUNC_ERR_NONE;
+ if (subMenus.empty()) return MENURUN_ERR_NONE;
if (!settingcmds.next()) {
printUsage(settingcmds);
- return MEMUFUNC_ERR_ARG_SHORT;
+ return MENURUN_ERR_ARG_SHORT;
}
string curcmd = settingcmds.curCommand();
auto it = find_if(subMenus.begin(), subMenus.end(),
eprintf("%s is not a valid command.\n\n", curcmd.c_str());
printUsage(settingcmds);
settingcmds.prev();
- return MEMUFUNC_ERR_ARG_INVAILD;
+ return MENURUN_ERR_ARG_INVAILD;
}
eprintf("command %s is founded.\n", curcmd.c_str());
MENURUN_ERROR SettingMenu::func(string &title, int argc, char *argv[])
{
eprintf("func() of %s\n", name());
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
void SettingMenu::printUsage(SettingCommand &settingcmds)
{
printf("[SettingMenu Error] ");
switch (error) {
- case MEMUFUNC_ERR_NORMAL:
+ case MENURUN_ERR_NORMAL:
printf("Normal error");
break;
- case MEMUFUNC_ERR_ARG_SHORT:
+ case MENURUN_ERR_ARG_SHORT:
printf("Lack of arguments");
break;
- case MEMUFUNC_ERR_ARG_INVAILD:
+ case MENURUN_ERR_ARG_INVAILD:
printf("Invalid argument");
break;
- case MEMUFUNC_ERR_NOTIMPL:
+ case MENURUN_ERR_NOTIMPL:
printf("Not implemented");
break;
default:
#include <list>
enum MENURUN_ERROR {
- MEMUFUNC_ERR_NONE = 0,
- MEMUFUNC_ERR_NORMAL = -1,
- MEMUFUNC_ERR_ARG_SHORT = -2,
- MEMUFUNC_ERR_ARG_INVAILD = -3,
- MEMUFUNC_ERR_NOTIMPL = -4
+ MENURUN_ERR_NONE = 0,
+ MENURUN_ERR_NORMAL = -1,
+ MENURUN_ERR_ARG_SHORT = -2,
+ MENURUN_ERR_ARG_INVAILD = -3,
+ MENURUN_ERR_NOTIMPL = -4
};
class SettingMenu
public:
virtual bool create();
virtual void destroy();
- virtual MENURUN_ERROR run(SettingCommand &settingcmds, 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[]);
virtual bool isImplemented() { return false; }
-#include <settingcmd-debug.h>
-
-#include "GenSettingMenu.h"
-#include "sc_common.h"
-#include "sc_aboutdevice.h"
-#include "sc_sound.h"
-#include "sc_display.h"
-#include "sc_apps.h"
-#include "sc_datetime.h"
-#include "sc_wifi.h"
-#include "sc_bluetooth.h"
-#include "sc_airplane.h"
-#include "sc_storage.h"
-#include "sc_datausage.h"
-#include "sc_battery.h"
+#include <sc-debug.h>
+
+#include <GenSettingMenu.h>
+#include "settings/sc_common.h"
+#include "settings/sc_aboutdevice.h"
+#include "settings/sc_sound.h"
+#include "settings/sc_display.h"
+#include "settings/sc_apps.h"
+#include "settings/sc_datetime.h"
+#include "settings/sc_wifi.h"
+#include "settings/sc_bluetooth.h"
+#include "settings/sc_airplane.h"
+#include "settings/sc_storage.h"
+#include "settings/sc_datausage.h"
+#include "settings/sc_battery.h"
#include <stdio.h>
#include <string>
{
int profile = getProfile();
if (profile < 0) {
- SettingMenu::printError(MEMUFUNC_ERR_NORMAL);
+ SettingMenu::printError(MENURUN_ERR_NORMAL);
return;
}
menu->addSubmenus(wearable_main_menulist, sizeof(wearable_main_menulist) / sizeof(MenuItem));
}
else {
- SettingMenu::printError(MEMUFUNC_ERR_NORMAL);
+ SettingMenu::printError(MENURUN_ERR_NORMAL);
}
}
string title = "\nSeting Command\n";
MENURUN_ERROR result = mainMenu.run(settingcommands, title, argc - 2, &argv[2]);
- if (result != MEMUFUNC_ERR_NONE) {
+ if (result != MENURUN_ERR_NONE) {
SettingMenu::printError(result);
}
mainMenu.destroy();
#include "sc_aboutdevice.h"
-#include <settingcmd-debug.h>
+#include <sc-debug.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <storage.h>
-#include <settingcmd-debug.h>
+#include <sc-debug.h>
#define SETTING_ABOUT_POWER_SUPPLY_PATH "/sys/class/power_supply"
printf("%s\n", name_value);
free(name_value);
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static MENURUN_ERROR menufunc_ad_mn(int argc, char *argv[], GenSettingMenu *menu)
printf("\tModel number : ");
printf("%s\n", str);
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static MENURUN_ERROR menufunc_ad_ver(int argc, char *argv[], GenSettingMenu *menu)
printf("\tModel number : ");
printf("%s\n", str);
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static MENURUN_ERROR menufunc_ad_cpu(int argc, char *argv[], GenSettingMenu *menu)
printf("\tModel number : ");
printf("%s\n", str);
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static MENURUN_ERROR menufunc_ad_ram(int argc, char *argv[], GenSettingMenu *menu)
printf("\tRAM : ");
printf("%s\n", str);
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static MENURUN_ERROR menufunc_ad_res(int argc, char *argv[], GenSettingMenu *menu)
printf("\tResolution : ");
printf("%s\n", str);
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
/* sim_number is started from 1, ex) SIM1, SIM2, SIM3 ... */
static MENURUN_ERROR _get_sim_phone_number(int sim_number, char * str, int str_size)
int ret = 0;
if (telephony_init(&tel_h_list) != TELEPHONY_ERROR_NONE) {
eprintf("telephony_init failed");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
if ((int)tel_h_list.count < sim_number-1) {
printf("\tThere is no SIM%d card\n", sim_number);
if (telephony_deinit(&tel_h_list) != TELEPHONY_ERROR_NONE) {
eprintf("telephony_deinit failed");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
ret = telephony_sim_get_subscriber_number(tel_h_list.handle[sim_number-1], &phone_num);
printf("\tThere is no SIM%d card, ret:%d phone_num addr:0x%x\n", sim_number, ret, (unsigned int)phone_num);
if (telephony_deinit(&tel_h_list) != TELEPHONY_ERROR_NONE) {
eprintf("telephony_deinit failed");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
if (telephony_deinit(&tel_h_list) != TELEPHONY_ERROR_NONE) {
eprintf("telephony_deinit failed");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
{
char str[MAX_DISPLAY_STR_LEN_ON_PHONE_INFO];
MENURUN_ERROR ret = _get_sim_phone_number(1, str, sizeof(str));
- if (ret != MEMUFUNC_ERR_NONE)
+ if (ret != MENURUN_ERR_NONE)
return ret;
printf("\tSIM1 Phone Number : ");
printf("%s\n", str);
{
char str[MAX_DISPLAY_STR_LEN_ON_PHONE_INFO];
MENURUN_ERROR ret = _get_sim_phone_number(2, str, sizeof(str));
- if (ret != MEMUFUNC_ERR_NONE)
+ if (ret != MENURUN_ERR_NONE)
return ret;
printf("\tSIM2 Phone Number : ");
printf("%s\n", str);
if (telephony_init(&tel_h_list) != TELEPHONY_ERROR_NONE) {
eprintf("telephony_init failed");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
if ((int)tel_h_list.count < sim_number-1) {
printf("\tThere is no SIM%d card\n", sim_number);
if (telephony_deinit(&tel_h_list) != TELEPHONY_ERROR_NONE) {
eprintf("telephony_deinit failed");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
int ret = telephony_modem_get_imei(tel_h_list.handle[sim_number-1], &ime_buffer);
printf("\tThere is no SIM%d card, ret:%d ime_buffer addr:0x%x\n", sim_number, ret, (unsigned int)ime_buffer);
if (telephony_deinit(&tel_h_list) != TELEPHONY_ERROR_NONE) {
eprintf("telephony_deinit failed");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
if (telephony_deinit(&tel_h_list) != TELEPHONY_ERROR_NONE) {
eprintf("telephony_deinit failed");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static MENURUN_ERROR menufunc_ad_ime1(int argc, char *argv[], GenSettingMenu *menu)
{
char str[MAX_DISPLAY_STR_LEN_ON_PHONE_INFO];
MENURUN_ERROR ret = _get_sim_ime(1, str, sizeof(str));
- if (ret != MEMUFUNC_ERR_NONE)
+ if (ret != MENURUN_ERR_NONE)
return ret;
printf("\tIME1 : ");
printf("%s\n", str);
{
char str[MAX_DISPLAY_STR_LEN_ON_PHONE_INFO];
MENURUN_ERROR ret = _get_sim_ime(2, str, sizeof(str));
- if (ret != MEMUFUNC_ERR_NONE)
+ if (ret != MENURUN_ERR_NONE)
return ret;
printf("\tIME2 : ");
printf("%s\n", str);
}
printf("\tBluetooth address : ");
printf("%s\n", str);
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static MENURUN_ERROR menufunc_ad_wfa(int argc, char *argv[], GenSettingMenu *menu)
/* get wifi handle */
int ret = wifi_manager_initialize(&wifi_handle);
if (ret != WIFI_MANAGER_ERROR_NONE)
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
/* get wifi mac address */
ret = wifi_manager_get_mac_address(wifi_handle, &mac_addr);
/* release wifi handle */
ret = wifi_manager_deinitialize(wifi_handle);
if (ret != WIFI_MANAGER_ERROR_NONE)
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
printf("\tWIFI address : ");
printf("%s\n", str);
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static MENURUN_ERROR menufunc_ad_sto(int argc, char *argv[], GenSettingMenu *menu)
if (storage_get_internal_memory_size(&internal) < 0) {
eprintf("Fail to get internal memory size\n");
snprintf(str, sizeof(str), "internal storage is unavailable!\n");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
} else {
total = (long long int)internal.f_frsize
* (long long int)internal.f_blocks;
if (total < 0 || avail < 0 || total < avail) {
eprintf("Fail to get internal memory size\n");
snprintf(str, sizeof(str), "external storage is unavailable!\n");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
snprintf(str, sizeof(str), "%0.1fGB available (Total %0.1fGB)",
(double)(avail / 1000000000.0), (double)(total / 1000000000.0));
printf("\tStorage Size : ");
printf("%s\n", str);
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static MENURUN_ERROR menufunc_ad_batt(int argc, char *argv[], GenSettingMenu *menu)
eprintf("open file fail\n");
snprintf(str, sizeof(str), "%s unavailable!\n", SETTING_ABOUT_POWER_SUPPLY_PATH);
}
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static int __stat_get_cpu_usage(float *usr_pct, float *sys_pct)
{
float usr = 0.0;
float sys = 0.0;
- MENURUN_ERROR ret = MEMUFUNC_ERR_NONE;
+ MENURUN_ERROR ret = MENURUN_ERR_NONE;
printf("\tWhen you want to stop checking CPU usage,\n");
printf("\tPress Ctrl+C\n\n");
#ifndef __SC_ABOUTDEVICE_H_
#define __SC_ABOUTDEVICE_H_
-#include "GenSettingMenu.h"
+#include <GenSettingMenu.h>
void precreate_ad(GenSettingMenu *menu);
#include "sc_airplane.h"
-#include <settingcmd-debug.h>
+#include <sc-debug.h>
#include <stdio.h>
#include <stdlib.h>
bool ret_state = false;
int ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE, &ret_state);
- if( ret != MEMUFUNC_ERR_NONE ) {
+ if( ret != MENURUN_ERR_NONE ) {
eprintf("\tFlight mode get fail\n");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
printf("\tFlight mode : %s\n", ret_state? "On" : "Off");
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
MenuItem am_menulist[] ={
#ifndef __SC_AIRPLANE_H_
#define __SC_AIRPLANE_H_
-#include "GenSettingMenu.h"
+#include <GenSettingMenu.h>
void precreate_am(GenSettingMenu *menu);
#include "sc_apps.h"
-#include <settingcmd-debug.h>
+#include <sc-debug.h>
#include <stdio.h>
#include <stdlib.h>
apps = appmgr_utils_sort_apps_list(g_sorttype, apps);
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
#ifndef __SC_APPS_H_
#define __SC_APPS_H_
-#include "GenSettingMenu.h"
+#include <GenSettingMenu.h>
void precreate_apps(GenSettingMenu *menu);
#include "sc_battery.h"
-#include <settingcmd-debug.h>
+#include <sc-debug.h>
#include <stdio.h>
#include <stdlib.h>
_get_battery_usage_details_list();
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
#ifndef __SC_BATTERY_H_
#define __SC_BATTERY_H_
-#include "GenSettingMenu.h"
+#include <GenSettingMenu.h>
MENURUN_ERROR menufunc_ba(int argc, char *argv[], GenSettingMenu *menu);
#include "sc_bluetooth.h"
-#include <settingcmd-debug.h>
+#include <sc-debug.h>
#include <stdio.h>
#include <stdlib.h>
{
if (bt_initialize() != BT_ERROR_NONE) {
eprintf("bt_initialize() failed\n");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
bt_adapter_state_e bt_state;
if (bt_adapter_get_state(&bt_state) != BT_ERROR_NONE) {
eprintf("bt_adapter_get_state() failed\n");
bt_deinitialize();
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
bt_deinitialize();
printf("\tState : %s\n", (bt_state == BT_ADAPTER_ENABLED) ? "On" : "Off");
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
MenuItem bt_menulist[] ={
#ifndef __SC_BLUETOOTH_H_
#define __SC_BLUETOOTH_H_
-#include "GenSettingMenu.h"
+#include <GenSettingMenu.h>
void precreate_bt(GenSettingMenu *menu);
#include "sc_common.h"
-#include <settingcmd-debug.h>
+#include <sc-debug.h>
#include <stdio.h>
#include <string.h>
#include "sc_datausage.h"
-#include <settingcmd-debug.h>
+#include <sc-debug.h>
#include <stdio.h>
#include <stdlib.h>
#include <app_preference.h>
#include <stc_internal.h>
-#include <settingcmd-debug.h>
+#include <sc-debug.h>
#define TH_POSTFIX_IDX 0
else if (isEmptyStr(s1))
return 1;
else if (isEmptyStr(s2))
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
if (0 == len)
return 0;
ret = stc_initialize(&stc);
if (ret != STC_ERROR_NONE) {
eprintf("stc_initialize() error: %s\n", get_error_message(ret));
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
multi_main_loop = g_main_loop_new(nullptr, FALSE);
stc_deinitialize(stc);
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static MENURUN_ERROR menufunc_du_smwl(int argc, char *argv[], GenSettingMenu *menu)
printf("Second argument = limit(MB)\n");
printf("Zero MB means None\n");
- return MEMUFUNC_ERR_ARG_SHORT;
+ return MENURUN_ERR_ARG_SHORT;
}
telephony_handle_list_s tel_h_list;
if (telephony_init(&tel_h_list) != TELEPHONY_ERROR_NONE) {
eprintf("telephony_init failed");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_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 MENURUN_ERR_NORMAL;
}
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
ret = stc_initialize(&stc);
if (ret != STC_ERROR_NONE) {
eprintf("stc_initialize() error: %s\n", get_error_message(ret));
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
int available_sim = 0;
char *subscriber_id[2]; /* Subscriber ID numbers of sim cards*/
stc_deinitialize(stc);
if (telephony_deinit(&tel_h_list) != TELEPHONY_ERROR_NONE) {
eprintf("telephony_deinit failed");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
printf("\t\tDone..\n");
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static MENURUN_ERROR menufunc_du_mo(int argc, char *argv[], GenSettingMenu *menu)
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;
+ return MENURUN_ERR_ARG_SHORT;
}
telephony_handle_list_s tel_h_list;
int ret = 0;
if (telephony_init(&tel_h_list) != TELEPHONY_ERROR_NONE) {
eprintf("telephony_init failed");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_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 MENURUN_ERR_NORMAL;
}
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
int cycle = atoi(argv[1]);
ret = stc_initialize(&stc);
if (ret != STC_ERROR_NONE) {
eprintf("stc_initialize() error: %s\n", get_error_message(ret));
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
int available_sim = 0;
char *subscriber_id[2]; /* Subscriber ID numbers of sim cards*/
stc_deinitialize(stc);
if (telephony_deinit(&tel_h_list) != TELEPHONY_ERROR_NONE) {
eprintf("telephony_deinit failed");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static MENURUN_ERROR menufunc_du_wi(int argc, char *argv[], GenSettingMenu *menu)
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;
+ return MENURUN_ERR_ARG_SHORT;
}
stc_h stc;
ret = stc_initialize(&stc);
if (ret != STC_ERROR_NONE) {
eprintf("stc_initialize() error: %s\n", get_error_message(ret));
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
multi_main_loop = g_main_loop_new(nullptr, FALSE);
stc_deinitialize(stc);
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
MenuItem du_menulist[] ={
#ifndef __SC_DATEUSAGE_H_
#define __SC_DATEUSAGE_H_
-#include "GenSettingMenu.h"
+#include <GenSettingMenu.h>
void precreate_du(GenSettingMenu *menu);
#include "sc_datetime.h"
-#include <settingcmd-debug.h>
+#include <sc-debug.h>
#include <stdio.h>
#include <stdlib.h>
int ret = vconf_get_bool(VCONFKEY_SETAPPL_STATE_AUTOMATIC_TIME_UPDATE_BOOL, &auto_update);
if (ret != 0) {
eprintf("\tFail to get Auto update!\n");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
printf("\tAuto update : ");
printf("%s\n", auto_update? "On" : "Off");
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
#ifndef __SC_DATETIME_H_
#define __SC_DATETIME_H_
-#include "GenSettingMenu.h"
+#include <GenSettingMenu.h>
void precreate_dt(GenSettingMenu *menu);
#include "sc_display.h"
-#include <settingcmd-debug.h>
+#include <sc-debug.h>
#include <stdio.h>
#include <stdlib.h>
int ret = vconf_get_int(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, &auto_bright);
if( ret != 0 ) {
eprintf("\tAuto Bright get fail!\n");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
printf("\tAuto Bright : %s\n", auto_bright? "On" : "Off");
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static MENURUN_ERROR menufunc_di_br(int argc, char *argv[], GenSettingMenu *menu)
int ret = vconf_get_int(VCONFKEY_SETAPPL_LCD_BRIGHTNESS, &brightness);
if(ret != 0) {
eprintf("\tbrightness get fail!\n");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
printf("\tBrightness : %d\n", brightness);
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static MENURUN_ERROR menufunc_di_fs(int argc, char *argv[], GenSettingMenu *menu)
int ret = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_FONT_SIZE, &fontsize);
if( ret != 0) {
eprintf("\tFont get fail!\n");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
printf("\tFont Size: %d\n", fontsize );
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static MENURUN_ERROR menufunc_di_to(int argc, char *argv[], GenSettingMenu *menu)
printf("\tScreen timeout : ");
printf("%d\n", timeout);
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
MenuItem di_menulist[] ={
#ifndef __SC_DISPLAY_H_
#define __SC_DISPLAY_H_
-#include "GenSettingMenu.h"
+#include <GenSettingMenu.h>
void precreate_di(GenSettingMenu *menu);
#include "sc_sound.h"
-#include <settingcmd-debug.h>
+#include <sc-debug.h>
#include <stdio.h>
#include <stdlib.h>
sound_stream_info_t sound_stream_info;
if (!_sound_manager_init(&sound_stream_info)) {
eprintf("_sound_manager_init() failed!");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
int vol = 0;
if (sound_manager_get_volume(SOUND_TYPE_RINGTONE, &vol) != SOUND_MANAGER_ERROR_NONE) {
_sound_manager_deinit(&sound_stream_info);
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
_sound_manager_deinit(&sound_stream_info);
printf("\tRingtone Volume : ");
printf("%d\n", vol);
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static MENURUN_ERROR menufunc_so_nvol(int argc, char *argv[], GenSettingMenu *menu)
sound_stream_info_t sound_stream_info;
if (!_sound_manager_init(&sound_stream_info)) {
eprintf("_sound_manager_init() failed!");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
int vol = 0;
if (sound_manager_get_volume(SOUND_TYPE_NOTIFICATION, &vol) != SOUND_MANAGER_ERROR_NONE) {
_sound_manager_deinit(&sound_stream_info);
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
_sound_manager_deinit(&sound_stream_info);
printf("\tNotification Volume : ");
printf("%d\n", vol);
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static MENURUN_ERROR menufunc_so_mvol(int argc, char *argv[], GenSettingMenu *menu)
sound_stream_info_t sound_stream_info;
if (!_sound_manager_init(&sound_stream_info)) {
eprintf("_sound_manager_init() failed!");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
int vol = 0;
if (sound_manager_get_volume(SOUND_TYPE_MEDIA, &vol) != SOUND_MANAGER_ERROR_NONE) {
_sound_manager_deinit(&sound_stream_info);
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
_sound_manager_deinit(&sound_stream_info);
printf("\tMedia Volume : ");
printf("%d\n", vol);
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static MENURUN_ERROR menufunc_so_svol(int argc, char *argv[], GenSettingMenu *menu)
sound_stream_info_t sound_stream_info;
if (!_sound_manager_init(&sound_stream_info)) {
eprintf("_sound_manager_init() failed!");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
int vol = 0;
if (sound_manager_get_volume(SOUND_TYPE_SYSTEM, &vol) != SOUND_MANAGER_ERROR_NONE) {
_sound_manager_deinit(&sound_stream_info);
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
_sound_manager_deinit(&sound_stream_info);
printf("\tSystem Volume : ");
printf("%d\n", vol);
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
#ifndef __SC_SOUND_H_
#define __SC_SOUND_H_
-#include "GenSettingMenu.h"
+#include <GenSettingMenu.h>
void precreate_so(GenSettingMenu *menu);
#include "sc_wifi.h"
-#include <settingcmd-debug.h>
+#include <sc-debug.h>
#include <stdio.h>
#include <stdlib.h>
ret = scanf("%s", buf);
if (buf[0] != 'Y' && buf[0] != 'y')
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
ret = format_usb_storage(usb_otg_path);
if (ret < 0) {
eprintf("format_usb_storage(%s) Fail(%d)\n",
usb_otg_path, ret);
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
usb_otg_status = SETTING_STORAGE_USB_OTG_UNMOUNT;
if (STORAGE_USB_REQ_UNMOUNT_BEFORE_FORMAT == usb_request) {
ret = storage_USB_format();
- if (MEMUFUNC_ERR_NONE == ret) {
+ if (MENURUN_ERR_NONE == ret) {
usb_request = STORAGE_USB_REQ_FORMAT;
} else {
usb_request = STORAGE_USB_REQ_NONE;
int media_ret = media_content_connect();
if (MEDIA_CONTENT_ERROR_NONE != media_ret) {
eprintf("media_content_connect() Fail(0x%x)\n Please execute this app with \"owner\" user\n", (-1)*media_ret);
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
__get_storage_capacity(buf, SETTING_CMD_MAX_STR_LEN);
printf("%s", buf);
media_content_disconnect();
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static MENURUN_ERROR menufunc_st_sd(int argc, char *argv[], GenSettingMenu *menu){
int ret = vconf_get_int(VCONFKEY_SYSMAN_MMC_STATUS, &sd_status);
if (ret != 0) {
eprintf("vconf_get_int(%s) fail!\n", VCONFKEY_SYSMAN_MMC_STATUS);
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
if (sd_status != VCONFKEY_SYSMAN_MMC_MOUNTED){
eprintf("SD card NOT mounted!\n");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
char *MMC_path = _TZ_SYS_MEDIA"/sdcard";
printf("avail : %s\n", avail_str);
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static MENURUN_ERROR menufunc_st_ms(int argc, char *argv[], GenSettingMenu *menu)
int ret = vconf_get_int(VCONFKEY_SYSMAN_MMC_STATUS, &sd_status);
if (ret != 0) {
eprintf("vconf_get_int(%s) fail!\n", VCONFKEY_SYSMAN_MMC_STATUS);
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
if (sd_status == VCONFKEY_SYSMAN_MMC_MOUNTED){
eprintf("SD card already mounted!\n");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
ret = storage_request_mount_mmc(&mmc_content);
if (ret == -1) {
eprintf("storage_request_mount_mmc() Fail\n");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
printf("SD card mount\n");
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static MENURUN_ERROR menufunc_st_mss(int argc, char *argv[], GenSettingMenu *menu)
int ret = vconf_get_int(VCONFKEY_SYSMAN_MMC_STATUS, &sd_status);
if (ret != 0) {
eprintf("vconf_get_int(%s) fail!\n", VCONFKEY_SYSMAN_MMC_STATUS);
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
if (sd_status == VCONFKEY_SYSMAN_MMC_MOUNTED ||
printf("SD card NOT mounted!\n");
}
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static MENURUN_ERROR menufunc_st_us(int argc, char *argv[], GenSettingMenu *menu){
int ret = vconf_get_int(VCONFKEY_SYSMAN_MMC_STATUS, &sd_status);
if (ret != 0) {
eprintf("vconf_get_int(%s) fail!\n", VCONFKEY_SYSMAN_MMC_STATUS);
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
if (sd_status != VCONFKEY_SYSMAN_MMC_MOUNTED){
eprintf("SD card NOT mounted!\n");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
ret = storage_request_unmount_mmc(&mmc_content, MNT_FORCE);
if (ret == -1) {
eprintf("storage_request_unmount_mmc() Fail\n");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
printf("SD card Unmount\n");
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
int ret = storage_request_format_mmc(&mmc_content);
if (ret == -1) {
eprintf("failed to call storage_request_format_mmc\n");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
printf("sd card format complete\n");
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static MENURUN_ERROR menufunc_st_ids(int argc, char *argv[], GenSettingMenu *menu)
int ret = vconf_set_int(VCONFKEY_SETAPPL_DEFAULT_MEM_WIFI_DIRECT_INT, val);
if (ret != 0) {
eprintf("vconf_get_int(%s) fail!\n", VCONFKEY_SETAPPL_DEFAULT_MEM_WIFI_DIRECT_INT);
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
ret = vconf_set_int(VCONFKEY_SETAPPL_DEFAULT_MEM_BLUETOOTH_INT, val);
if (ret != 0) {
eprintf("vconf_get_int(%s) fail!\n", VCONFKEY_SETAPPL_DEFAULT_MEM_BLUETOOTH_INT);
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
printf("Set internal memory for default storage shared content\n");
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static MENURUN_ERROR menufunc_st_sds(int argc, char *argv[], GenSettingMenu *menu)
int ret = vconf_set_int(VCONFKEY_SETAPPL_DEFAULT_MEM_WIFI_DIRECT_INT, val);
if (ret != 0) {
eprintf("vconf_get_int(%s) fail!\n", VCONFKEY_SETAPPL_DEFAULT_MEM_WIFI_DIRECT_INT);
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
ret = vconf_set_int(VCONFKEY_SETAPPL_DEFAULT_MEM_BLUETOOTH_INT, val);
if (ret != 0) {
eprintf("vconf_get_int(%s) fail!\n", VCONFKEY_SETAPPL_DEFAULT_MEM_BLUETOOTH_INT);
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
printf("Set SD card for default storage shared content\n");
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static MENURUN_ERROR menufunc_st_ida(int argc, char *argv[], GenSettingMenu *menu)
int ret = vconf_set_int(VCONFKEY_SETAPPL_DEFAULT_MEM_INSTALL_APPLICATIONS_INT, val);
if (ret != 0) {
eprintf("vconf_get_int(%s) fail!\n", VCONFKEY_SETAPPL_DEFAULT_MEM_INSTALL_APPLICATIONS_INT);
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
printf("Set internal memory for default storage app installation\n");
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static MENURUN_ERROR menufunc_st_sda(int argc, char *argv[], GenSettingMenu *menu)
int ret = vconf_set_int(VCONFKEY_SETAPPL_DEFAULT_MEM_INSTALL_APPLICATIONS_INT, val);
if (ret != 0) {
eprintf("vconf_get_int(%s) fail!\n", VCONFKEY_SETAPPL_DEFAULT_MEM_INSTALL_APPLICATIONS_INT);
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
printf("Set SD card for default storage app installation\n");
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static MENURUN_ERROR menufunc_st_da(int argc, char *argv[], GenSettingMenu *menu)
int ret = vconf_get_int(VCONFKEY_SETAPPL_DEFAULT_MEM_INSTALL_APPLICATIONS_INT, &val);
if (ret != 0) {
eprintf("vconf_get_int(%s) fail!\n", VCONFKEY_SETAPPL_DEFAULT_MEM_INSTALL_APPLICATIONS_INT);
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
printf("Default storage app installation : %s\n", (val)?"Internal memory":"SD Card");
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static MENURUN_ERROR menufunc_st_ds(int argc, char *argv[], GenSettingMenu *menu)
int ret = vconf_get_int(VCONFKEY_SETAPPL_DEFAULT_MEM_WIFI_DIRECT_INT, &val);
if (ret != 0) {
eprintf("vconf_get_int(%s) fail!\n", VCONFKEY_SETAPPL_DEFAULT_MEM_WIFI_DIRECT_INT);
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
printf("Default storage shared content with wifi : %s\n", (val)?"Internal memory":"SD Card");
ret = vconf_get_int(VCONFKEY_SETAPPL_DEFAULT_MEM_BLUETOOTH_INT, &val);
if (ret != 0) {
eprintf("vconf_get_int(%s) fail!\n", VCONFKEY_SETAPPL_DEFAULT_MEM_BLUETOOTH_INT);
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
printf("Default storage shared content with bluetooth : %s\n", (val)?"Internal memory":"SD Card");
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
MenuItem st_menulist[] ={
#ifndef __SC_STORAGE_H_
#define __SC_STORAGE_H_
-#include "GenSettingMenu.h"
+#include <GenSettingMenu.h>
void precreate_st(GenSettingMenu *menu);
#include "sc_wifi.h"
-#include <settingcmd-debug.h>
+#include <sc-debug.h>
#include <stdio.h>
#include <stdlib.h>
{
int state = 0;
int ret = vconf_get_int(VCONFKEY_WIFI_STATE, &state);
- if (ret != MEMUFUNC_ERR_NONE) {
+ if (ret != MENURUN_ERR_NONE) {
eprintf("\twifi state get fail!\n");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
printf("\tState : %s\n", state ? "On" : "Off");
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
static MENURUN_ERROR menufunc_wf_nf(int argc, char *argv[], GenSettingMenu *menu)
{
bool state = false;
int ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION, &state);
- if (ret != MEMUFUNC_ERR_NONE) {
+ if (ret != MENURUN_ERR_NONE) {
eprintf("\twifi notification get fail!\n");
- return MEMUFUNC_ERR_NORMAL;
+ return MENURUN_ERR_NORMAL;
}
printf("\tNodification : %s\n", state ? "On" : "Off");
- return MEMUFUNC_ERR_NONE;
+ return MENURUN_ERR_NONE;
}
MenuItem wf_menulist[] = {
#ifndef __SC_WIFI_H_
#define __SC_WIFI_H_
-#include "GenSettingMenu.h"
+#include <GenSettingMenu.h>
void precreate_wf(GenSettingMenu *menu);