- Change to return valid return code on repeated call.
mesh_enable_mesh
mesh_disable_mesh
- Change policy of return code
mesh_cancel_scan
mesh_disable_softap
- Add method
mesh_is_joined
* @see mesh_found_mesh_network_cb()
*
*/
-int mesh_is_joined(mesh_h handle, int* is_joined);
+int mesh_is_joined(mesh_h handle, bool* is_joined);
/**
* @brief Gets current joined mesh network information.
mesh_connected_peer_cb cb, void *user_data);
int _mesh_enable_mesh(mesh_h handle);
int _mesh_disable_mesh(mesh_h handle);
-int _mesh_is_joined(mesh_h handle, int* is_joined);
+int _mesh_is_joined(mesh_h handle, bool* is_joined);
int _mesh_get_joined_mesh_network(mesh_h handle, mesh_network_h* _network);
int _mesh_set_gate(mesh_h handle, bool stp, bool gate_announce);
int _mesh_unset_gate(mesh_h handle);
return rv;
}
-EXPORT_API int mesh_is_joined(mesh_h handle, int* is_joined)
+EXPORT_API int mesh_is_joined(mesh_h handle, bool* is_joined)
{
int rv = 0;
CHECK_FEATURE_SUPPORTED(MESH_FEATURE);
}
/* TODO: Parameter verification required */
-int _mesh_is_joined(mesh_h handle, int* is_joined)
+int _mesh_is_joined(mesh_h handle, bool* is_joined)
{
GVariant *variant = NULL;
int result = MESH_ERROR_NONE;
GError *error = NULL;
+ gboolean state;
struct mesh_handle *h = handle;
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),
+ NULL,
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL, &error);
if (variant) {
- g_variant_get(variant, "(i)", &result);
+ g_variant_get(variant, "(bi)", &state, &result);
LOGD("Mesh is_joined status 0x%x", result);
result = __convert_service_error_type(result);
+ *is_joined = ((state) ? true : false);
} else if (error) {
LOGE("Failed DBus call [%s]", error->message);
g_error_free(error);
char *_meshid = NULL;
char *_bssid = NULL;
int _channel = -1;
+ bool joined = false;
mesh_connection_state_e _state = MESH_CONNECTION_STATE_DISCONNECTED;
mesh_security_type_e _security = MESH_SECURITY_NONE;
mesh_network_h network = NULL;
msg("Get Joined Mesh Network Information");
+ ret = mesh_is_joined(mesh, &joined);
+ if (MESH_ERROR_NONE != ret) {
+ msgr("Failed to check network join status: [%s(0x%X)]",
+ mesh_error_to_string(ret), ret);
+ return RET_FAILURE;
+ }
+
ret = mesh_get_joined_network(mesh, &network);
if (MESH_ERROR_NONE != ret) {
msgr("Failed to get joined mesh network: [%s(0x%X)]",