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 <vikrant8051@gmail.com>
This commit is contained in:
Vikrant More 2018-08-15 21:13:12 +05:30 committed by Johan Hedberg
commit 0aafcd6453

View file

@ -17,24 +17,25 @@
#define GENERIC_LEVEL #define GENERIC_LEVEL
static bool is_randomization_of_TIDs_done; static bool is_randomization_of_TIDs_done;
static u8_t tid_level;
#ifdef VND_MODEL_TEST #if defined(ONOFF)
static u8_t tid_vnd;
#else
static u8_t tid_onoff; static u8_t tid_onoff;
#elif defined(VND_MODEL_TEST)
static u8_t tid_vnd;
#endif #endif
static u8_t tid_level;
void randomize_publishers_TID(void) void randomize_publishers_TID(void)
{ {
bt_rand(&tid_level, sizeof(tid_level)); #if defined(ONOFF)
#ifdef VND_MODEL_TEST
bt_rand(&tid_vnd, sizeof(tid_vnd));
#else
bt_rand(&tid_onoff, sizeof(tid_onoff)); bt_rand(&tid_onoff, sizeof(tid_onoff));
#elif defined(VND_MODEL_TEST)
bt_rand(&tid_vnd, sizeof(tid_vnd));
#endif #endif
bt_rand(&tid_level, sizeof(tid_level));
is_randomization_of_TIDs_done = true; is_randomization_of_TIDs_done = true;
} }
@ -165,7 +166,6 @@ void publish(struct k_work *work)
err = bt_mesh_model_publish(&root_models[16]); err = bt_mesh_model_publish(&root_models[16]);
#endif #endif
} else if (button_read(button_device[3], SW3_GPIO_PIN) == 0) { } else if (button_read(button_device[3], SW3_GPIO_PIN) == 0) {
#if defined(GENERIC_LEVEL) #if defined(GENERIC_LEVEL)
bt_mesh_model_msg_init(root_models[5].pub->msg, bt_mesh_model_msg_init(root_models[5].pub->msg,
BT_MESH_MODEL_OP_GEN_LEVEL_SET_UNACK); BT_MESH_MODEL_OP_GEN_LEVEL_SET_UNACK);