From 0aafcd6453a63bee7c85de254c6d9acfcc98c20c Mon Sep 17 00:00:00 2001 From: Vikrant More Date: Wed, 15 Aug 2018 21:13:12 +0530 Subject: [PATCH] samples: mesh: nrf52 : to solve remaining PTS issues Fixed coding style issues. Corrected conditional compilation using pre-processor directives at proper location. Signed-off-by: Vikrant More --- .../src/mesh/publisher.c | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/samples/boards/nrf52/mesh/onoff_level_lighting_vnd_app/src/mesh/publisher.c b/samples/boards/nrf52/mesh/onoff_level_lighting_vnd_app/src/mesh/publisher.c index 5643ef0e653..49fdb1dddde 100644 --- a/samples/boards/nrf52/mesh/onoff_level_lighting_vnd_app/src/mesh/publisher.c +++ b/samples/boards/nrf52/mesh/onoff_level_lighting_vnd_app/src/mesh/publisher.c @@ -17,24 +17,25 @@ #define GENERIC_LEVEL static bool is_randomization_of_TIDs_done; -static u8_t tid_level; -#ifdef VND_MODEL_TEST -static u8_t tid_vnd; -#else +#if defined(ONOFF) static u8_t tid_onoff; +#elif defined(VND_MODEL_TEST) +static u8_t tid_vnd; #endif +static u8_t tid_level; + void randomize_publishers_TID(void) { - bt_rand(&tid_level, sizeof(tid_level)); - -#ifdef VND_MODEL_TEST - bt_rand(&tid_vnd, sizeof(tid_vnd)); -#else +#if defined(ONOFF) 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; } @@ -165,7 +166,6 @@ void publish(struct k_work *work) err = bt_mesh_model_publish(&root_models[16]); #endif } else if (button_read(button_device[3], SW3_GPIO_PIN) == 0) { - #if defined(GENERIC_LEVEL) bt_mesh_model_msg_init(root_models[5].pub->msg, BT_MESH_MODEL_OP_GEN_LEVEL_SET_UNACK);