Hello,
Here i are using nRF52832 ,softdevice S132 and mesh sdk v3.0.0
For my Application,i need to go with DFU.so i merged my application into the example code of DFU provided by MESH SDK.
As my Application needs BUTTON related functions.so for this i have added this code
hal_buttons_init(button_event_handler);
static void button_event_handler(uint32_t button_number)
{
switch (button_number)
{
/*When switch 0 is pressed*/
case 0:
{
AF_ButtonState = BUTTON0;
__LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "----- BUTTON0 -----\n");
}
break;
/*When switch 1 is pressed*/
case 1:
{
AF_ButtonState = BUTTON1;
__LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "----- BUTTON1 -----\n");
}
break;
/*When switch 2 is pressed*/
case 2:
{
AF_ButtonState = BUTTON2;
__LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "----- BUTTON2 -----\n");
}
break;
/*When switch 3 is pressed*/
case 3:
{
AF_ButtonState = BUTTON3;
__LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "----- BUTTON3 -----\n");
}
break;
/*When switch 4 is pressed*/
case 4:
{
AF_ButtonState = BUTTON4;
__LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "----- BUTTON4 -----\n");
}
break;
default:
AF_ButtonState = BUTTON_IDLE;
break;
}
}
so when ever BUTTON actions happen,it is not going to the handler and nothing is printing in the LOG as well.
As given in MESH sdk (SERVER code example).
i have enabled RTT also,
rtt_input_enable(app_rtt_input_handler, RTT_INPUT_POLL_PERIOD_MS);
static void app_rtt_input_handler(int key)
{
if (key >= '0' && key <= '4')
{
uint32_t button_number = key - '0';
button_event_handler(button_number);
}
}
As MESH DFU example doesn't have BUTTON related functions,so i have added the above things,but here nothings seems to go quite well with my application.
So i hope could anyone help me in this regards
thank you.