rv = _mesh_dbus_start(*mesh);
if (rv != MESH_ERROR_NONE) {
- LOGD("D-Bus init: [%s](0x%X)", _mesh_internal_error_to_string(rv), rv);
+ LOGD("D-Bus init: (0x%X)", rv);
}
return MESH_ERROR_NONE;
RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
rv = _mesh_set_event_cb(handle, event_handler);
- if (rv == MESH_ITNL_ERR_IO_ERROR) {
- return MESH_ERROR_IO_ERROR;
- }
-
- return MESH_ERROR_NONE;
+ return rv;
}
EXPORT_API int mesh_enable(mesh_h handle)
RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
rv = _mesh_enable(handle);
- if (rv == MESH_ITNL_ERR_IO_ERROR) {
- return MESH_ERROR_IO_ERROR;
- }
-
- return MESH_ERROR_NONE;
+ return rv;
}
EXPORT_API int mesh_disable(mesh_h handle)
RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
rv = _mesh_disable(handle);
- if (rv == MESH_ITNL_ERR_IO_ERROR) {
- return MESH_ERROR_IO_ERROR;
- }
-
- return MESH_ERROR_NONE;
+ return rv;
}
EXPORT_API int mesh_scan(mesh_h handle)
RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
rv = _mesh_scan(handle);
- if (rv == MESH_ITNL_ERR_IO_ERROR) {
- return MESH_ERROR_IO_ERROR;
- }
-
- return MESH_ERROR_NONE;
+ return rv;
}
EXPORT_API int mesh_cancel_scan(mesh_h handle)
RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
rv = _mesh_cancel_scan(handle);
- if (rv == MESH_ITNL_ERR_IO_ERROR) {
- return MESH_ERROR_IO_ERROR;
- }
-
- return MESH_ERROR_NONE;
+ return rv;
}
EXPORT_API int mesh_specific_scan(mesh_h handle, const char* ssid, int channel)
RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
rv = _mesh_specific_scan(handle, ssid, channel);
- if (rv == MESH_ITNL_ERR_IO_ERROR) {
- return MESH_ERROR_IO_ERROR;
- }
-
- return MESH_ERROR_NONE;
+ return rv;
}
EXPORT_API int mesh_foreach_found_mesh_network(mesh_h handle,
RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
rv = _mesh_get_scan_result(handle);
- if (rv == MESH_ITNL_ERR_IO_ERROR) {
- return MESH_ERROR_IO_ERROR;
+ if (MESH_ERROR_NONE != rv) {
+ return rv;
}
rv = _mesh_foreach_found_mesh_network(handle, cb, user_data);
- if (rv == MESH_ITNL_ERR_IO_ERROR) {
- return MESH_ERROR_IO_ERROR;
- }
-
- return MESH_ERROR_NONE;
+ return rv;
}
EXPORT_API int mesh_enable_mesh(mesh_h handle)
RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
rv = _mesh_enable_mesh(handle);
- if (rv == MESH_ITNL_ERR_IO_ERROR) {
- return MESH_ERROR_IO_ERROR;
- }
-
- return MESH_ERROR_NONE;
+ return rv;
}
EXPORT_API int mesh_disable_mesh(mesh_h handle)
RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
rv = _mesh_disable_mesh(handle);
- if (rv == MESH_ITNL_ERR_IO_ERROR) {
- return MESH_ERROR_IO_ERROR;
- }
-
- return MESH_ERROR_NONE;
+ return rv;
}
EXPORT_API int mesh_is_joined(mesh_h handle, int* is_joined)
RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
rv = _mesh_is_joined(handle, is_joined);
- if (rv == MESH_ITNL_ERR_IO_ERROR) {
- return MESH_ERROR_IO_ERROR;
- }
-
- return MESH_ERROR_NONE;
+ return rv;
}
EXPORT_API int mesh_get_joined_network(mesh_h handle, mesh_network_h *network)
RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
rv = _mesh_get_joined_mesh_network(handle, network);
- if (rv == MESH_ITNL_ERR_IO_ERROR) {
- return MESH_ERROR_IO_ERROR;
- }
-
- return MESH_ERROR_NONE;
+ return rv;
}
EXPORT_API int mesh_set_gate(mesh_h handle, bool stp, bool gate_announce)
RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
rv = _mesh_set_gate(handle, stp, gate_announce);
- if (rv == MESH_ITNL_ERR_IO_ERROR) {
- return MESH_ERROR_IO_ERROR;
- }
-
- return MESH_ERROR_NONE;
+ return rv;
}
EXPORT_API int mesh_unset_gate(mesh_h handle)
RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
rv = _mesh_unset_gate(handle);
- if (rv == MESH_ITNL_ERR_IO_ERROR) {
- return MESH_ERROR_IO_ERROR;
- }
-
- return MESH_ERROR_NONE;
+ return rv;
}
EXPORT_API int mesh_set_softap(mesh_h handle, const char* ssid,
rv = _mesh_set_softap(handle, ssid, key, buf, channel,
visibility, max_stations, security);
- if (rv == MESH_ITNL_ERR_IO_ERROR) {
- return MESH_ERROR_IO_ERROR;
- }
-
- return MESH_ERROR_NONE;
+ return rv;
}
EXPORT_API int mesh_enable_softap(mesh_h handle)
RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
rv = _mesh_enable_softap(handle);
- if (rv == MESH_ITNL_ERR_IO_ERROR) {
- return MESH_ERROR_IO_ERROR;
- }
-
- return MESH_ERROR_NONE;
+ return rv;
}
EXPORT_API int mesh_disable_softap(mesh_h handle)
RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
rv = _mesh_disable_softap(handle);
- if (rv == MESH_ITNL_ERR_IO_ERROR) {
- return MESH_ERROR_IO_ERROR;
- }
-
- return MESH_ERROR_NONE;
+ return rv;
}
EXPORT_API int mesh_create_mesh_network(mesh_h handle, mesh_network_h network)
RETV_IF(NULL == network, MESH_ERROR_INVALID_PARAMETER);
rv = _mesh_create_network(handle, network);
- if (rv == MESH_ITNL_ERR_IO_ERROR) {
- return MESH_ERROR_IO_ERROR;
- }
-
- return MESH_ERROR_NONE;
+ return rv;
}
EXPORT_API int mesh_connect_mesh_network(mesh_h handle, mesh_network_h network)
RETV_IF(NULL == network, MESH_ERROR_INVALID_PARAMETER);
rv = _mesh_connect_network(handle, network);
- if (rv == MESH_ITNL_ERR_IO_ERROR) {
- return MESH_ERROR_IO_ERROR;
- }
-
- return MESH_ERROR_NONE;
+ return rv;
}
EXPORT_API int mesh_disconnect_mesh_network(mesh_h handle, mesh_network_h network)
RETV_IF(NULL == network, MESH_ERROR_INVALID_PARAMETER);
rv = _mesh_disconnect_network(handle, network);
- if (rv == MESH_ITNL_ERR_IO_ERROR) {
- return MESH_ERROR_IO_ERROR;
- }
-
- return MESH_ERROR_NONE;
+ return rv;
}
EXPORT_API int mesh_forget_mesh_network(mesh_h handle, mesh_network_h network)
RETV_IF(NULL == network, MESH_ERROR_INVALID_PARAMETER);
rv = _mesh_forget_network(handle, network);
- if (rv == MESH_ITNL_ERR_IO_ERROR) {
- return MESH_ERROR_IO_ERROR;
- }
-
- return MESH_ERROR_NONE;
+ return rv;
}
EXPORT_API int mesh_get_stations_info(mesh_h handle, mesh_found_station_cb cb, void *user_data)
RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
rv = _mesh_get_stations_info(handle, cb, user_data);
- if (rv == MESH_ITNL_ERR_IO_ERROR) {
- return MESH_ERROR_IO_ERROR;
- }
-
- return MESH_ERROR_NONE;
+ return rv;
}
EXPORT_API int mesh_get_mpath_info(mesh_h handle, mesh_found_mpath_cb cb, void *user_data)
RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
rv = _mesh_get_mpath_info(handle, cb, user_data);
- if (rv == MESH_ITNL_ERR_IO_ERROR) {
- return MESH_ERROR_IO_ERROR;
- }
-
- return MESH_ERROR_NONE;
+ return rv;
}
EXPORT_API int mesh_set_interfaces(mesh_h handle,
RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
rv = _mesh_set_interfaces(handle, mesh, gate, softap);
- if (rv == MESH_ITNL_ERR_IO_ERROR) {
- return MESH_ERROR_IO_ERROR;
- }
-
- return MESH_ERROR_NONE;
+ return rv;
}
-
struct mesh_handle *h = handle;
if (NULL == h)
- return MESH_ITNL_ERR_INVALID_PARAM;
+ return MESH_ERROR_INVALID_PARAMETER;
if (h->dbus_connection != NULL)
- return MESH_ITNL_ERR_ALREADY_REGISTERED;
+ return MESH_ERROR_ALREADY_IN_PROGRESS;
h->dbus_connection = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
if (h->dbus_connection == NULL) {
LOGE("Failed to connect to the D-BUS daemon [%s]", error->message);
g_error_free(error);
}
- return MESH_ITNL_ERR_UNKNOWN;
+ return MESH_ERROR_IO_ERROR;
}
id = g_signal_connect(h->dbus_connection, "notify::g-name-owner",
LOGE("g_signal_connect() Fail");
g_object_unref(h->dbus_connection);
h->dbus_connection = NULL;
- return MESH_ITNL_ERR_IO_ERROR;
+ return MESH_ERROR_IO_ERROR;
}
- return MESH_ITNL_ERR_NONE;
+ return MESH_ERROR_NONE;
}
static int _mesh_close_gdbus_call(mesh_h handle)
g_object_unref(h->dbus_connection);
h->dbus_connection = NULL;
- return MESH_ITNL_ERR_NONE;
+ return MESH_ERROR_NONE;
}
struct mesh_network_list_s {
/* Clear previous scan results */
_mesh_remove_networks();
- RETV_IF(NULL == h->dbus_connection, MESH_ITNL_ERR_IO_ERROR);
- RETV_IF(NULL == _gproxy_mesh_service, MESH_ITNL_ERR_IO_ERROR);
+ RETV_IF(NULL == h->dbus_connection, MESH_ERROR_IO_ERROR);
+ RETV_IF(NULL == _gproxy_mesh_service, MESH_ERROR_IO_ERROR);
variant = g_dbus_proxy_call_sync(_gproxy_mesh_service, "get_found_mesh_networks",
NULL,
} else if (error) {
LOGE("Failed DBus call [%s]", error->message);
g_error_free(error);
- return MESH_ITNL_ERR_IO_ERROR;
+ return MESH_ERROR_IO_ERROR;
}
- return MESH_ITNL_ERR_NONE;
+ return MESH_ERROR_NONE;
}
static void _mesh_signal_handler(GDBusConnection *connection,
int rv;
rv = _mesh_create_gdbus_call(handle);
- if (MESH_ITNL_ERR_NONE != rv)
+ if (MESH_ERROR_NONE != rv)
return rv;
h->ca = g_cancellable_new();
/* Create all proxies here */
_gproxy_mesh_service = _proxy_get_mesh_service(h);
RETVM_IF(NULL == _gproxy_mesh_service,
- MESH_ITNL_ERR_IO_ERROR, "Couldn't get _gproxy_mesh_service");
+ MESH_ERROR_IO_ERROR, "Couldn't get _gproxy_mesh_service");
g_dbus_proxy_set_default_timeout(
G_DBUS_PROXY(_gproxy_mesh_service), MESH_DBUS_PROXY_TIMEOUT);
/* Subscribe events */
_mesh_subscribe_event(handle);
- return MESH_ITNL_ERR_NONE;
+ return MESH_ERROR_NONE;
}
int _mesh_dbus_stop(mesh_h handle)
int rv;
if (NULL == h)
- return MESH_ITNL_ERR_INVALID_PARAM;
+ return MESH_ERROR_INVALID_PARAMETER;
/* Unref all proxies here */
if (_gproxy_mesh_service) {
int _mesh_set_event_cb(mesh_h handle, mesh_event_cb event_handler)
{
struct mesh_handle *h = handle;
- RETV_IF(NULL == h, MESH_ITNL_ERR_INVALID_PARAM);
+ RETV_IF(NULL == h, MESH_ERROR_INVALID_PARAMETER);
h->event_handler = event_handler;
- return MESH_ITNL_ERR_NONE;
+ return MESH_ERROR_NONE;
}
int _mesh_enable(mesh_h handle)
GError *error = NULL;
struct mesh_handle *h = handle;
- RETV_IF(NULL == h->dbus_connection, MESH_ITNL_ERR_IO_ERROR);
+ RETV_IF(NULL == h->dbus_connection, MESH_ERROR_IO_ERROR);
variant = g_dbus_connection_call_sync(h->dbus_connection,
MESH_MANAGER_NAME,
} else if (error) {
LOGE("Failed DBus call [%s]", error->message);
g_error_free(error);
- return MESH_ITNL_ERR_IO_ERROR;
+ return MESH_ERROR_IO_ERROR;
}
- return MESH_ITNL_ERR_NONE;
+ return MESH_ERROR_NONE;
}
int _mesh_disable(mesh_h handle)
_mesh_remove_networks();
_mesh_remove_mpath();
- RETV_IF(NULL == h->dbus_connection, MESH_ITNL_ERR_IO_ERROR);
+ RETV_IF(NULL == h->dbus_connection, MESH_ERROR_IO_ERROR);
variant = g_dbus_connection_call_sync(h->dbus_connection,
MESH_MANAGER_NAME,
} else if (error) {
LOGE("Failed DBus call [%s]", error->message);
g_error_free(error);
- return MESH_ITNL_ERR_IO_ERROR;
+ return MESH_ERROR_IO_ERROR;
}
h->event_handler = NULL;
- return MESH_ITNL_ERR_NONE;
+ return MESH_ERROR_NONE;
}
int _mesh_scan(mesh_h handle)
GError *error = NULL;
struct mesh_handle *h = handle;
- RETV_IF(NULL == h->dbus_connection, MESH_ITNL_ERR_IO_ERROR);
- RETV_IF(NULL == _gproxy_mesh_service, MESH_ITNL_ERR_IO_ERROR);
+ RETV_IF(NULL == h->dbus_connection, MESH_ERROR_IO_ERROR);
+ RETV_IF(NULL == _gproxy_mesh_service, MESH_ERROR_IO_ERROR);
variant = g_dbus_proxy_call_sync(_gproxy_mesh_service, "scan",
NULL,
} else if (error) {
LOGE("Failed DBus call [%s]", error->message);
g_error_free(error);
- return MESH_ITNL_ERR_IO_ERROR;
+ return MESH_ERROR_IO_ERROR;
}
- return MESH_ITNL_ERR_NONE;
+ return MESH_ERROR_NONE;
}
int _mesh_specific_scan(mesh_h handle, const char* ssid, int channel)
GError *error = NULL;
struct mesh_handle *h = handle;
- RETV_IF(NULL == h->dbus_connection, MESH_ITNL_ERR_IO_ERROR);
- RETV_IF(NULL == _gproxy_mesh_service, MESH_ITNL_ERR_IO_ERROR);
+ RETV_IF(NULL == h->dbus_connection, MESH_ERROR_IO_ERROR);
+ RETV_IF(NULL == _gproxy_mesh_service, MESH_ERROR_IO_ERROR);
variant = g_dbus_proxy_call_sync(_gproxy_mesh_service, "specific_scan",
g_variant_new("(si)", ssid, channel),
} else if (error) {
LOGE("Failed DBus call [%s]", error->message);
g_error_free(error);
- return MESH_ITNL_ERR_IO_ERROR;
+ return MESH_ERROR_IO_ERROR;
}
- return MESH_ITNL_ERR_NONE;
+ return MESH_ERROR_NONE;
}
int _mesh_cancel_scan(mesh_h handle)
GError *error = NULL;
struct mesh_handle *h = handle;
- RETV_IF(NULL == h->dbus_connection, MESH_ITNL_ERR_IO_ERROR);
- RETV_IF(NULL == _gproxy_mesh_service, MESH_ITNL_ERR_IO_ERROR);
+ RETV_IF(NULL == h->dbus_connection, MESH_ERROR_IO_ERROR);
+ RETV_IF(NULL == _gproxy_mesh_service, MESH_ERROR_IO_ERROR);
variant = g_dbus_proxy_call_sync(_gproxy_mesh_service, "cancel_scan",
NULL,
} else if (error) {
LOGE("Failed DBus call [%s]", error->message);
g_error_free(error);
- return MESH_ITNL_ERR_IO_ERROR;
+ return MESH_ERROR_IO_ERROR;
}
- return MESH_ITNL_ERR_NONE;
+ return MESH_ERROR_NONE;
}
int _mesh_foreach_found_mesh_network(mesh_h handle,
struct mesh_network_s *data = NULL;
struct mesh_handle *h = handle;
- RETV_IF(NULL == h->dbus_connection, MESH_ITNL_ERR_IO_ERROR);
- RETV_IF(NULL == _gproxy_mesh_service, MESH_ITNL_ERR_IO_ERROR);
- RETV_IF(NULL == cb, MESH_ITNL_ERR_INVALID_PARAM);
+ RETV_IF(NULL == h->dbus_connection, MESH_ERROR_IO_ERROR);
+ RETV_IF(NULL == _gproxy_mesh_service, MESH_ERROR_IO_ERROR);
+ RETV_IF(NULL == cb, MESH_ERROR_INVALID_PARAMETER);
if (0 >= g_list_length(g_networks.list)) {
LOGD("No scan result");
- return MESH_ITNL_ERR_NONE;
+ return MESH_ERROR_NONE;
}
/* Get a first item */
i++;
}
- return MESH_ITNL_ERR_NONE;
+ return MESH_ERROR_NONE;
}
int _mesh_enable_mesh(mesh_h handle)
GError *error = NULL;
struct mesh_handle *h = handle;
- RETV_IF(NULL == h->dbus_connection, MESH_ITNL_ERR_IO_ERROR);
- RETV_IF(NULL == _gproxy_mesh_service, MESH_ITNL_ERR_IO_ERROR);
+ RETV_IF(NULL == h->dbus_connection, MESH_ERROR_IO_ERROR);
+ RETV_IF(NULL == _gproxy_mesh_service, MESH_ERROR_IO_ERROR);
variant = g_dbus_proxy_call_sync(_gproxy_mesh_service, "enable_mesh",
NULL,
} else if (error) {
LOGE("Failed DBus call [%s]", error->message);
g_error_free(error);
- return MESH_ITNL_ERR_IO_ERROR;
+ return MESH_ERROR_IO_ERROR;
}
- return MESH_ITNL_ERR_NONE;
+ return MESH_ERROR_NONE;
}
int _mesh_disable_mesh(mesh_h handle)
GError *error = NULL;
struct mesh_handle *h = handle;
- RETV_IF(NULL == h->dbus_connection, MESH_ITNL_ERR_IO_ERROR);
- RETV_IF(NULL == _gproxy_mesh_service, MESH_ITNL_ERR_IO_ERROR);
+ RETV_IF(NULL == h->dbus_connection, MESH_ERROR_IO_ERROR);
+ RETV_IF(NULL == _gproxy_mesh_service, MESH_ERROR_IO_ERROR);
variant = g_dbus_proxy_call_sync(_gproxy_mesh_service, "disable_mesh",
NULL,
} else if (error) {
LOGE("Failed DBus call [%s]", error->message);
g_error_free(error);
- return MESH_ITNL_ERR_IO_ERROR;
+ return MESH_ERROR_IO_ERROR;
}
- return MESH_ITNL_ERR_NONE;
+ return MESH_ERROR_NONE;
}
/* TODO: Parameter verification required */
GError *error = NULL;
struct mesh_handle *h = handle;
- RETV_IF(NULL == h->dbus_connection, MESH_ITNL_ERR_IO_ERROR);
- RETV_IF(NULL == _gproxy_mesh_service, MESH_ITNL_ERR_IO_ERROR);
+ RETV_IF(NULL == h->dbus_connection, MESH_ERROR_IO_ERROR);
+ RETV_IF(NULL == _gproxy_mesh_service, MESH_ERROR_IO_ERROR);
variant = g_dbus_proxy_call_sync(_gproxy_mesh_service, "is_joined",
g_variant_new("(b)", (is_joined==0) ? FALSE : TRUE),
} else if (error) {
LOGE("Failed DBus call [%s]", error->message);
g_error_free(error);
- return MESH_ITNL_ERR_IO_ERROR;
+ return MESH_ERROR_IO_ERROR;
}
- return MESH_ITNL_ERR_NONE;
+ return MESH_ERROR_NONE;
}
struct mesh_network_s g_joined_network;
GError *error = NULL;
struct mesh_handle *h = handle;
- RETV_IF(NULL == h->dbus_connection, MESH_ITNL_ERR_IO_ERROR);
- RETV_IF(NULL == _gproxy_mesh_service, MESH_ITNL_ERR_IO_ERROR);
- RETV_IF(NULL == _network, MESH_ITNL_ERR_INVALID_PARAM);
+ RETV_IF(NULL == h->dbus_connection, MESH_ERROR_IO_ERROR);
+ RETV_IF(NULL == _gproxy_mesh_service, MESH_ERROR_IO_ERROR);
+ RETV_IF(NULL == _network, MESH_ERROR_INVALID_PARAMETER);
variant = g_dbus_proxy_call_sync(_gproxy_mesh_service, "get_joined_mesh_network",
NULL,
g_variant_get(variant, "(ssiu)", &meshid, &bssid, &channel, &result);
LOGD("get_joined_mesh_network status 0x%x", result);
- if (MESH_ITNL_ERR_NONE != result)
+ if (MESH_ERROR_NONE != result)
return (int)result;
if (meshid) {
} else if (error) {
LOGE("Failed DBus call [%s]", error->message);
g_error_free(error);
- return MESH_ITNL_ERR_IO_ERROR;
+ return MESH_ERROR_IO_ERROR;
}
- return MESH_ITNL_ERR_NONE;
+ return MESH_ERROR_NONE;
}
int _mesh_set_gate(mesh_h handle, bool stp, bool gate_announce)
GError *error = NULL;
struct mesh_handle *h = handle;
- RETV_IF(NULL == h->dbus_connection, MESH_ITNL_ERR_IO_ERROR);
- RETV_IF(NULL == _gproxy_mesh_service, MESH_ITNL_ERR_IO_ERROR);
+ RETV_IF(NULL == h->dbus_connection, MESH_ERROR_IO_ERROR);
+ RETV_IF(NULL == _gproxy_mesh_service, MESH_ERROR_IO_ERROR);
variant = g_dbus_proxy_call_sync(_gproxy_mesh_service, "set_gate",
g_variant_new("(bb)", stp, gate_announce),
} else if (error) {
LOGE("Failed DBus call [%s]", error->message);
g_error_free(error);
- return MESH_ITNL_ERR_IO_ERROR;
+ return MESH_ERROR_IO_ERROR;
}
- return MESH_ITNL_ERR_NONE;
+ return MESH_ERROR_NONE;
}
int _mesh_unset_gate(mesh_h handle)
GError *error = NULL;
struct mesh_handle *h = handle;
- RETV_IF(NULL == h->dbus_connection, MESH_ITNL_ERR_IO_ERROR);
- RETV_IF(NULL == _gproxy_mesh_service, MESH_ITNL_ERR_IO_ERROR);
+ RETV_IF(NULL == h->dbus_connection, MESH_ERROR_IO_ERROR);
+ RETV_IF(NULL == _gproxy_mesh_service, MESH_ERROR_IO_ERROR);
variant = g_dbus_proxy_call_sync(_gproxy_mesh_service, "unset_gate",
NULL,
} else if (error) {
LOGE("Failed DBus call [%s]", error->message);
g_error_free(error);
- return MESH_ITNL_ERR_IO_ERROR;
+ return MESH_ERROR_IO_ERROR;
}
- return MESH_ITNL_ERR_NONE;
+ return MESH_ERROR_NONE;
}
int _mesh_set_softap(mesh_h handle, const char* ssid,
GError *error = NULL;
struct mesh_handle *h = handle;
- RETV_IF(NULL == h->dbus_connection, MESH_ITNL_ERR_IO_ERROR);
- RETV_IF(NULL == _gproxy_mesh_service, MESH_ITNL_ERR_IO_ERROR);
+ RETV_IF(NULL == h->dbus_connection, MESH_ERROR_IO_ERROR);
+ RETV_IF(NULL == _gproxy_mesh_service, MESH_ERROR_IO_ERROR);
variant = g_dbus_proxy_call_sync(_gproxy_mesh_service, "set_softap",
g_variant_new("(sssiiii)", ssid, key, mode,
} else if (error) {
LOGE("Failed DBus call [%s]", error->message);
g_error_free(error);
- return MESH_ITNL_ERR_IO_ERROR;
+ return MESH_ERROR_IO_ERROR;
}
- return MESH_ITNL_ERR_NONE;
+ return MESH_ERROR_NONE;
}
int _mesh_enable_softap(mesh_h handle)
GError *error = NULL;
struct mesh_handle *h = handle;
- RETV_IF(NULL == h->dbus_connection, MESH_ITNL_ERR_IO_ERROR);
- RETV_IF(NULL == _gproxy_mesh_service, MESH_ITNL_ERR_IO_ERROR);
+ RETV_IF(NULL == h->dbus_connection, MESH_ERROR_IO_ERROR);
+ RETV_IF(NULL == _gproxy_mesh_service, MESH_ERROR_IO_ERROR);
variant = g_dbus_proxy_call_sync(_gproxy_mesh_service, "enable_softap",
NULL,
} else if (error) {
LOGE("Failed DBus call [%s]", error->message);
g_error_free(error);
- return MESH_ITNL_ERR_IO_ERROR;
+ return MESH_ERROR_IO_ERROR;
}
- return MESH_ITNL_ERR_NONE;
+ return MESH_ERROR_NONE;
}
int _mesh_disable_softap(mesh_h handle)
GError *error = NULL;
struct mesh_handle *h = handle;
- RETV_IF(NULL == h->dbus_connection, MESH_ITNL_ERR_IO_ERROR);
- RETV_IF(NULL == _gproxy_mesh_service, MESH_ITNL_ERR_IO_ERROR);
+ RETV_IF(NULL == h->dbus_connection, MESH_ERROR_IO_ERROR);
+ RETV_IF(NULL == _gproxy_mesh_service, MESH_ERROR_IO_ERROR);
variant = g_dbus_proxy_call_sync(_gproxy_mesh_service, "disable_softap",
NULL,
} else if (error) {
LOGE("Failed DBus call [%s]", error->message);
g_error_free(error);
- return MESH_ITNL_ERR_IO_ERROR;
+ return MESH_ERROR_IO_ERROR;
}
- return MESH_ITNL_ERR_NONE;
+ return MESH_ERROR_NONE;
}
int _mesh_create_network(mesh_h handle, mesh_network_h _network)
struct mesh_handle *h = handle;
struct mesh_network_s *n = _network;
- RETV_IF(NULL == h->dbus_connection, MESH_ITNL_ERR_IO_ERROR);
- RETV_IF(NULL == _gproxy_mesh_service, MESH_ITNL_ERR_IO_ERROR);
+ RETV_IF(NULL == h->dbus_connection, MESH_ERROR_IO_ERROR);
+ RETV_IF(NULL == _gproxy_mesh_service, MESH_ERROR_IO_ERROR);
variant = g_dbus_proxy_call_sync(_gproxy_mesh_service, "create_mesh_network",
g_variant_new("(sii)", n->meshid, n->channel, n->security),
} else if (error) {
LOGE("Failed DBus call [%s]", error->message);
g_error_free(error);
- return MESH_ITNL_ERR_IO_ERROR;
+ return MESH_ERROR_IO_ERROR;
}
- return MESH_ITNL_ERR_NONE;
+ return MESH_ERROR_NONE;
}
int _mesh_connect_network(mesh_h handle, mesh_network_h _network)
struct mesh_handle *h = handle;
struct mesh_network_s *n = _network;
- RETV_IF(NULL == h->dbus_connection, MESH_ITNL_ERR_IO_ERROR);
- RETV_IF(NULL == _gproxy_mesh_service, MESH_ITNL_ERR_IO_ERROR);
+ RETV_IF(NULL == h->dbus_connection, MESH_ERROR_IO_ERROR);
+ RETV_IF(NULL == _gproxy_mesh_service, MESH_ERROR_IO_ERROR);
variant = g_dbus_proxy_call_sync(_gproxy_mesh_service, "connect_mesh_network",
g_variant_new("(sii)", n->meshid, n->channel, n->security),
} else if (error) {
LOGE("Failed DBus call [%s]", error->message);
g_error_free(error);
- return MESH_ITNL_ERR_IO_ERROR;
+ return MESH_ERROR_IO_ERROR;
}
- return MESH_ITNL_ERR_NONE;
+ return MESH_ERROR_NONE;
}
int _mesh_disconnect_network(mesh_h handle, mesh_network_h _network)
struct mesh_handle *h = handle;
struct mesh_network_s *n = _network;
- RETV_IF(NULL == h->dbus_connection, MESH_ITNL_ERR_IO_ERROR);
- RETV_IF(NULL == _gproxy_mesh_service, MESH_ITNL_ERR_IO_ERROR);
+ RETV_IF(NULL == h->dbus_connection, MESH_ERROR_IO_ERROR);
+ RETV_IF(NULL == _gproxy_mesh_service, MESH_ERROR_IO_ERROR);
variant = g_dbus_proxy_call_sync(_gproxy_mesh_service, "disconnect_mesh_network",
g_variant_new("(sii)", n->meshid, n->channel, n->security),
} else if (error) {
LOGE("Failed DBus call [%s]", error->message);
g_error_free(error);
- return MESH_ITNL_ERR_IO_ERROR;
+ return MESH_ERROR_IO_ERROR;
}
- return MESH_ITNL_ERR_NONE;
+ return MESH_ERROR_NONE;
}
int _mesh_forget_network(mesh_h handle, mesh_network_h _network)
struct mesh_handle *h = handle;
struct mesh_network_s *n = _network;
- RETV_IF(NULL == h->dbus_connection, MESH_ITNL_ERR_IO_ERROR);
- RETV_IF(NULL == _gproxy_mesh_service, MESH_ITNL_ERR_IO_ERROR);
+ RETV_IF(NULL == h->dbus_connection, MESH_ERROR_IO_ERROR);
+ RETV_IF(NULL == _gproxy_mesh_service, MESH_ERROR_IO_ERROR);
LOGD("mesid=%s channel=%d security=%d", n->meshid, n->channel, n->security);
} else if (error) {
LOGE("Failed DBus call [%s]", error->message);
g_error_free(error);
- return MESH_ITNL_ERR_IO_ERROR;
+ return MESH_ERROR_IO_ERROR;
}
- return MESH_ITNL_ERR_NONE;
+ return MESH_ERROR_NONE;
}
GVariant *val;
gsize len = 0;
- RETV_IF(NULL == h->dbus_connection, MESH_ITNL_ERR_IO_ERROR);
- RETV_IF(NULL == _gproxy_mesh_service, MESH_ITNL_ERR_IO_ERROR);
+ RETV_IF(NULL == h->dbus_connection, MESH_ERROR_IO_ERROR);
+ RETV_IF(NULL == _gproxy_mesh_service, MESH_ERROR_IO_ERROR);
variant = g_dbus_proxy_call_sync(_gproxy_mesh_service, "get_station_info",
NULL,
} else if (error) {
LOGE("Failed DBus call [%s]", error->message);
g_error_free(error);
- return MESH_ITNL_ERR_IO_ERROR;
+ return MESH_ERROR_IO_ERROR;
}
- return MESH_ITNL_ERR_NONE;
+ return MESH_ERROR_NONE;
}
int _mesh_get_mpath_info(mesh_h handle, mesh_found_mpath_cb cb, void *user_data)
GVariant *val;
gsize len = 0;
- RETV_IF(NULL == h->dbus_connection, MESH_ITNL_ERR_IO_ERROR);
- RETV_IF(NULL == _gproxy_mesh_service, MESH_ITNL_ERR_IO_ERROR);
+ RETV_IF(NULL == h->dbus_connection, MESH_ERROR_IO_ERROR);
+ RETV_IF(NULL == _gproxy_mesh_service, MESH_ERROR_IO_ERROR);
variant = g_dbus_proxy_call_sync(_gproxy_mesh_service, "get_mpath_info",
NULL,
} else if (error) {
LOGE("Failed DBus call [%s]", error->message);
g_error_free(error);
- return MESH_ITNL_ERR_IO_ERROR;
+ return MESH_ERROR_IO_ERROR;
}
- return MESH_ITNL_ERR_NONE;
+ return MESH_ERROR_NONE;
}
int _mesh_set_interfaces(mesh_h handle, const char *mesh, const char *gate, const char *softap)
GError *error = NULL;
struct mesh_handle *h = handle;
- RETV_IF(NULL == h->dbus_connection, MESH_ITNL_ERR_IO_ERROR);
- RETV_IF(NULL == _gproxy_mesh_service, MESH_ITNL_ERR_IO_ERROR);
+ RETV_IF(NULL == h->dbus_connection, MESH_ERROR_IO_ERROR);
+ RETV_IF(NULL == _gproxy_mesh_service, MESH_ERROR_IO_ERROR);
variant = g_dbus_proxy_call_sync(_gproxy_mesh_service, "set_interfaces",
g_variant_new("(sss)", mesh, gate, softap),
} else if (error) {
LOGE("Failed DBus call [%s]", error->message);
g_error_free(error);
- return MESH_ITNL_ERR_IO_ERROR;
+ return MESH_ERROR_IO_ERROR;
}
- return MESH_ITNL_ERR_NONE;
+ return MESH_ERROR_NONE;
}