[Xiao_S3_WIO]
extends = esp32_base
board = seeed_xiao_esp32s3
board_check = true
board_build.mcu = esp32s3
build_flags = ${esp32_base.build_flags}
  -I variants/xiao_s3_wio
  -D SEEED_XIAO_S3
  -D P_LORA_DIO_1=39
  -D P_LORA_NSS=41
  -D P_LORA_RESET=42   ; RADIOLIB_NC
  -D P_LORA_BUSY=40   ;  DIO2 = 38
  -D P_LORA_SCLK=7
  -D P_LORA_MISO=8
  -D P_LORA_MOSI=9
  -D PIN_USER_BTN=21
  -D PIN_STATUS_LED=48
  -D SX126X_RXEN=38
  -D SX126X_TXEN=RADIOLIB_NC
  -D SX126X_DIO2_AS_RF_SWITCH=true
  -D SX126X_DIO3_TCXO_VOLTAGE=1.8
  -D SX126X_CURRENT_LIMIT=140
  -D USE_SX1262
  -D RADIO_CLASS=CustomSX1262
  -D WRAPPER_CLASS=CustomSX1262Wrapper
  -D LORA_TX_POWER=22
  -D SX126X_RX_BOOSTED_GAIN=1
build_src_filter = ${esp32_base.build_src_filter}
  +<../variants/xiao_s3_wio>
  +<helpers/sensors>

