Hi,
I'm trying to use the light_switch example in the Mesh SDK 2.1.1 to build a small experiment to count how many messages are received by the server when sending a consecutive number of messages from the client.
My first approach was to use a function on the client side that consecutively sends a message every 100ms up to a maximum number of messages, using the simple_on_off_client_set_unreliable() like this:
static void send_repeated_message()
{
for(uint8_t i= 0; i <=10; i++)
{
simple_on_off_client_set_unreliable(&m_clients[0], 1, 1);
nrf_delay_ms(100);
__LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Number of message sent: %u\n", i);
}
}
And on the server side, I modified the on_off_server_set_cb() function to simply count the number of messages received:
static bool on_off_server_set_cb(const simple_on_off_server_t * p_server, bool value)
{
//__LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Got SET command to %u\n", value);
//hal_led_pin_set(LED_PIN_NUMBER, value);
counter += 1;
__LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Number of message received: %u\n", counter);
//return value;
}
And also, I commented the line (void)simple_on_off_server_status_publish(p_server, value); in the handle_set_unreliable_cb(); to avoid sending the server status in reply to the client.
My problem is that in the server side I only see the count of received messages after the client has finished sending ALL the messages and no matter how many messages I send from client, I only receive maximum 5 messages in the server every time!
What could be the reason for this behavior and how to work around this issue?
Thank you in advance!
Regards,
Paulo Zacarias



