Rearrange codes
authorsaerome.kim <saerome.kim@samsung.com>
Mon, 3 Jul 2017 12:21:10 +0000 (21:21 +0900)
committersaerome.kim <saerome.kim@samsung.com>
Mon, 17 Jul 2017 02:09:10 +0000 (11:09 +0900)
- added mesh-internal.h to the devel package
- Change locations of inhouse APIs to mesh_internal.c

Signed-off-by: saerome.kim <saerome.kim@samsung.com>
include/mesh.h
include/mesh_dbus.h
packaging/capi-network-mesh.spec
src/mesh.c
src/mesh_internal.c
test/common.h

index e05b5e1..fb6895f 100644 (file)
@@ -200,19 +200,6 @@ typedef void* mesh_network_h;
 typedef void* mesh_peer_h;
 
 /**
- * @brief The mesh station information handle.
- * @since_tizen 4.0
-*/
-typedef void* mesh_station_info_h;
-
-/**
- * @brief The mesh path information handle.
- * @since_tizen 4.0
-*/
-typedef void* mesh_mpath_info_h;
-
-
-/**
  * @brief Creates network handle for network information.
  * @details This function is to allocate new mesh network information
  *
index be47a83..0618678 100644 (file)
@@ -18,7 +18,7 @@
 #define __MESH_DBUS_H__
 
 #include "mesh.h"
-#include "mesh_internal.h"
+#include "mesh-internal.h"
 
 #ifdef __cplusplus
 extern "C" {
index 4ea0a38..d80d032 100644 (file)
@@ -49,9 +49,6 @@ make %{?jobs:-j%jobs}
 rm -rf %{buildroot}
 %make_install
 
-mkdir -p %{buildroot}%{_datadir}/license
-cp LICENSE %{buildroot}%{_datadir}/license/%{name}
-
 %post -p /sbin/ldconfig
 
 %postun -p /sbin/ldconfig
@@ -59,7 +56,7 @@ cp LICENSE %{buildroot}%{_datadir}/license/%{name}
 %files
 %manifest capi-network-mesh.manifest
 %attr(644,-,-) %{_libdir}/libcapi-network-mesh.so.*
-/usr/share/license/capi-network-mesh
+%license LICENSE
 %{_bindir}/mesh_test
 
 %files devel
index eb19f80..436bcdb 100644 (file)
@@ -278,42 +278,6 @@ EXPORT_API int mesh_network_set_rssi(mesh_network_h network, int rssi)
        return MESH_ERROR_NONE;
 }
 
-EXPORT_API int mesh_network_get_data_rate(mesh_network_h network, int *data_rate)
-{
-       struct mesh_network_s *net = (struct mesh_network_s *)network;
-
-       CHECK_FEATURE_SUPPORTED(MESH_FEATURE);
-
-       if (network == NULL || data_rate == NULL) {
-               /* LCOV_EXCL_START */
-               LOGE("Invalid parameter");
-               return MESH_ERROR_INVALID_PARAMETER;
-               /* LCOV_EXCL_STOP */
-       }
-
-       *data_rate = net->data_rate;
-
-       return MESH_ERROR_NONE;
-}
-
-EXPORT_API int mesh_network_set_data_rate(mesh_network_h network, int data_rate)
-{
-       struct mesh_network_s *net = (struct mesh_network_s *)network;
-
-       CHECK_FEATURE_SUPPORTED(MESH_FEATURE);
-
-       if (network == NULL) {
-               /* LCOV_EXCL_START */
-               LOGE("Invalid parameter");
-               return MESH_ERROR_INVALID_PARAMETER;
-               /* LCOV_EXCL_STOP */
-       }
-
-       net->data_rate = data_rate;
-
-       return MESH_ERROR_NONE;
-}
-
 EXPORT_API int mesh_network_get_security(mesh_network_h network, mesh_security_type_e *security)
 {
        struct mesh_network_s *net = (struct mesh_network_s *)network;
@@ -422,16 +386,6 @@ EXPORT_API int mesh_initialize(mesh_h *mesh)
                /* LCOV_EXCL_STOP */
        }
 
