CHECK_FEATURE_SUPPORTED(MESH_FEATURE);
- if (network == NULL || meshid == NULL ) {
+ if (network == NULL || meshid == NULL) {
LOGE("Invalid parameter"); //LCOV_EXCL_LINE
return MESH_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
}
CHECK_FEATURE_SUPPORTED(MESH_FEATURE);
- if (network == NULL || bssid == NULL ) {
+ if (network == NULL || bssid == NULL) {
LOGE("Invalid parameter"); //LCOV_EXCL_LINE
return MESH_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
}
CHECK_FEATURE_SUPPORTED(MESH_FEATURE);
- if (network == NULL || channel == NULL ) {
+ if (network == NULL || channel == NULL) {
LOGE("Invalid parameter"); //LCOV_EXCL_LINE
return MESH_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
}
CHECK_FEATURE_SUPPORTED(MESH_FEATURE);
- if (network == NULL || rssi == NULL ) {
+ if (network == NULL || rssi == NULL) {
LOGE("Invalid parameter"); //LCOV_EXCL_LINE
return MESH_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
}
CHECK_FEATURE_SUPPORTED(MESH_FEATURE);
- if (network == NULL || data_rate == NULL ) {
+ if (network == NULL || data_rate == NULL) {
LOGE("Invalid parameter"); //LCOV_EXCL_LINE
return MESH_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
}
CHECK_FEATURE_SUPPORTED(MESH_FEATURE);
- if (network == NULL || security == NULL ) {
+ if (network == NULL || security == NULL) {
LOGE("Invalid parameter"); //LCOV_EXCL_LINE
return MESH_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
}
*mesh = handle;
rv = _mesh_dbus_start(*mesh);
- if (rv != MESH_ERROR_NONE) {
+ if (rv != MESH_ERROR_NONE)
LOGD("D-Bus init: (0x%X)", rv);
- }
return MESH_ERROR_NONE;
}
RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
rv = _mesh_get_scan_result(handle);
- if (MESH_ERROR_NONE != rv) {
+ if (MESH_ERROR_NONE != rv)
return rv;
- }
rv = _mesh_foreach_found_mesh_network(handle, cb, user_data);
return rv;
RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
rv = _mesh_find_peers(handle);
- if (MESH_ERROR_NONE != rv) {
+ if (MESH_ERROR_NONE != rv)
return rv;
- }
rv = _mesh_foreach_connected_peers(handle, cb, user_data);
return rv;
const char *buf = g_variant_get_string(val, &len);
memcpy(network_info->meshid, buf, len);
LOGD(" MeshID [%s]", network_info->meshid);
- }
- else if (strcasecmp(key, "bssid") == 0) {
+ } else if (strcasecmp(key, "bssid") == 0) {
const char *buf = g_variant_get_string(val, &len);
memcpy(network_info->bssid, buf, len);
LOGD(" BSSID [%s]", network_info->bssid);
- }
- else if (strcasecmp(key, "rssi") == 0) {
+ } else if (strcasecmp(key, "rssi") == 0) {
network_info->rssi = g_variant_get_int32(val);
LOGD(" RSSI [%d]", network_info->rssi);
- }
- else if (strcasecmp(key, "channel") == 0) {
+ } else if (strcasecmp(key, "channel") == 0) {
network_info->channel = g_variant_get_uint32(val);
LOGD(" Channel [%d]", network_info->channel);
- }
- else if (strcasecmp(key, "security") == 0) {
+ } else if (strcasecmp(key, "security") == 0) {
guint sec = g_variant_get_uint32(val);
network_info->security = ((1 == sec) ? MESH_SECURITY_SAE : MESH_SECURITY_NONE);
LOGD(" Security [%s]",
(MESH_SECURITY_SAE == network_info->security) ? "SAE" : "NONE");
- }
- else if (strcasecmp(key, "state") == 0) {
+ } else if (strcasecmp(key, "state") == 0) {
network_info->state = g_variant_get_uint32(val);
LOGD(" State [%d]", network_info->state);
}
{
struct mesh_mpath_dump_s *mpath = data;
- //g_free(mpath->dest_addr);
- //g_free(mpath->next_hop);
- //g_free(mpath->iface);
+ /*g_free(mpath->dest_addr);*/
+ /*g_free(mpath->next_hop);*/
+ /*g_free(mpath->iface);*/
g_free(mpath);
mpath = NULL;
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),
+ g_variant_new("(b)", (is_joined == 0) ? FALSE : TRUE),
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL, &error);
/* Add temporal mesh path buffer */
_mesh_add_mpath((gpointer)mpath);
- if (cb) {
+ if (cb)
cb(mpath, user_data);
- }
}
}
g_variant_iter_free(iter_row);
msg("");
msgp("Event received [%s]", _mesh_event_to_string(event_type));
- switch(event_type) {
- case MESH_MESH_ENABLED_EVENT: {
- msgp(" Mesh Network Enabled Result = %d", event->data.mesh_enable->result);
- } break;
- case MESH_SCAN_DONE_EVENT: {
- msgp(" Mesh Scan Done");
- } break;
- case MESH_CONNECTION_STATE_EVENT:{
- msgp(" Connection state changed [%s]",
- _mesh_connection_event_to_string(event->data.connection_state->state));
- msgp(" From Mesh ID[%-10s] BSSID[%s] Channel[%d] Security[%4s]",
- event->data.connection_state->mesh_id,
- event->data.connection_state->bssid,
- event->data.connection_state->channel,
- (MESH_SECURITY_SAE == event->data.connection_state->security) ? "SAE" : "NONE");
- } break;
- case MESH_STATION_JOIN_EVENT: {
- msgp(" New Station Joined = %s", event->data.sta_info->bssid);
- } break;
- case MESH_STATION_LEFT_EVENT: {
- msgp(" A Station Left = %s", event->data.sta_info->bssid);
- } break;
- default:
- msgr(" Unexpected event !");
- break;
+ switch (event_type) {
+ case MESH_MESH_ENABLED_EVENT: {
+ msgp(" Mesh Network Enabled Result = %d", event->data.mesh_enable->result);
+ } break;
+ case MESH_SCAN_DONE_EVENT: {
+ msgp(" Mesh Scan Done");
+ } break;
+ case MESH_CONNECTION_STATE_EVENT:{
+ msgp(" Connection state changed [%s]",
+ _mesh_connection_event_to_string(event->data.connection_state->state));
+ msgp(" From Mesh ID[%-10s] BSSID[%s] Channel[%d] Security[%4s]",
+ event->data.connection_state->mesh_id,
+ event->data.connection_state->bssid,
+ event->data.connection_state->channel,
+ (MESH_SECURITY_SAE == event->data.connection_state->security) ? "SAE" : "NONE");
+ } break;
+ case MESH_STATION_JOIN_EVENT: {
+ msgp(" New Station Joined = %s", event->data.sta_info->bssid);
+ } break;
+ case MESH_STATION_LEFT_EVENT: {
+ msgp(" A Station Left = %s", event->data.sta_info->bssid);
+ } break;
+ default:
+ msgr(" Unexpected event !");
+ break;
}
}
/* Clear previous found network list */
g_scan_net_idx = 1;
- if (g_found_network_list) {
+ if (g_found_network_list)
g_list_free_full(g_found_network_list, mesh_network_destroy);
- }
+
g_found_network_list = NULL;
ret = mesh_foreach_found_mesh_network(mesh, found_mesh_network_cb, NULL);