int custom_led_bt_msg_handler(int *msg)
{
struct bt_event *bt = (struct bt_event *)msg;
switch (msg[0] & 0xff) {
case BT_STATUS_FIRST_CONNECTED:
led_ui_manager_display(0, LED_WHILE_10S_FLASH, 0);
break;
case BT_STATUS_SECOND_CONNECTED:
break;
case BT_STATUS_FIRST_DISCONNECT:
break;
case BT_STATUS_SECOND_DISCONNECT: //两个手机断开,可能会是两次BT_STATUS_SECOND_DISCONNECT
break;
}
return 0;
}
APP_MSG_HANDLER(custom_led_bt_msg_entry) = {
.owner = 0xff,
.from = MSG_FROM_BT_STACK,
.handler = custom_led_bt_msg_handler,
};