-#if 0
-       rv = _mesh_init();
-       if (rv != MESH_ERROR_NONE) {
-               /* LCOV_EXCL_START */
-               LOGE("Failed to initialize mesh network");
-               return rv;
-               /* LCOV_EXCL_STOP */
-       }
-#endif
-
 #if !GLIB_CHECK_VERSION(2, 35, 0)
        g_type_init();
 #endif
@@ -506,17 +460,6 @@ EXPORT_API int mesh_scan(mesh_h handle)
        return rv;
 }
 
-EXPORT_API int mesh_cancel_scan(mesh_h handle)
-{
-       int rv = 0;
-       CHECK_FEATURE_SUPPORTED(MESH_FEATURE);
-
-       RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
-
-       rv = _mesh_cancel_scan(handle);
-       return rv;
-}
-
 EXPORT_API int mesh_specific_scan(mesh_h handle, const char* ssid, int channel)
 {
        int rv = 0;
@@ -607,29 +550,6 @@ EXPORT_API int mesh_get_joined_network(mesh_h handle, mesh_network_h *network)
        return rv;
 }
 
-EXPORT_API int mesh_set_gate(mesh_h handle, int gate_announce, int hwmp_root_mode, bool stp)
-{
-       int rv = 0;
-       int _stp = stp ? 1 : 0;
-       CHECK_FEATURE_SUPPORTED(MESH_FEATURE);
-
-       RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
-
-       rv = _mesh_set_gate(handle, gate_announce, hwmp_root_mode, _stp);
-       return rv;
-}
-
-EXPORT_API int mesh_unset_gate(mesh_h handle)
-{
-       int rv = 0;
-       CHECK_FEATURE_SUPPORTED(MESH_FEATURE);
-
-       RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
-
-       rv = _mesh_unset_gate(handle);
-       return rv;
-}
-
 EXPORT_API int mesh_set_softap(mesh_h handle, const char* ssid,
                const char* key, int channel, bool visibility,
                int max_stations, int security)
@@ -722,37 +642,3 @@ EXPORT_API int mesh_forget_mesh_network(mesh_h handle, mesh_network_h network)
        return rv;
 }
 
-EXPORT_API int mesh_get_stations_info(mesh_h handle, mesh_found_station_cb cb, void *user_data)
-{
-       int rv = 0;
-       CHECK_FEATURE_SUPPORTED(MESH_FEATURE);
-
-       RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
-
-       rv = _mesh_get_stations_info(handle, cb, user_data);
-       return rv;
-}
-
-EXPORT_API int mesh_get_mpath_info(mesh_h handle, mesh_found_mpath_cb cb, void *user_data)
-{
-       int rv = 0;
-       CHECK_FEATURE_SUPPORTED(MESH_FEATURE);
-
-       RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
-
-       rv = _mesh_get_mpath_info(handle, cb, user_data);
-       return rv;
-}
-
-EXPORT_API int mesh_set_interfaces(mesh_h handle,
-       const char *mesh, const char* gate, const char *softap)
-{
-       int rv = 0;
-       CHECK_FEATURE_SUPPORTED(MESH_FEATURE);
-
-       RETV_IF(NULL == mesh, MESH_ERROR_INVALID_PARAMETER);
-       RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
-
-       rv = _mesh_set_interfaces(handle, mesh, gate, softap);
-       return rv;
-}
index 8e851bc..91d4d4a 100644 (file)
 #include "mesh.h"
 #include "mesh_log.h"
 #include "mesh_private.h"
+#include "mesh_dbus.h"
 
 /**
  * Mesh network CAPI
  */
 
