#include "connect.h" #include #include #include #include #if defined(CONFIG_AVM_EVENT) || defined(CONFIG_AVM_EVENT_MODULE) #define AVM_LED_INTERNAL #include #undef AVM_LED_INTERNAL #endif /* Connect Methode 1 */ struct connect_state state_machine_methode1[] = { [connect_state_wait] = default_connect_state_wait, [connect_state_init] = { .description = "methode1_connect_state_init", .timeout_auto_trigger_ms = 0, .auto_trigger_event = connect_event_methode1_start, .transitions = { {.event = connect_event_methode1_start, .next_state = connect_state_pre_nexus} }, }, [connect_state_pre_nexus] = { .description = "methode1_connect_state_pre_nexus", .pre_button_events = { avm_event_push_button_nexus_pairing, }, .timeout_auto_trigger_ms = PRE_NEXUS_TIMEOUT, .auto_trigger_event = connect_event_nexus_pairing_timeout, .transitions = { {.event = connect_event_nexus_pairing_no_trustee_pending, .next_state = connect_state_pairing_dect_plc_wpsauth_nexus}, {.event = connect_event_nexus_pairing_timeout, .next_state = connect_state_pairing_dect_plc_wpsauth_nexus}, {.event = connect_event_nexus_pairing_error, .next_state = connect_state_pairing_dect_plc_wpsauth_nexus}, {.event = connect_event_nexus_pairing_success, .next_state = connect_state_post_nexus_success} }, }, [connect_state_nexus_success] = { .description = "methode1_connect_state_nexus_success", .pre_led_event = event_connect_pairing_success, .pre_button_events = { avm_event_push_button_connect_success, avm_event_push_button_dect_pairing_off, avm_event_push_button_plc_pairing_off, avm_event_push_button_wlan_wps_off, avm_event_push_button_lan_pairing_off, avm_event_push_button_lrwpan_pairing_off, }, }, [connect_state_pairing_dect_plc_wpsauth_nexus] = { .description = "methode1_connect_state_pairing_dect_plc_wpsauth_lan_nexus", .timeout_auto_trigger_ms = MAIN_PAIRING_TIMEOUT, .auto_trigger_event = connect_event_timeout, .pre_button_events = { avm_event_push_button_nexus_pairing, avm_event_push_button_dect_pairing, avm_event_push_button_plc_pairing, avm_event_push_button_wlan_wps, avm_event_push_button_lan_pairing, avm_event_push_button_lrwpan_pairing, }, .transitions = { {.event = connect_event_timeout, .next_state = connect_state_timeout}, {.event = connect_event_nexus_pairing_success, .next_state = connect_state_nexus_success}, {.event = connect_event_dect_stick_and_surf_success, .next_state = connect_state_dect_lrwpan_success}, {.event = connect_event_lrwpan_pairing_success, .next_state = connect_state_dect_lrwpan_success}, {.event = connect_event_plc_pairing_success, .next_state = connect_state_post_nexus}, {.event = connect_event_wps_success, .next_state = connect_state_post_nexus}, {.event = connect_event_lan_pairing_success, .next_state = connect_state_post_nexus}, {.event = connect_event_nexus_pairing_error, .next_state = connect_state_error}, {.event = connect_event_dect_stick_and_surf_error, .next_state = connect_state_error}, {.event = connect_event_plc_pairing_error, .next_state = connect_state_error}, {.event = connect_event_wps_error, .next_state = connect_state_error}, {.event = connect_event_lan_pairing_error, .next_state = connect_state_error}, {.event = connect_event_lrwpan_pairing_error, .next_state = connect_state_error}, }, }, [connect_state_timeout] = { .description = "methode1_connect_state_timeout", .pre_led_event = event_connect_pairing_timeout, .pre_button_events = { avm_event_push_button_nexus_pairing_off, avm_event_push_button_dect_pairing_off, avm_event_push_button_plc_pairing_off, avm_event_push_button_wlan_wps_off, avm_event_push_button_lan_pairing_off, avm_event_push_button_lrwpan_pairing_off, avm_event_push_button_connect_timeout, }, }, [connect_state_dect_lrwpan_success] = { .description = "methode1_connect_state_dect_lrwpan_success", .pre_led_event = event_connect_pairing_success, .pre_button_events = { avm_event_push_button_nexus_pairing_off, avm_event_push_button_plc_pairing_off, avm_event_push_button_wlan_wps_off, avm_event_push_button_lan_pairing_off, avm_event_push_button_lrwpan_pairing_off, avm_event_push_button_dect_pairing_off, avm_event_push_button_connect_success, }, }, [connect_state_post_nexus] = { .description = "methode1_connect_state_post_nexus", .timeout_auto_trigger_ms = POST_NEXUS_TIMEOUT, .auto_trigger_event = connect_event_nexus_pairing_timeout, .pre_button_events = { avm_event_push_button_nexus_pairing, avm_event_push_button_dect_pairing_off, avm_event_push_button_plc_pairing_off, avm_event_push_button_wlan_wps_off, avm_event_push_button_lan_pairing_off, avm_event_push_button_lrwpan_pairing_off, }, .transitions = { {.event = connect_event_nexus_pairing_success, .next_state = connect_state_post_nexus_success}, {.event = connect_event_nexus_pairing_timeout, .next_state = connect_state_post_nexus_timeout}, {.event = connect_event_nexus_pairing_error, .next_state = connect_state_post_nexus_error} }, }, [connect_state_post_nexus_success] = { .description = "methode1_connect_state_post_nexus_success", .pre_led_event = event_connect_pairing_success, .pre_button_events = { avm_event_push_button_connect_success, }, }, [connect_state_post_nexus_timeout] = { .description = "methode1_connect_state_post_nexus_timeout", .pre_led_event = event_connect_pairing_done, .pre_button_events = { avm_event_push_button_nexus_pairing_off, }, }, [connect_state_error]= { .description = "methode1_connect_state_error", .pre_led_event = event_connect_pairing_error, .pre_button_events = { avm_event_push_button_nexus_pairing_off, avm_event_push_button_dect_pairing_off, avm_event_push_button_plc_pairing_off, avm_event_push_button_wlan_wps_off, avm_event_push_button_lan_pairing_off, avm_event_push_button_lrwpan_pairing_off, avm_event_push_button_connect_error, }, }, [connect_state_post_nexus_error]= { .description = "methode1_connect_state_post_nexus_error", .pre_led_event = event_connect_pairing_done, .pre_button_events = { avm_event_push_button_nexus_pairing_off, avm_event_push_button_connect_error, }, }, };