Beispiel #1
0
void 
ez_event_long(void)
{
	int ez_action = nvram_get_int("ez_action_long");
	switch (ez_action)
	{
	case 7:
	case 8:
		alarmtimer(0, 0);
		LED_CONTROL(LED_POWER, LED_OFF);
		break;
	default:
		alarmtimer(NORMAL_PERIOD, 0);
		LED_CONTROL(LED_POWER, LED_ON);
		break;
	}
	
	switch (ez_action)
	{
	case 1: // WiFi 2.4GHz force ON/OFF trigger
		ez_action_force_toggle_wifi24();
		break;
	case 2: // WiFi 5GHz force ON/OFF trigger
		ez_action_force_toggle_wifi5();
		break;
	case 3: // WiFi 2.4 and 5GHz force ON/OFF trigger
		ez_action_force_toggle_wifi24();
		ez_action_force_toggle_wifi5();
		break;
	case 4: // Safe removal all USB
		ez_action_usb_saferemoval();
		break;
	case 5: // WAN down
		ez_action_wan_down();
		break;
	case 6: // WAN reconnect
		ez_action_wan_reconnect();
		break;
	case 7: // Router reboot
		sys_exit();
		break;
	case 8: // Router shutdown prepare
		ez_action_shutdown();
		break;
	case 9: // WAN up/down toggle
		ez_action_wan_toggle();
		break;
	case 10: // Run user script (/opt/bin/on_wps.sh 2)
		ez_action_user_script(2);
		break;
	case 11: // Front LED toggle
		ez_action_led_toggle();
		break;
	}
}
Beispiel #2
0
void
ez_event_long(int btn_id)
{
    int ez_action, ez_param = 2;

#if defined (BOARD_GPIO_BTN_WLTOG)
    if (btn_id == 1) {
        ez_action = nvram_get_int("wlt_action_long");
        ez_param = 4;
    } else
#endif
        ez_action = nvram_get_int("ez_action_long");

#if defined (BOARD_GPIO_LED_POWER)
    int led_state = LED_ON;

    switch (ez_action)
    {
    case 7: // Router reboot
    case 8: // Router shutdown
        led_state = LED_OFF;
        break;
    case 11: // Front LED toggle
        led_state = -1;
        break;
    }

    if (led_state >= 0)
        LED_CONTROL(BOARD_GPIO_LED_POWER, led_state);
#endif

    switch (ez_action)
    {
    case 1: // WiFi 2.4GHz force Enable/Disable trigger
        ez_action_change_wifi2();
        break;
    case 2: // WiFi 5GHz force Enable/Disable trigger
        ez_action_change_wifi5();
        break;
    case 3: // WiFi 2.4 & 5GHz force Enable/Disable trigger
        ez_action_change_wifi2();
        ez_action_change_wifi5();
        break;
    case 4: // Safe removal all USB
        ez_action_usb_saferemoval();
        break;
    case 5: // WAN down
        ez_action_wan_down();
        break;
    case 6: // WAN reconnect
        ez_action_wan_reconnect();
        break;
    case 7: // Router reboot
        sys_exit();
        break;
    case 8: // Router shutdown
        ez_action_shutdown();
        break;
    case 9: // WAN up/down toggle
        ez_action_wan_toggle();
        break;
    case 10: // Run user script
        ez_action_user_script(ez_param);
        break;
    case 11: // Front LED toggle
        ez_action_led_toggle();
        break;
    case 12: // WiFi AP Guest 2.4GHz Enable/Disable trigger
        ez_action_change_guest_wifi2();
        break;
    case 13: // WiFi AP Guest 5GHz Enable/Disable trigger
        ez_action_change_guest_wifi5();
        break;
    case 14: // WiFi AP Guest 2.4 & 5GHz Enable/Disable trigger
        ez_action_change_guest_wifi2();
        ez_action_change_guest_wifi5();
        break;
    case 15: // Reset settings
        erase_nvram();
        erase_storage();
        sys_exit();
        break;
    }
}