[Heltec_mesh_solar]
extends = nrf52_base
board = heltec_mesh_solar
platform_packages = framework-arduinoadafruitnrf52
board_build.ldscript = boards/nrf52840_s140_v6.ld
build_flags =  ${nrf52_base.build_flags}
  -I src/helpers/nrf52
  -I lib/nrf52/s140_nrf52_6.1.1_API/include
  -I lib/nrf52/s140_nrf52_6.1.1_API/include/nrf52
  -I variants/heltec_mesh_solar
  -D HELTEC_MESH_SOLAR
  -D RADIO_CLASS=CustomSX1262
  -D WRAPPER_CLASS=CustomSX1262Wrapper
  -D LORA_TX_POWER=22
  -D SX126X_CURRENT_LIMIT=140
  -D SX126X_RX_BOOSTED_GAIN=1
build_src_filter = ${nrf52_base.build_src_filter}
  +<helpers/*.cpp>
  +<../variants/heltec_mesh_solar>
lib_deps =
  ${nrf52_base.lib_deps}
  rweather/Crypto @ ^0.4.0
  stevemarple/MicroNMEA @ ^2.0.6
  adafruit/Adafruit NeoPixel@^1.10.0
  https://github.com/NMIoT/meshsolar/archive/dfc5330dad443982e6cdd37a61d33fc7252f468b.zip
debug_tool = jlink
upload_protocol = nrfutil

[env:Heltec_mesh_solar_repeater]
extends = Heltec_mesh_solar
build_src_filter = ${Heltec_mesh_solar.build_src_filter}
  +<../examples/simple_repeater>

build_flags =
  ${Heltec_mesh_solar.build_flags}
  -D ADVERT_NAME='"Heltec_Mesh_Solar 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

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

[env:Heltec_mesh_solar_companion_radio_ble]
extends = Heltec_mesh_solar
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
board_upload.maximum_size = 712704
build_flags =
  ${Heltec_mesh_solar.build_flags}
  -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 MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
build_src_filter = ${Heltec_mesh_solar.build_src_filter}
  +<helpers/nrf52/SerialBLEInterface.cpp>
  +<../examples/companion_radio/*.cpp>
lib_deps =
  ${Heltec_mesh_solar.lib_deps}
  densaugeo/base64 @ ~1.4.0

[env:Heltec_mesh_solar_companion_radio_usb]
extends = Heltec_mesh_solar
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
board_upload.maximum_size = 712704
build_flags =
  ${Heltec_mesh_solar.build_flags}
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
;  -D BLE_PIN_CODE=123456
;  -D BLE_DEBUG_LOGGING=1
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
build_src_filter = ${Heltec_mesh_solar.build_src_filter}
  +<helpers/nrf52/*.cpp>
  +<../examples/companion_radio/*.cpp>
lib_deps =
  ${Heltec_mesh_solar.lib_deps}
  densaugeo/base64 @ ~1.4.0

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