-int _mesh_init(mesh_h *mesh)
+EXPORT_API int mesh_network_get_data_rate(mesh_network_h network, int *data_rate)
 {
-       /* Initialize mesh network here.
-               If initialized already, does nothing */
+       struct mesh_network_s *net = (struct mesh_network_s *)network;
+
+       CHECK_FEATURE_SUPPORTED(MESH_FEATURE);
+
+       if (network == NULL || data_rate == NULL) {
+               /* LCOV_EXCL_START */
+               LOGE("Invalid parameter");
+               return MESH_ERROR_INVALID_PARAMETER;
+               /* LCOV_EXCL_STOP */
+       }
+
+       *data_rate = net->data_rate;
 
        return MESH_ERROR_NONE;
 }
 
-int _mesh_deinit(mesh_h mesh)
+EXPORT_API int mesh_network_set_data_rate(mesh_network_h network, int data_rate)
 {
-       /* De-initialize mesh network here.
-               If De-initialized already, does nothing */
+       struct mesh_network_s *net = (struct mesh_network_s *)network;
+
+       CHECK_FEATURE_SUPPORTED(MESH_FEATURE);
+
+       if (network == NULL) {
+               /* LCOV_EXCL_START */
+               LOGE("Invalid parameter");
+               return MESH_ERROR_INVALID_PARAMETER;
+               /* LCOV_EXCL_STOP */
+       }
+
+       net->data_rate = data_rate;
 
        return MESH_ERROR_NONE;
 }
+
+EXPORT_API int mesh_cancel_scan(mesh_h handle)
+{
+       int rv = 0;
+       CHECK_FEATURE_SUPPORTED(MESH_FEATURE);
+
+       RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
+
+       rv = _mesh_cancel_scan(handle);
+       return rv;
+}
+
+EXPORT_API int mesh_set_gate(mesh_h handle, int gate_announce, int hwmp_root_mode, bool stp)
+{
+       int rv = 0;
+       int _stp = stp ? 1 : 0;
+       CHECK_FEATURE_SUPPORTED(MESH_FEATURE);
+
+       RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
+
+       rv = _mesh_set_gate(handle, gate_announce, hwmp_root_mode, _stp);
+       return rv;
+}
+
+EXPORT_API int mesh_unset_gate(mesh_h handle)
+{
+       int rv = 0;
+       CHECK_FEATURE_SUPPORTED(MESH_FEATURE);
+
+       RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
+
+       rv = _mesh_unset_gate(handle);
+       return rv;
+}
+
+EXPORT_API int mesh_get_stations_info(mesh_h handle, mesh_found_station_cb cb, void *user_data)
+{
+       int rv = 0;
+       CHECK_FEATURE_SUPPORTED(MESH_FEATURE);
+
+       RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
+
+       rv = _mesh_get_stations_info(handle, cb, user_data);
+       return rv;
+}
+
+EXPORT_API int mesh_get_mpath_info(mesh_h handle, mesh_found_mpath_cb cb, void *user_data)
+{
+       int rv = 0;
+       CHECK_FEATURE_SUPPORTED(MESH_FEATURE);
+
+       RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
+
+       rv = _mesh_get_mpath_info(handle, cb, user_data);
+       return rv;
+}
+
+EXPORT_API int mesh_set_interfaces(mesh_h handle,
+       const char *mesh, const char* gate, const char *softap)
+{
+       int rv = 0;
+       CHECK_FEATURE_SUPPORTED(MESH_FEATURE);
+
+       RETV_IF(NULL == mesh, MESH_ERROR_INVALID_PARAMETER);
+       RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
+
+       rv = _mesh_set_interfaces(handle, mesh, gate, softap);
+       return rv;
+}
+
index b499a88..e6ff888 100644 (file)
@@ -19,7 +19,7 @@
 #define __COMMON_H__
 
 #include <mesh.h>
-#include <mesh_internal.h>
+#include <mesh-internal.h>
 
 __BEGIN_DECLS