Commit 36a6adaf authored by Vikrant More's avatar Vikrant More Committed by Johan Hedberg
Browse files

samples: mesh: removed redundant code



Remove redundant code from implementation.

Signed-off-by: default avatarVikrant More <vikrant8051@gmail.com>
parent 4835c0f2
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -11,7 +11,6 @@
#include "ble_mesh.h"
#include "device_composition.h"
#include "no_transition_work_handler.h"
#include "publisher.h"
#include "state_binding.h"
#include "storage.h"
#include "transition.h"
@@ -207,8 +206,6 @@ void main(void)

	update_light_state();

	randomize_publishers_TID();

	short_time_multireset_bt_mesh_unprovisioning();
	k_timer_start(&reset_counter_timer, K_MSEC(7000), 0);

+0 −19
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@
#define ONOFF
#define GENERIC_LEVEL

static bool is_randomization_of_TIDs_done;

#if (defined(ONOFF) || defined(ONOFF_TT))
static u8_t tid_onoff;
#elif defined(VND_MODEL_TEST)
@@ -26,19 +24,6 @@ static u8_t tid_vnd;

static u8_t tid_level;

void randomize_publishers_TID(void)
{
#if (defined(ONOFF) || defined(ONOFF_TT))
	bt_rand(&tid_onoff, sizeof(tid_onoff));
#elif defined(VND_MODEL_TEST)
	bt_rand(&tid_vnd, sizeof(tid_vnd));
#endif

	bt_rand(&tid_level, sizeof(tid_level));

	is_randomization_of_TIDs_done = true;
}

static u32_t button_read(struct device *port, u32_t pin)
{
	u32_t val = 0U;
@@ -51,10 +36,6 @@ void publish(struct k_work *work)
{
	int err = 0;

	if (is_randomization_of_TIDs_done == false) {
		return;
	}

	if (button_read(button_device[0], SW0_GPIO_PIN) == 0U) {
#if defined(ONOFF)
		bt_mesh_model_msg_init(root_models[3].pub->msg,