static void button_event_handler(uint32_t button_number)
{
__LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Button %u pressed\n", button_number);
uint32_t status = NRF_SUCCESS;
switch (button_number)
{
case 0:
case 1:
/* send unicast message, with inverted GPIO pin value */
status = simple_on_off_client_set(&m_clients[button_number],
!hal_led_pin_get(BSP_LED_0 + button_number));
break;
case 2:
case 3:
/* send a group message to the ODD group, with inverted GPIO pin value */
status = simple_on_off_client_set_unreliable(&m_clients[button_number],
!hal_led_pin_get(BSP_LED_0 + button_number),
GROUP_MSG_REPEAT_COUNT);
if (status == NRF_SUCCESS)
{
hal_led_pin_set(BSP_LED_0 + button_number, !hal_led_pin_get(BSP_LED_0 + button_number));
}
break;
default:
break;
}
这段程序,是SDK client端的按键发送单播和组播信息的程序,case 1:不是单播地址传的吗?而且我更改了client[1],client[2],client[3]发送消息,地址分别为0x0106,0x0107,0x0108的server分别响应了,我当时认为这个编号与client和server在模型pool中的添加相关,并且对应,不知是什么意思,还要请教一下老哥,谢谢!!