Skip to content

Commit 40c8ba6

Browse files
committed
lr1110 tests: configure channels for TTN
1 parent ad9ef12 commit 40c8ba6

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

examples/tests/lr1110/lorawan/main_lorawan.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
// #include "apps_utilities.h"
5151
// #include "smtc_modem_utilities.h"
5252

53-
#include <lr1110/lr1110.h>
53+
5454
#include <stdio.h>
5555
#include <stdint.h>
5656
#include <stdbool.h>
@@ -59,6 +59,9 @@
5959
#include <libtock-sync/sensors/humidity.h>
6060
#include <libtock-sync/services/alarm.h>
6161

62+
#include <lr1110/lr1110.h>
63+
#include <lr1110/us_915_ttn.h>
64+
6265
/*
6366
* -----------------------------------------------------------------------------
6467
* --- PRIVATE MACROS-----------------------------------------------------------
@@ -356,6 +359,9 @@ static void on_modem_reset( uint16_t reset_count )
356359

357360
lorawan_apps_modem_common_configure_lorawan_params( stack_id );
358361

362+
// We use TTN so only enable bank 2 channels.
363+
region_us_915_the_things_network_init();
364+
359365
ASSERT_SMTC_MODEM_RC( smtc_modem_join_network( stack_id ) );
360366
}
361367

examples/tests/lr1110/wifi_scan/main_geolocation_wifi.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,14 @@
4343
* @{
4444
*/
4545

46-
#include <lr1110/lr1110.h>
47-
#include <libtock-sync/services/alarm.h>
4846
#include <stdio.h>
4947
#include <stdint.h>
5048

49+
#include <libtock-sync/services/alarm.h>
50+
51+
#include <lr1110/lr1110.h>
52+
#include <lr1110/us_915_ttn.h>
53+
5154
/*
5255
* -----------------------------------------------------------------------------
5356
* --- DEPENDENCIES ------------------------------------------------------------
@@ -346,10 +349,13 @@ int main( void )
346349
static void on_modem_reset( uint16_t reset_count )
347350
{
348351
// printf("on_modem_reset\n");
349-
352+
350353
/* Basic LoRaWAN configuration */
351354
wifi_apps_modem_common_configure_lorawan_params( stack_id );
352355

356+
// We use TTN so only enable bank 2 channels.
357+
region_us_915_the_things_network_init();
358+
353359
/* Start the Join process */
354360
ASSERT_SMTC_MODEM_RC( smtc_modem_join_network( stack_id ) );
355361

0 commit comments

Comments
 (0)