Mesh: Fix coding style 69/240169/1
authorAbhay Agarwal <ay.agarwal@samsung.com>
Tue, 4 Aug 2020 05:37:12 +0000 (11:07 +0530)
committerAbhay Agarwal <ay.agarwal@samsung.com>
Tue, 4 Aug 2020 05:41:41 +0000 (11:11 +0530)
This patch handles following
- Fix style according to coding guidelines
- Rename few events

Change-Id: I63f059d203b0537d575d5e21ad7f35f3c834a9ce
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
14 files changed:
bt-api/bt-mesh.c
bt-oal/bluez_hal/src/bt-hal-mesh-dbus-handler.c
bt-oal/hardware/bt_mesh.h
bt-oal/include/oal-event.h
bt-oal/include/oal-mesh.h
bt-oal/oal-mesh.c
bt-service/services/bt-service-event-receiver.c
bt-service/services/bt-service-main.c
bt-service/services/include/bt-service-mesh-util.h
bt-service/services/mesh/bt-service-mesh-cdb.c
bt-service/services/mesh/bt-service-mesh-config-client.c
bt-service/services/mesh/bt-service-mesh-main.c
bt-service/services/mesh/bt-service-mesh-model.c
bt-service/services/mesh/bt-service-mesh-network.c

index aac4f6b..71f8776 100644 (file)
@@ -118,7 +118,7 @@ BT_EXPORT_API int bluetooth_mesh_network_create(
        g_array_append_vals(in_param2, network_name,
                        BLUETOOTH_MESH_NETWORK_NAME_STRING_MAX);
 
-       for(int i = 0; i < total_models; i++)
+       for (int i = 0; i < total_models; i++)
                g_array_append_vals(in_param3, models[i],
                                sizeof(bluetooth_mesh_model_t));
 
@@ -328,9 +328,8 @@ BT_EXPORT_API int bluetooth_mesh_network_add_netkey(
        BT_INFO("Mesh:Set Create Subnetwork key");
        result = _bt_send_request(BT_BLUEZ_SERVICE, BT_MESH_NETWORK_ADD_NETKEY,
                        in_param1, in_param2, in_param3, in_param4, &out_param);
-       if (result == BLUETOOTH_ERROR_NONE) {
+       if (result == BLUETOOTH_ERROR_NONE)
                *netkey_idx = g_array_index(out_param, guint16, 0);
-       }
        BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
 
        return result;
@@ -400,9 +399,8 @@ BT_EXPORT_API int bluetooth_mesh_network_add_appkey(
        result = _bt_send_request(BT_BLUEZ_SERVICE, BT_MESH_NETWORK_ADD_APPKEY,
                        in_param1, in_param2, in_param3, in_param4, &out_param);
 
-       if (result == BLUETOOTH_ERROR_NONE) {
+       if (result == BLUETOOTH_ERROR_NONE)
                *appkey_index = g_array_index(out_param, guint16, 0);
-       }
        BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
 
        return result;
@@ -488,7 +486,7 @@ BT_EXPORT_API int bluetooth_mesh_network_get_all_nodes(
                                info = &g_array_index(out_param,
                                                bluetooth_mesh_node_info_t, i);
 
-                               data= g_memdup(info, sizeof(bluetooth_mesh_node_info_t));
+                               data = g_memdup(info, sizeof(bluetooth_mesh_node_info_t));
                                g_ptr_array_add(*nodes, (gpointer)data);
                        }
                }
@@ -730,9 +728,8 @@ BT_EXPORT_API int bluetooth_mesh_network_get_all_groups(
                } else {
                        size = (out_param->len) / sizeof(bluetooth_mesh_network_group_info_t);
 
-                       if (size == 0) {
+                       if (size == 0)
                                BT_INFO("Mesh: No Groups created for the network");
-                       }
 
                        BT_INFO("Mesh: Total groups [%d]", size);
                        for (i = 0; i < size; i++) {
@@ -741,7 +738,7 @@ BT_EXPORT_API int bluetooth_mesh_network_get_all_groups(
                                info = &g_array_index(out_param,
                                        bluetooth_mesh_network_group_info_t, i);
                                BT_INFO("Mesh: Group addr [0x%2.2x]", info->group_addr);
-                               BT_INFO("Mesh: Group is Virtual [%s]", info->is_virtual? "YES":"NO");
+                               BT_INFO("Mesh: Group is Virtual [%s]", info->is_virtual ? "YES" : "NO");
                                BT_INFO("Mesh: Group net UUID[%s]", info->net_uuid);
                                if (info->is_virtual)
                                        BT_INFO("Mesh: Virual Label UUID [%s]", info->label_uuid);
@@ -834,9 +831,8 @@ BT_EXPORT_API int bluetooth_mesh_netkey_get_all_appkey(
                } else {
                        size = (out_param->len) / sizeof(guint16);
 
-                       if (size == 0) {
+                       if (size == 0)
                                BT_ERR("Mesh: No Appkeys created for the NetKey in the network");
-                       }
 
                        for (i = 0; i < size; i++) {
                                uint16_t appkey_index;
index 482e0f3..7dcad56 100644 (file)
@@ -267,7 +267,7 @@ static unsigned char* __mesh_get_net_uuid_from_path(
        char uuid[33];
        size_t sz;
 
-       switch(iface) {
+       switch (iface) {
        case MESH_APP_IFACE:
        case MESH_PROV_IFACE:  {
                memcpy(uuid, is_prov ? (void*) &dbus_path[16] : (void*) &dbus_path[17], 32);
@@ -417,7 +417,7 @@ static gint __compare_element_index(gconstpointer data, gconstpointer user_data)
        if (!elem)
                return 1;
 
-       return (elem->index == elem_index ? 0: -1);
+       return (elem->index == elem_index ? 0 : -1);
 }
 
 static void __mesh_proxy_added(struct l_dbus_proxy *proxy, void *user_data)
@@ -839,9 +839,8 @@ static struct l_dbus_message *__mesh_device_message_received(struct l_dbus *dbus
        INFO("Mesh: Is Remote [%s]", rmt ? "YES" : "NO");
        INFO("Mesh: NetKey Idx [0x%2.2x]", idx);
        /* Send DevKeyMessage Received event */
-       if (mesh_event_cb) {
+       if (mesh_event_cb)
                mesh_event_cb(HAL_EV_MESH_DEVKEY_MESSAGE_EVENT, (void*)buf, size);
-       }
        return l_dbus_message_new_method_return(msg);
 }
 
@@ -892,7 +891,6 @@ static struct l_dbus_message *__mesh_message_received(struct l_dbus *dbus,
        /* Send Message Received event */
        if (mesh_event_cb) {
                INFO("Mesh: Send message event");
-               /* TO-DO */
                mesh_event_cb(HAL_EV_MESH_MESSAGE_EVENT, (void*)buf, size);
        }
        return l_dbus_message_new_method_return(msg);
@@ -944,9 +942,8 @@ static struct l_dbus_message *__mesh_scan_result_received(struct l_dbus *dbus,
        if (!l_dbus_message_get_arguments(msg, sig, &rssi, &iter, &opts)) {
                ERR("Mesh: Cannot parse scan results");
                ev.status = BT_STATUS_FAIL;
-               if (mesh_event_cb) {
+               if (mesh_event_cb)
                        mesh_event_cb(HAL_EV_MESH_SCAN_RESULT, (void*)&ev, sizeof(ev));
-               }
                return l_dbus_message_new_error(msg, dbus_err_args, NULL);
        }
 
@@ -954,9 +951,8 @@ static struct l_dbus_message *__mesh_scan_result_received(struct l_dbus *dbus,
                        n < 16) {
                ERR("Mesh: Cannot parse scan result: data");
                ev.status = BT_STATUS_FAIL;
-               if (mesh_event_cb) {
+               if (mesh_event_cb)
                        mesh_event_cb(HAL_EV_MESH_SCAN_RESULT, (void*)&ev, sizeof(ev));
-               }
                return l_dbus_message_new_error(msg, dbus_err_args, NULL);
        }
 
@@ -1231,7 +1227,7 @@ static void __mesh_fill_out_capabilities(meshcfg_app *app,
 }
 
 static bool __mesh_agent_capability_getter(
-               struct l_dbus *dbus,struct l_dbus_message *message,
+               struct l_dbus *dbus, struct l_dbus_message *message,
                        struct l_dbus_message_builder *builder,
                                void *user_data)
 {
@@ -1240,9 +1236,8 @@ static bool __mesh_agent_capability_getter(
        INFO("Mesh: app path [%s]", app->path);
        INFO("Mesh: Agent path [%s]", app->agent_path);
 
-       if (!l_dbus_message_builder_enter_array(builder, "s")) {
+       if (!l_dbus_message_builder_enter_array(builder, "s"))
                return false;
-       }
 
        __mesh_fill_out_capabilities(app, builder);
        __mesh_fill_in_capabilities(app, builder);
@@ -1353,7 +1348,7 @@ static struct l_dbus_message *__mesh_agent_display_numeric_request(
        }
 
        INFO("Mesh:[OUT] Numeric Authentication type [%s] value [%u]", str, n);
-       auth_value = l_strdup_printf("%u",n);
+       auth_value = l_strdup_printf("%u", n);
        ev.auth_type = __mesh_get_authentication_type(str);
        if (ev.auth_type == BT_HAL_MESH_UNKNOWN_AUTH_METHOD)
                return l_dbus_message_new_error(msg, dbus_err_fail, NULL);
@@ -1608,7 +1603,7 @@ static void __bt_mesh_hal_create_element_object(gpointer data, gpointer user_dat
        } else {
                elem = g_malloc0(sizeof(meshcfg_el));
                elem->index = model_info->elem_index;
-               elem->path = g_strdup_printf("%s/elem%u",app->path, elem->index);
+               elem->path = g_strdup_printf("%s/elem%u", app->path, elem->index);
                app->elements = g_slist_append(app->elements, elem);
                INFO("Mesh: Created element index [%d] path [%s]",
                        elem->index, elem->path);
@@ -1979,7 +1974,7 @@ static void __bt_hal_mesh_app_key_setup(struct l_dbus_message *msg,
        uint16_t net_idx = (uint16_t) req->net_idx;
        uint16_t app_idx = (uint16_t) req->app_idx;
 
-       if (g_strcmp0(req->str,"CreateAppKey") == 0)
+       if (g_strcmp0(req->str, "CreateAppKey") == 0)
                l_dbus_message_set_arguments(msg, "qq", net_idx, app_idx);
        else
                l_dbus_message_set_arguments(msg, "q", app_idx);
@@ -2199,7 +2194,7 @@ bt_status_t _bt_hal_mesh_auth_reply(bt_hal_mesh_auth_variant_e auth_type,
        /* For Alpha-Numeric */
        } else if (auth_type == BT_HAL_MESH_AUTH_REQ_ALPHANUMERIC_INPUT ||
                        auth_type == BT_HAL_MESH_AUTH_REQ_OOB_STATIC_KEY_INPUT ||
-                       auth_type == BT_HAL_MESH_AUTH_REQ_OOB_PUBLIC_KEY_INPUT ) {
+                       auth_type == BT_HAL_MESH_AUTH_REQ_OOB_PUBLIC_KEY_INPUT) {
                INFO("Mesh: Authentication reply: Alpha-Numeric Type");
                alpha = l_util_from_hexstring(auth_value, &sz);
                reply = l_dbus_message_new_method_return(agent_msg);
@@ -2264,9 +2259,8 @@ bt_status_t _bt_hal_mesh_create_network(
                return BT_STATUS_FAIL;
 
        /* Register DBUS APP */
-       if (!__bt_hal_mesh_register_application(app)) {
+       if (!__bt_hal_mesh_register_application(app))
                goto failed;
-       }
 
        if (app->token.u64 == 0) {
                INFO("Mesh: Create New Network");
index 6c68e1f..fe7b07a 100644 (file)
@@ -95,11 +95,11 @@ typedef struct {
 
 /** Bluetooth Mesh Security Token */
 typedef struct {
-        uint8_t token[8];
+       uint8_t token[8];
 } bt_mesh_token_t;
 
 typedef struct {
-        uint32_t scan_time;
+       uint32_t scan_time;
 } bt_hal_mesh_scan_param_t;
 
 typedef struct {
index fb2aca4..20d7e01 100644 (file)
@@ -198,7 +198,7 @@ extern "C" {
        EVENT(OAL_EVENT_MESH_NETKEY_EXECUTE_EVENT)  /* Subnet Operations (Add/Update/Delete) Event */\
        EVENT(OAL_EVENT_MESH_APPKEY_EXECUTE_EVENT)  /* AppKey Operations (Add/Update/Delete) Event */\
        EVENT(OAL_EVENT_MESH_DEVKEY_MESSAGE_RECEIVED)  /* DevKey message received Event */\
-       EVENT(OAL_EVENT_MESH_MESSAGE_RECEIVED)  /* Message received Event */\
+       EVENT(OAL_EVENT_MESH_MODEL_MESSAGE_RECEIVED)  /* Message received Event */\
        EVENT(OAL_EVENT_END)                                /* End of event*/\
 
 
index 9084aeb..a032e0d 100644 (file)
@@ -423,7 +423,7 @@ oal_status_t mesh_conf_send_key_message(oal_uuid_t *network_uuid,
  * @brief Sends Application message to be encrypted with appplication key
  *
  * @remarks These messages are generated by Models, which are
- * implemenetd by Tizen Application.
+ * implemented by Tizen Application.
  * @remarks Tizen Mesh Framework will not handle these mesages directly
  * and only transport these to and from application.
  *
index c4cab7a..63eeb5b 100644 (file)
@@ -280,7 +280,7 @@ static void mesh_message_received_callback(bt_uuid_t *net_uuid,
        memcpy(event->net_uuid.uuid, net_uuid->uu, sizeof(bt_uuid_t));
        memcpy(event->data, data, data_len);
 
-       send_event_bda_trace(OAL_EVENT_MESH_MESSAGE_RECEIVED, event,
+       send_event_bda_trace(OAL_EVENT_MESH_MODEL_MESSAGE_RECEIVED, event,
                sizeof(event_mesh_message_t), NULL);
 }
 
@@ -448,7 +448,7 @@ oal_status_t mesh_model_send_message(oal_uuid_t *network_uuid,
        ret = mesh_api->msg_execute((bt_uuid_t*)network_uuid,
                        dest, appkey_idx, buf, len);
        if (ret != BT_STATUS_SUCCESS) {
-               BT_ERR("MESH: Key Configuration Message sending failed: %s",
+               BT_ERR("MESH: Model Message sending failed: %s",
                        status2string(ret));
                return convert_to_oal_status(ret);
        }
index 7c52eca..9cdb30e 100644 (file)
@@ -420,7 +420,7 @@ static gboolean __bt_handle_oal_events(gpointer data)
        case OAL_EVENT_MESH_NETKEY_EXECUTE_EVENT:
        case OAL_EVENT_MESH_APPKEY_EXECUTE_EVENT:
        case OAL_EVENT_MESH_DEVKEY_MESSAGE_RECEIVED:
-       case OAL_EVENT_MESH_MESSAGE_RECEIVED:
+       case OAL_EVENT_MESH_MODEL_MESSAGE_RECEIVED:
                BT_INFO("Mesh: Event");
                if (mesh_cb)
                        mesh_cb(event_type, event_data);
index 782eaf2..fa2d3fb 100644 (file)
@@ -51,8 +51,8 @@
 
 /* ELL Start */
 struct ell_event_source {
-        GSource source;
-        GPollFD pollfd;
+       GSource source;
+       GPollFD pollfd;
 };
 
 static gboolean event_prepare(GSource *source, gint *timeout)
index 31af938..fdb5d69 100644 (file)
@@ -76,10 +76,10 @@ extern "C" {
 #define MESH_DEFAULT_START_ADDRESS   0x00aa
 #define MESH_DEFAULT_MAX_ADDRESS     (MESH_VIRTUAL_ADDRESS_LOW - 1)
 #define MESH_IS_VIRTUAL(x)           (((x) >= MESH_VIRTUAL_ADDRESS_LOW) && \
-                                        ((x) <= MESH_VIRTUAL_ADDRESS_HIGH))
+                                       ((x) <= MESH_VIRTUAL_ADDRESS_HIGH))
 #define MESH_IS_GROUP(x)             ((((x) >= MESH_GROUP_ADDRESS_LOW) && \
-                                        ((x) < MESH_FIXED_GROUP_HIGH)) || \
-                                        ((x) == MESH_ALL_NODES_ADDRESS))
+                                       ((x) < MESH_FIXED_GROUP_HIGH)) || \
+                                       ((x) == MESH_ALL_NODES_ADDRESS))
 
 #define MESH_IS_FIXED_GROUP_ADDRESS(x)       ((x) >= MESH_PROXIES_ADDRESS)
 #define MESH_IS_ALL_NODES(x) ((x) == MESH_ALL_NODES_ADDRESS)
index 2648190..743a95f 100644 (file)
@@ -968,7 +968,7 @@ uint16_t** _bt_mesh_conf_get_all_model_info(_bt_mesh_cdb_t *cfg,
                str = json_object_get_string(jentry);
                /* Only standard models are handled now */
                if (sscanf(str, "%04hx", models[i]) != 1) {
-                       for (int j =0 ; j < sz; j++)
+                       for (int j = 0 ; j < sz; j++)
                                g_free(models[j]);
                        g_free(models);
                        return NULL;
index 7dd440a..ef3436c 100644 (file)
@@ -233,7 +233,7 @@ static void __bt_mesh_wait_response_timeout(
        /* TODO Reset the remote node, as no response is expected on reset command */
 
 
-       switch(req->cmd->opcode) {
+       switch (req->cmd->opcode) {
        case MESH_OPCODE_DEV_COMP_GET: {
                /* Send event with timeout for Vendor Features */
                bluetooth_mesh_node_features_t *vendor_event = \
@@ -341,7 +341,7 @@ static void __bt_mesh_add_request(uint32_t opcode, uint16_t dest,
                return;
        _bt_mesh_util_convert_hex_to_string((uint8_t *) net_uuid, 16, uuid_str,
                BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH + 1);
-       BT_INFO("Mesh: Net UUID[%s]",uuid_str);
+       BT_INFO("Mesh: Net UUID[%s]", uuid_str);
 
        BT_INFO("Mesh: Adding command opcode [0x%2.2x] response [0x%2.2x]",
                        cmd->opcode, cmd->response);
@@ -378,11 +378,11 @@ static struct mesh_pending_request *__bt_mesh_get_request_by_response(
                BT_INFO("Mesh: Current req addr [0x%2.2x] res [0x%2.2x]", addr, response);
                _bt_mesh_util_convert_hex_to_string((uint8_t *) net_uuid, 16, uuid_str,
                                BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH + 1);
-               BT_INFO("Mesh: Net UUID[%s]",uuid_str);
+               BT_INFO("Mesh: Net UUID[%s]", uuid_str);
 
                _bt_mesh_util_convert_hex_to_string((uint8_t *) req->net_uuid, 16, uuid_str1,
                                BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH + 1);
-               BT_INFO("Mesh: Net UUID1[%s]",uuid_str1);
+               BT_INFO("Mesh: Net UUID1[%s]", uuid_str1);
                if (!memcmp(net_uuid, req->net_uuid, 16) &&
                                req->addr == addr &&
                                req->cmd->response == response)
@@ -1150,8 +1150,8 @@ void _bt_mesh_config_client_devkey_msg_handler(
 
 
        switch (opcode & ~MESH_OPCODE_UNRELIABLE) {
-               default:
-                       return;
+       default:
+               return;
        case MESH_OPCODE_CONFIG_MODEL_PUB_STATUS: {
                if (data_len != 12 && data_len != 14)
                        break;
@@ -2076,7 +2076,7 @@ int _bt_mesh_model_set_publication(const char *app_cred, const char *sender,
 
        if (req->pub_addr != MESH_UNASSIGNED_ADDRESS) {
                if (MESH_IS_VIRTUAL(req->pub_addr)) {
-                       if(!_bt_mesh_network_get_label_uuid_from_sub_addr(
+                       if (!_bt_mesh_network_get_label_uuid_from_sub_addr(
                                        net_uuid.uuid, req->pub_addr, label_uuid))
                                return BLUETOOTH_ERROR_INVALID_PARAM;
                        opcode = MESH_OPCODE_CONFIG_MODEL_PUB_VIRT_SET;
@@ -2429,7 +2429,7 @@ static bool __bt_mesh_check_pending_key_cmd(uint16_t dest, bool is_netkey,
        const struct mesh_config_cmd *cmd;
 
        if (is_netkey) {
-               switch(op) {
+               switch (op) {
                case BLUETOOTH_MESH_NODE_KEY_ADD:
                        cmd = __mesh_get_command(MESH_OPCODE_NETKEY_ADD);
                        if (!cmd)
@@ -2462,7 +2462,7 @@ static bool __bt_mesh_check_pending_key_cmd(uint16_t dest, bool is_netkey,
                        return false;
                }
        } else {
-               switch(op) {
+               switch (op) {
                case BLUETOOTH_MESH_NODE_KEY_ADD:
                        cmd = __mesh_get_command(MESH_OPCODE_APPKEY_ADD);
                        if (!cmd)
@@ -2563,7 +2563,7 @@ int _bt_mesh_node_configure_key(const char *app_cred, const char *sender,
                /* Handle Key (App/Net) Update & Add Commands: Key Config message  */
                update = (opcode == MESH_OPCODE_NETKEY_UPDATE || opcode == MESH_OPCODE_APPKEY_UPDATE);
                ret = mesh_conf_send_key_message(&net_uuid, req->primary_unicast, req->is_netkey,
-                               update, req->is_netkey? req->netkey_idx: req->appkey_idx, netkey_idx);
+                               update, req->is_netkey ? req->netkey_idx : req->appkey_idx, netkey_idx);
        }
        if (ret != OAL_STATUS_SUCCESS) {
                BT_ERR("ret: %d", ret);
index fb5b80d..fc45634 100644 (file)
@@ -244,7 +244,7 @@ static void __bt_mesh_handle_pending_request_info(int result,
                        _bt_mesh_util_convert_hex_to_string((uint8_t *) event->net_uuid.uuid, 16, net_uuid,
                                BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH + 1);
 
-                        BT_DBG("Request Sender: [%s]", req_info->sender);
+                       BT_DBG("Request Sender: [%s]", req_info->sender);
                        if (!g_strcmp0(network->uuid, net_uuid)) {
                                out_param = g_array_new(FALSE, FALSE, sizeof(gchar));
                                g_array_append_vals(out_param, &event->app_idx, sizeof(guint16));
@@ -671,7 +671,7 @@ static void __handle_mesh_events(int event_type,
                        (event_mesh_devkey_message_t*)event_data);
                BT_PERMANENT_LOG("Mesh: DevKey Message Received event");
                break;
-       case OAL_EVENT_MESH_MESSAGE_RECEIVED:
+       case OAL_EVENT_MESH_MODEL_MESSAGE_RECEIVED:
                __handle_mesh_message_received_event(
                        (event_mesh_message_t*)event_data);
                BT_PERMANENT_LOG("Mesh: Model Message Received event");
index 3df36f1..491fcf4 100644 (file)
@@ -134,7 +134,7 @@ static void __bt_mesh_wait_response_timeout(
                        req->cmd->descriptor, req->addr);
 
 
-       switch(req->cmd->opcode) {
+       switch (req->cmd->opcode) {
        case MESH_OPCODE_MODEL_GENERIC_ONOFF_GET:
        case MESH_OPCODE_MODEL_GENERIC_ONOFF_SET:
                /* Send event with timeout */
@@ -164,7 +164,7 @@ static void __bt_mesh_add_request(uint32_t opcode, uint16_t dest,
                return;
        _bt_mesh_util_convert_hex_to_string((uint8_t *) net_uuid, 16, uuid_str,
                BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH + 1);
-       BT_INFO("Mesh: Net UUID[%s]",uuid_str);
+       BT_INFO("Mesh: Net UUID[%s]", uuid_str);
 
        BT_INFO("Mesh: Adding command opcode [0x%2.2x] response [0x%2.2x]",
                        cmd->opcode, cmd->response);
@@ -201,11 +201,11 @@ static struct mesh_pending_request *__bt_mesh_get_request_by_response(
                BT_INFO("Mesh: Current req addr [0x%4.4x] res [0x%4.4x]", addr, response);
                _bt_mesh_util_convert_hex_to_string((uint8_t *) net_uuid, 16, uuid_str,
                                BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH + 1);
-               BT_INFO("Mesh: Net UUID[%s]",uuid_str);
+               BT_INFO("Mesh: Net UUID[%s]", uuid_str);
 
                _bt_mesh_util_convert_hex_to_string((uint8_t *) req->net_uuid, 16, uuid_str1,
                                BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH + 1);
-               BT_INFO("Mesh: Net UUID1[%s]",uuid_str1);
+               BT_INFO("Mesh: Net UUID1[%s]", uuid_str1);
                if (!memcmp(net_uuid, req->net_uuid, 16) &&
                                req->addr == addr &&
                                req->cmd->response == response)
@@ -321,9 +321,8 @@ void _bt_mesh_msg_handler(event_mesh_message_t *event)
        } else
                return;
 
-       for (int msg_idx = 0; msg_idx < data_len; msg_idx++ ) {
+       for (int msg_idx = 0; msg_idx < data_len; msg_idx++)
                BT_INFO("Mesh: Message data[%d]: [%2.2X]", msg_idx, data[msg_idx]);
-       }
 
        BT_INFO("Mesh: Received %s (len %u) opcode [0x%2.2x]",
                __mesh_get_opcode_string(opcode), data_len, opcode);
@@ -359,8 +358,6 @@ void _bt_mesh_msg_handler(event_mesh_message_t *event)
        BT_INFO("Send response");
 
        switch (opcode & ~MESH_OPCODE_UNRELIABLE) {
-               default:
-                       return;
        case MESH_OPCODE_MODEL_GENERIC_ONOFF_STATUS: {
                BT_INFO("Received Generic On off status");
 
@@ -369,14 +366,15 @@ void _bt_mesh_msg_handler(event_mesh_message_t *event)
                        BT_INFO("No pending req for this status");
                        break;
                }
-               if (cmd->opcode == MESH_OPCODE_MODEL_GENERIC_ONOFF_GET) {
+               if (cmd->opcode == MESH_OPCODE_MODEL_GENERIC_ONOFF_GET)
                        BT_INFO("Mesh: Resp recvd: MESH_OPCODE_MODEL_GENERIC_ONOFF_GET");
-               } else if (cmd->opcode == MESH_OPCODE_MODEL_GENERIC_ONOFF_SET) {
+               else if (cmd->opcode == MESH_OPCODE_MODEL_GENERIC_ONOFF_SET)
                        BT_INFO("Mesh: Resp recvd: MESH_OPCODE_MODEL_GENERIC_ONOFF_SET");
-               } else {
+               else
                        BT_INFO("Request opcode do not match !");
-               }
        }
+       default:
+               return;
        }
        __bt_mesh_handle_pending_msg_request_info(result,
                BT_MESH_MODEL_EXECUTE_MSG, &param,
index b938079..ccda8b5 100644 (file)
@@ -1541,7 +1541,7 @@ int _bt_mesh_network_get_groups(const char *app_cred, const char *sender,
                        grp.is_virtual = false;
                        grp.group_addr = group->grp_addr;
                        BT_INFO("Mesh: Found Non-Virtual group, addr[0x%2.2x]", group->grp_addr);
-               } else if (MESH_IS_VIRTUAL(group->grp_addr)){
+               } else if (MESH_IS_VIRTUAL(group->grp_addr)) {
                        grp.is_virtual = true;
                        grp.group_addr = group->grp_addr;
                        _bt_mesh_util_convert_hex_to_string((uint8_t *) group->label_uuid,