asp_s *asp_get_manager();
+gint32 asp_manager_load();
+void asp_manager_unload();
+
#ifdef __cplusplus
}
#endif
Name: asp-manager
Summary: ASP(application service platform) manager
-Version: 0.0.26
+Version: 0.0.27
Release: 1
Group: Network & Connectivity/Other
License: Apache-2.0
${CMAKE_SOURCE_DIR}/src/asp-manager-event.c
${CMAKE_SOURCE_DIR}/src/asp-manager-gdbus.c
${CMAKE_SOURCE_DIR}/src/asp-manager-util.c
+ ${CMAKE_SOURCE_DIR}/src/asp-manager-main.c
${CMAKE_SOURCE_DIR}/interfaces/generated-code.c
)
--- /dev/null
+#include "asp-manager.h"
+#include "asp-manager-util.h"
+
+gint32 main(gint32 argc, gchar *argv[])
+{
+ GMainLoop *main_loop = NULL;
+ asp_s *manager = NULL;
+
+ /* Initialize required subsystems */
+#if !GLIB_CHECK_VERSION(2, 35, 0)
+ g_type_init();
+#endif
+
+ if (asp_manager_load() < 0) {
+ ASP_LOGE("Failed to load asp-manager");
+ asp_manager_unload();
+ return -1;
+ }
+
+ manager = asp_get_manager();
+ if (!manager) {
+ ASP_LOGE("Failed to get asp_s");
+ return -1;
+ }
+ /* Crate the GLIB main loop */
+ main_loop = g_main_loop_new(NULL, FALSE);
+ manager->main_loop = main_loop;
+
+ /* Run the main loop */
+ g_main_loop_run(main_loop);
+
+ asp_manager_unload();
+
+ g_main_loop_unref(main_loop);
+
+ return 0;
+}
return asp;
}
-gint32 main(gint32 argc, gchar *argv[])
+gint32 asp_manager_load()
{
- GMainLoop *main_loop = NULL;
- gint32 ret = -1;
-
- /* Initialize required subsystems */
-#if !GLIB_CHECK_VERSION(2, 35, 0)
- g_type_init();
-#endif
+ __ASP_LOG_FUNC_ENTER__;
g_asp = __asp_manager_init();
- if (!g_asp)
- goto fail;
-
- /* Crate the GLIB main loop */
- main_loop = g_main_loop_new(NULL, FALSE);
- g_asp->main_loop = main_loop;
-
- /* Run the main loop */
- g_main_loop_run(main_loop);
-
- ret = 0;
+ if (!g_asp) {
+ ASP_LOGE("Failed to initialize asp-manager");
+ return -1;
+ }
-fail:
+ __ASP_LOG_FUNC_EXIT__;
+ return 0;
+}
+void asp_manager_unload()
+{
+ __ASP_LOG_FUNC_ENTER__;
__asp_manager_deinit();
-
- g_main_loop_unref(main_loop);
-
- return ret;
+ __ASP_LOG_FUNC_EXIT__;
}