Skip to content
Permalink
Browse files

samples: mesh: removed redundant code

Remove redundant code from implementation.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
  • Loading branch information...
vikrant8051 authored and jhedberg committed May 9, 2019
1 parent 4835c0f commit 36a6adafd9b0718e5b1dc94762e0c9c6907b7c12
@@ -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);

@@ -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,

0 comments on commit 36a6ada

Please sign in to comment.
You can’t perform that action at this time.