Mesh: unit test: set transition time for node control 20/242820/2
authorAbhay Agarwal <ay.agarwal@samsung.com>
Tue, 1 Sep 2020 04:01:55 +0000 (09:31 +0530)
committerAbhay Agarwal <ay.agarwal@samsung.com>
Tue, 1 Sep 2020 06:28:33 +0000 (11:58 +0530)
Default values for the Generic Default Transition Step Resolution
and the Default Transition Number of Steps are implementation
speficic and are defined by a device manufacturer.
This patch sets transition time while controlling node.

Change-Id: I5cfbfd186efc9957790ec16b156fc18fa037cc41
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
src/bluetooth-mesh.c
tests/test/bt_mesh_unit_test.c

index b814d6a..f93498c 100644 (file)
@@ -3148,7 +3148,7 @@ int bt_mesh_model_send_msg(bt_mesh_model_h model,
                strlen(msg_params->data), msg_params->data);
 
                req.msg_len = strlen(msg_params->data);
-               g_strlcpy(req.msg, msg_params->data, sizeof(msg_params->data) + 1);
+               g_strlcpy(req.msg, msg_params->data, req.msg_len + 1);
        } else {
                req.msg_len = 0;
        }
@@ -3204,7 +3204,7 @@ int bt_mesh_group_send_msg(bt_mesh_group_h group,
                strlen(msg_params->data), msg_params->data);
 
                req.msg_len = strlen(msg_params->data);
-               g_strlcpy(req.msg, msg_params->data, sizeof(msg_params->data) + 1);
+               g_strlcpy(req.msg, msg_params->data, req.msg_len + 1);
        } else {
                req.msg_len = 0;
        }
index f8980fd..85980bd 100644 (file)
@@ -1789,8 +1789,13 @@ int test_input_callback(void *data)
                                        TC_PRT("Model Creation Failed!");
                                        break;
                                }
-                               /* Sleep for 100 msec to allow network Proxy attach */
-                               usleep(100000);
+
+                               /*
+                                * System-d has start-limit on number of process to be started in given time
+                                * Sleep for 2000 msec
+                                */
+                               usleep(2000);
+
                                /* Create Network */
                                network_name = g_strdup_printf("TestMeshNet%d", i);
                                bt_mesh_network_h net_h;
@@ -2731,7 +2736,7 @@ int test_input_callback(void *data)
                                model_h = GUINT_TO_POINTER(strtoul(g_test_param.params[0], NULL, 16));
                        }
 
-                       const char *msg_s = "0101";
+                       const char *msg_s = "01010000";
                        msg_params.opcode = 0x8202;
                        msg_params.data = g_strdup(msg_s);
                        ret = __bt_mesh_model_send_msg(model_h, appkey_h, &msg_params,
@@ -2749,7 +2754,7 @@ int test_input_callback(void *data)
                                model_h = GUINT_TO_POINTER(strtoul(g_test_param.params[0], NULL, 16));
                        }
 
-                       const char *msg_s = "0001";
+                       const char *msg_s = "00010000";
                        msg_params.opcode = 0x8202;
                        msg_params.data = g_strdup(msg_s);
                        ret = __bt_mesh_model_send_msg(model_h, appkey_h, &msg_params,
@@ -2767,7 +2772,7 @@ int test_input_callback(void *data)
                                group_h = GUINT_TO_POINTER(strtoul(g_test_param.params[0], NULL, 16));
                        }
 
-                       const char *msg_s = "0101";
+                       const char *msg_s = "01010000";
                        msg_params.opcode = 0x8202;
                        msg_params.data = g_strdup(msg_s);
                        ret = __bt_mesh_group_send_msg(group_h, appkey_h, &msg_params,
@@ -2785,7 +2790,7 @@ int test_input_callback(void *data)
                                group_h = GUINT_TO_POINTER(strtoul(g_test_param.params[0], NULL, 16));
                        }
 
-                       const char *msg_s = "0001";
+                       const char *msg_s = "00010000";
                        msg_params.opcode = 0x8202;
                        msg_params.data = g_strdup(msg_s);
                        ret = __bt_mesh_group_send_msg(group_h, appkey_h, &msg_params,