/**
 * Copyright (C) 2026 Ralf Burger
 * ralf@RalfBurger.com
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org/licenses/>.
 */
#pragma once
// --  Heimnetz --------------------------------------------------
#define WIFI_SSID       "meinWiFiName"
#define WIFI_PASS       "meinPasswort"
#define WIFI_TIMEOUT    15000            // ms bis Verbindungsabbruch

// -- TCP-Port --------------------------------------------------
#define TCP_PORT        1234

// -- Bridge Access Point ---------------------------------------
#define AP_SSID         "obdBT-Bridge"
#define AP_PASS         "obdBT123"
#define AP_CHANNEL      6
#define AP_IP           IPAddress(192,168,4,1)
#define AP_GATEWAY      IPAddress(192,168,4,1)
#define AP_SUBNET       IPAddress(255,255,255,0)

// -- Simulator Access Point ------------------------------------
#define SIM_AP_SSID     "OBD2-Simulator"
#define SIM_AP_PASS     "obd2sim1"       // min. 8 Zeichen
#define SIM_AP_IP       IPAddress(192,168,4,2)
#define SIM_AP_GATEWAY  IPAddress(192,168,4,2)
#define SIM_AP_SUBNET   IPAddress(255,255,255,0)

// -- Geraetespezifisch -----------------------------------------
#if defined(DEVICE_BRIDGE)
  #define WIFI_FALLBACK_IS_AP   1

#elif defined(DEVICE_RECEIVER)
  #define WIFI_FALLBACK_IS_AP   0
  // Receiver verbindet sich als STA zum Bridge-AP
  #define WIFI_FALLBACK_SSID    AP_SSID
  #define WIFI_FALLBACK_PASS    AP_PASS

#elif defined(DEVICE_SIMULATOR)
  #define WIFI_FALLBACK_IS_AP   1
  // Simulator oeffnet eigenen AP wenn Heimnetz nicht erreichbar
  #undef  AP_SSID
  #undef  AP_PASS
  #undef  AP_IP
  #undef  AP_GATEWAY
  #undef  AP_SUBNET
  #define AP_SSID     SIM_AP_SSID
  #define AP_PASS     SIM_AP_PASS
  #define AP_IP       SIM_AP_IP
  #define AP_GATEWAY  SIM_AP_GATEWAY
  #define AP_SUBNET   SIM_AP_SUBNET

#else
  #error "wifi_config.h: Bitte DEVICE_BRIDGE, DEVICE_RECEIVER oder DEVICE_SIMULATOR vor dem Include definieren!"
#endif
