/// CHECK THE EXTERNAL STORATE STATE
//////////////////////////////////////////////////////////////////////////////
#ifdef _USE_DEVICED_DBUS
-#define DEVICED_BUS_NAME "org.tizen.system.storage"
-#define DEVICED_OBJECT_PATH "/Org/Tizen/System/Storage"
-#define DEVICED_INTERFACE_NAME DEVICED_BUS_NAME
+#define DEVICED_BUS_NAME "org.tizen.system.storage"
+#define DEVICED_PATH "/Org/Tizen/System/Storage/Block/Manager"
+#define DEVICED_INTERFACE DEVICED_BUS_NAME".BlockManager"
-#define DEVICED_PATH_BLOCK DEVICED_OBJECT_PATH"/Block"
-#define DEVICED_PATH_BLOCK_MANAGER DEVICED_PATH_BLOCK"/Manager"
-#define DEVICED_INTERFACE_BLOCK_MANAGER DEVICED_INTERFACE_NAME".BlockManager"
-#define BLOCK_DEVICE_CHANGED "DeviceChanged"
-
-#define BLOCK_DEVICE_METHOD "GetDeviceList"
-#define BLOCK_DEVICE_USB "scsi"
-#define BLOCK_DEVICE_MMC "mmc"
-#define BLOCK_DEVICE_ALL "all"
+#define BLOCK_DEVICE_CHANGED "DeviceChanged"
+#define BLOCK_DEVICE_METHOD "GetDeviceList"
+#define BLOCK_DEVICE_USB "scsi"
+#define BLOCK_DEVICE_MMC "mmc"
+#define BLOCK_DEVICE_ALL "all"
static GDBusConnection *g_storage_bus;
g_storage_handler = g_dbus_connection_signal_subscribe(
g_storage_bus,
NULL,
- DEVICED_INTERFACE_BLOCK_MANAGER,
+ DEVICED_INTERFACE,
BLOCK_DEVICE_CHANGED,
NULL,
NULL,
#endif
#ifdef _USE_DEVICED_DBUS
-#define DBUS_REPLY_TIMEOUT (-1)
-static int __ms_gdbus_method_sync(const char *dest,
- const char *path,
- const char *interface,
- const char *method,
- GSList **dev_list)
+int ms_sys_get_device_list(GSList **dev_list)
{
GDBusConnection *g_bus = NULL;
GError *error = NULL;
}
reply_var = g_dbus_connection_call_sync(g_bus,
- dest,
- path,
- interface,
- method,
+ DEVICED_BUS_NAME,
+ DEVICED_PATH,
+ DEVICED_INTERFACE,
+ BLOCK_DEVICE_METHOD,
g_variant_new("(s)", BLOCK_DEVICE_ALL),
NULL,
G_DBUS_SEND_MESSAGE_FLAGS_NONE,
- DBUS_REPLY_TIMEOUT,
+ -1,
NULL,
&error);
if (!reply_var) {
g_variant_get_child(block_device, 8, "s", &data->mount_path);
data->state = state;
- MS_DBG_INFO("block_type : %d", data->block_type);
- MS_DBG_INFO("mount_uuid : %s", data->mount_uuid);
- MS_DBG_SINFO("mount_point : %s", data->mount_path);
- MS_DBG_INFO("state : %d", data->state);
+ MS_DBG_INFO("Block type[%d] uuid[%s] path[%s]", data->block_type, data->mount_uuid, data->mount_path);
*dev_list = g_slist_append(*dev_list, data);
g_variant_unref(block_device);
return MS_MEDIA_ERR_NONE;
}
-#endif
-
-#ifdef _USE_DEVICED_DBUS
-int ms_sys_get_device_list(ms_stg_type_e stg_type, GSList **dev_list)
-{
- return __ms_gdbus_method_sync(DEVICED_BUS_NAME,
- DEVICED_PATH_BLOCK_MANAGER,
- DEVICED_INTERFACE_BLOCK_MANAGER,
- BLOCK_DEVICE_METHOD,
- dev_list);
-}
#else
-int ms_sys_get_device_list(ms_stg_type_e stg_type, GSList **dev_list)
+int ms_sys_get_device_list(GSList **dev_list)
{
int i = 0;
int count = 0;