[rak_wismesh_tag]
extends = nrf52_base
board = rak4631
board_check = true
build_flags = ${nrf52_base.build_flags}
  ${sensor_base.build_flags}
  -I variants/rak_wismesh_tag
  -I src/helpers/ui
  -D RAK_WISMESH_TAG
  -D RAK_BOARD
  -D P_LORA_TX_LED=LED_GREEN
  -D P_LORA_DIO_1=SX126X_DIO1
  -D P_LORA_NSS=PIN_SPI_NSS
  -D P_LORA_RESET=SX126X_RESET
  -D P_LORA_BUSY=SX126X_BUSY
  -D P_LORA_SCLK=PIN_SPI_SCK
  -D P_LORA_MISO=PIN_SPI_MISO
  -D P_LORA_MOSI=PIN_SPI_MOSI
  -D RADIO_CLASS=CustomSX1262
  -D WRAPPER_CLASS=CustomSX1262Wrapper
  -D DISPLAY_CLASS=NullDisplayDriver
  -D LORA_TX_POWER=22
  -D SX126X_CURRENT_LIMIT=140
  -D SX126X_RX_BOOSTED_GAIN=1
  -D PIN_BUZZER=21
  -D PIN_BOARD_SDA=PIN_WIRE_SDA
  -D PIN_BOARD_SCL=PIN_WIRE_SCL
build_src_filter = ${nrf52_base.build_src_filter}
  +<../variants/rak_wismesh_tag>
  +<helpers/ui/MomentaryButton.cpp>
  +<helpers/ui/NullDisplayDriver.cpp>
  +<helpers/sensors>
lib_deps =
  ${nrf52_base.lib_deps}
  ${sensor_base.lib_deps}

[env:RAK_WisMesh_Tag_repeater]
extends = rak_wismesh_tag
build_flags =
  ${rak_wismesh_tag.build_flags}
  -D ADVERT_NAME='"RAK WM 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
build_src_filter = ${rak_wismesh_tag.build_src_filter}
  +<../examples/simple_repeater>

[env:RAK_WisMesh_Tag_room_server]
extends = rak_wismesh_tag
build_flags =
  ${rak_wismesh_tag.build_flags}
  -D ADVERT_NAME='"RAK WM 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
build_src_filter = ${rak_wismesh_tag.build_src_filter}
  +<../examples/simple_room_server>

[env:RAK_WisMesh_Tag_companion_radio_usb]
extends = rak_wismesh_tag
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
board_upload.maximum_size = 712704
build_flags =
  ${rak_wismesh_tag.build_flags}
  -I examples/companion_radio/ui-orig
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
; NOTE: DO NOT ENABLE -->  -D MESH_PACKET_LOGGING=1
; NOTE: DO NOT ENABLE -->  -D MESH_DEBUG=1
build_src_filter = ${rak_wismesh_tag.build_src_filter}
  +<helpers/ui/buzzer.cpp>
  +<../examples/companion_radio/*.cpp>
  +<../examples/companion_radio/ui-orig/*.cpp>
lib_deps =
  ${rak_wismesh_tag.lib_deps}
  densaugeo/base64 @ ~1.4.0
  end2endzone/NonBlockingRTTTL@^1.3.0

[env:RAK_WisMesh_Tag_companion_radio_ble]
extends = rak_wismesh_tag
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
board_upload.maximum_size = 712704
build_flags =
  ${rak_wismesh_tag.build_flags}
  -I examples/companion_radio/ui-orig
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
  -D BLE_PIN_CODE=123456
  -D BLE_DEBUG_LOGGING=1
  -D OFFLINE_QUEUE_SIZE=256
  -D PIN_GPS_EN=34
;  -D MESH_PACKET_LOGGING=1
  -D MESH_DEBUG=1
build_src_filter = ${rak_wismesh_tag.build_src_filter}
  +<helpers/ui/buzzer.cpp>
  +<helpers/nrf52/SerialBLEInterface.cpp>
  +<../examples/companion_radio/*.cpp>
  +<../examples/companion_radio/ui-orig/*.cpp>
lib_deps =
  ${rak4631.lib_deps}
  densaugeo/base64 @ ~1.4.0
  end2endzone/NonBlockingRTTTL@^1.3.0

[env:RAK_WisMesh_Tag_sensor]
extends = rak4631
build_flags =
  ${rak4631.build_flags}
  -D ADVERT_NAME='"RAK WM Sensor"'
  -D ADVERT_LAT=0.0
  -D ADVERT_LON=0.0
  -D ADMIN_PASSWORD='"password"'
;  -D MESH_PACKET_LOGGING=1
  -D MESH_DEBUG=1
build_src_filter = ${rak4631.build_src_filter}
  +<../examples/simple_sensor>

[env:RAK_WisMesh_Tag_kiss_modem]
extends = rak_wismesh_tag
build_src_filter = ${rak_wismesh_tag.build_src_filter}
  +<../examples/kiss_modem/>