[env:Xiao_S3_WIO_repeater]
extends = Xiao_S3_WIO
build_src_filter = ${Xiao_S3_WIO.build_src_filter}
  +<../examples/simple_repeater/*.cpp>
build_flags =
  ${Xiao_S3_WIO.build_flags}
  -D ADVERT_NAME='"XiaoS3 Repeater"'
  -D ADVERT_LAT=0.0
  -D ADVERT_LON=0.0
  -D ADMIN_PASSWORD='"password"'
  -D MAX_NEIGHBOURS=50
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
lib_deps =
  ${Xiao_S3_WIO.lib_deps}
  ${esp32_ota.lib_deps}

; [env:Xiao_S3_WIO_repeater_bridge_rs232]
; extends = Xiao_S3_WIO
; build_src_filter = ${Xiao_S3_WIO.build_src_filter}
;   +<helpers/bridges/RS232Bridge.cpp>
;   +<../examples/simple_repeater/*.cpp>
; build_flags =
;   ${Xiao_S3_WIO.build_flags}
;   -D ADVERT_NAME='"RS232 Bridge"'
;   -D ADVERT_LAT=0.0
;   -D ADVERT_LON=0.0
;   -D ADMIN_PASSWORD='"password"'
;   -D MAX_NEIGHBOURS=50
;   -D WITH_RS232_BRIDGE=Serial2
;   -D WITH_RS232_BRIDGE_RX=5
;   -D WITH_RS232_BRIDGE_TX=6
;  -D BRIDGE_DEBUG=1
; ;  -D MESH_PACKET_LOGGING=1
; ;  -D MESH_DEBUG=1
; lib_deps =
;   ${Xiao_S3_WIO.lib_deps}
;   ${esp32_ota.lib_deps}

[env:Xiao_S3_WIO_repeater_bridge_espnow]
extends = Xiao_S3_WIO
build_src_filter = ${Xiao_S3_WIO.build_src_filter}
  +<helpers/bridges/ESPNowBridge.cpp>
  +<../examples/simple_repeater/*.cpp>
build_flags =
  ${Xiao_S3_WIO.build_flags}
  -D ADVERT_NAME='"ESPNow Bridge"'
  -D ADVERT_LAT=0.0
  -D ADVERT_LON=0.0
  -D ADMIN_PASSWORD='"password"'
  -D MAX_NEIGHBOURS=50
  -D WITH_ESPNOW_BRIDGE=1
;  -D BRIDGE_DEBUG=1
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
lib_deps =
  ${Xiao_S3_WIO.lib_deps}
  ${esp32_ota.lib_deps}

[env:Xiao_S3_WIO_repeater_observer_mqtt]
extends = Xiao_S3_WIO
build_flags =
  ${Xiao_S3_WIO.build_flags}
  -D ADVERT_NAME='"MQTT Observer"'
  -D ADVERT_LAT=0.0
  -D ADVERT_LON=0.0
  -D ADMIN_PASSWORD='"password"'
  -D MAX_NEIGHBOURS=50
  -D WITH_MQTT_BRIDGE=1
  -D MAX_MQTT_BROKERS=3
  -D MQTT_MAX_PACKET_SIZE=1024
  -D MQTT_DEBUG=1
  -D MESH_PACKET_LOGGING=1
  -D MESH_DEBUG=1
  -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y
  -D ESP32_CPU_FREQ=160
#  -D WIFI_SSID='"ssid"'
#  -D WIFI_PWD='"password"'
#  -D MQTT_SERVER='"your-mqtt-broker.com"'
#  -D MQTT_PORT=1883
#  -D MQTT_USERNAME='"your-username"'
#  -D MQTT_PASSWORD='"your-password"'

build_src_filter = ${Xiao_S3_WIO.build_src_filter}
  +<helpers/bridges/MQTTBridge.cpp>
  +<helpers/MQTTMessageBuilder.cpp>
  +<helpers/JWTHelper.cpp>
  +<../examples/simple_repeater>
lib_deps =
  ${Xiao_S3_WIO.lib_deps}
  ${esp32_ota.lib_deps}
  elims/PsychicMqttClient@^0.2.4
  bblanchon/ArduinoJson
  arduino-libraries/NTPClient
  JChristensen/Timezone
  paulstoffregen/Time@1.6.1

[env:Xiao_S3_WIO_room_server_observer_mqtt]
extends = Xiao_S3_WIO
build_flags =
  ${Xiao_S3_WIO.build_flags}
  -D ADVERT_NAME='"XiaoS3 Room Observer"'
  -D ADVERT_LAT=0.0
  -D ADVERT_LON=0.0
  -D ADMIN_PASSWORD='"password"'
  -D ROOM_PASSWORD='"hello"'
  -D WITH_MQTT_BRIDGE=1
  -D MAX_MQTT_BROKERS=3
  -D MQTT_MAX_PACKET_SIZE=1024
  -D MQTT_DEBUG=1
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
  -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y
  -D ESP32_CPU_FREQ=160
build_src_filter = ${Xiao_S3_WIO.build_src_filter}
  +<helpers/bridges/MQTTBridge.cpp>
  +<helpers/MQTTMessageBuilder.cpp>
  +<helpers/JWTHelper.cpp>
  +<../examples/simple_room_server>
lib_deps =
  ${Xiao_S3_WIO.lib_deps}
  ${esp32_ota.lib_deps}
  elims/PsychicMqttClient@^0.2.4
  bblanchon/ArduinoJson
  arduino-libraries/NTPClient
  JChristensen/Timezone
  paulstoffregen/Time@1.6.1

[env:Xiao_S3_WIO_room_server]
extends = Xiao_S3_WIO
build_src_filter = ${Xiao_S3_WIO.build_src_filter}
  +<../examples/simple_room_server>
build_flags =
  ${Xiao_S3_WIO.build_flags}
  -D ADVERT_NAME='"XiaoS3 Room"'
  -D ADVERT_LAT=0.0
  -D ADVERT_LON=0.0
  -D ADMIN_PASSWORD='"password"'
  -D ROOM_PASSWORD='"hello"'
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
lib_deps =
  ${Xiao_S3_WIO.lib_deps}
  ${esp32_ota.lib_deps}

[env:Xiao_S3_WIO_terminal_chat]
extends = Xiao_S3_WIO
build_flags =
  ${Xiao_S3_WIO.build_flags}
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
build_src_filter = ${Xiao_S3_WIO.build_src_filter}
  +<../examples/simple_secure_chat/main.cpp>
lib_deps =
  ${Xiao_S3_WIO.lib_deps}
  densaugeo/base64 @ ~1.4.0

[env:Xiao_S3_WIO_companion_radio_usb]
extends = Xiao_S3_WIO
build_flags =
  ${Xiao_S3_WIO.build_flags}
  -I examples/companion_radio/ui-new
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
  -D DISPLAY_CLASS=SSD1306Display
  -D OFFLINE_QUEUE_SIZE=256
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
build_src_filter = ${Xiao_S3_WIO.build_src_filter}
  +<helpers/ui/SSD1306Display.cpp>
  +<helpers/esp32/*.cpp>
  +<helpers/ui/MomentaryButton.cpp>
  +<../examples/companion_radio/*.cpp>
  +<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
  ${Xiao_S3_WIO.lib_deps}
  densaugeo/base64 @ ~1.4.0
  adafruit/Adafruit SSD1306 @ ^2.5.13

[env:Xiao_S3_WIO_companion_radio_ble]
extends = Xiao_S3_WIO
build_flags =
  ${Xiao_S3_WIO.build_flags}
  -I examples/companion_radio/ui-new
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
  -D BLE_PIN_CODE=123456
  -D DISPLAY_CLASS=SSD1306Display
  -D OFFLINE_QUEUE_SIZE=256
;  -D BLE_DEBUG_LOGGING=1
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
build_src_filter = ${Xiao_S3_WIO.build_src_filter}
  +<helpers/ui/SSD1306Display.cpp>
  +<helpers/esp32/*.cpp>
  +<helpers/ui/MomentaryButton.cpp>
  +<../examples/companion_radio/*.cpp>
  +<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
  ${Xiao_S3_WIO.lib_deps}
  densaugeo/base64 @ ~1.4.0
  adafruit/Adafruit SSD1306 @ ^2.5.13

[env:Xiao_S3_WIO_companion_radio_serial]
extends = Xiao_S3_WIO
build_flags =
  ${Xiao_S3_WIO.build_flags}
  -I examples/companion_radio/ui-new
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
  -D DISPLAY_CLASS=SSD1306Display
  -D SERIAL_TX=D6
  -D SERIAL_RX=D7
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
build_src_filter = ${Xiao_S3_WIO.build_src_filter}
  +<helpers/ui/SSD1306Display.cpp>
  +<helpers/esp32/*.cpp>
  +<helpers/ui/MomentaryButton.cpp>
  +<../examples/companion_radio/*.cpp>
  +<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
  ${Xiao_S3_WIO.lib_deps}
  densaugeo/base64 @ ~1.4.0
  adafruit/Adafruit SSD1306 @ ^2.5.13

[env:Xiao_S3_WIO_companion_radio_wifi]
extends = Xiao_S3_WIO
build_src_filter = ${Xiao_S3_WIO.build_src_filter}
  +<helpers/ui/NullDisplayDriver.cpp>
  +<helpers/esp32/*.cpp>
  +<helpers/ui/MomentaryButton.cpp>
  +<../examples/companion_radio/*.cpp>
build_flags =
  ${Xiao_S3_WIO.build_flags}
  -I examples/companion_radio/ui-new
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
  -D OFFLINE_QUEUE_SIZE=256
  -D WIFI_DEBUG_LOGGING=1
  -D WIFI_SSID='"myssid"'
  -D WIFI_PWD='"password"'
  ; -D BLE_DEBUG_LOGGING=1
  ; -D MESH_PACKET_LOGGING=1
  ; -D MESH_DEBUG=1
lib_deps =
  ${Xiao_S3_WIO.lib_deps}
  densaugeo/base64 @ ~1.4.0

[env:Xiao_S3_WIO_sensor]
extends = Xiao_S3_WIO
build_src_filter = ${Xiao_S3_WIO.build_src_filter}
  +<../examples/simple_sensor>
build_flags =
  ${Xiao_S3_WIO.build_flags}
  -D ADVERT_NAME='"XiaoS3 sensor"'
  -D ADVERT_LAT=0.0
  -D ADVERT_LON=0.0
  -D ADMIN_PASSWORD='"password"'
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
lib_deps =
  ${Xiao_S3_WIO.lib_deps}
  ${esp32_ota.lib_deps}
