*/
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
#define __MESH_DBUS_H__
#include "mesh.h"
-#include "mesh_internal.h"
+#include "mesh-internal.h"
#ifdef __cplusplus
extern "C" {
rm -rf %{buildroot}
%make_install
-mkdir -p %{buildroot}%{_datadir}/license
-cp LICENSE %{buildroot}%{_datadir}/license/%{name}
-
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%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
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;
/* 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
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;
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)
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;
-}
#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;
+}
+
#define __COMMON_H__
#include <mesh.h>
-#include <mesh_internal.h>
+#include <mesh-internal.h>
__BEGIN_DECLS