From bec61cea27236dd990927e16e9250849f52c46a5 Mon Sep 17 00:00:00 2001 From: Hasnain Virk Date: Thu, 3 May 2018 18:08:22 +0300 Subject: [PATCH] Initializing band for default channels We went through an exercise of adding band information to any new channel being added. Default channels were looked over. This commits duly adds missing band information to default channels. --- features/lorawan/lorastack/phy/LoRaPHYAS923.cpp | 2 ++ features/lorawan/lorastack/phy/LoRaPHYCN779.cpp | 3 +++ features/lorawan/lorastack/phy/LoRaPHYEU433.cpp | 7 +++++-- features/lorawan/lorastack/phy/LoRaPHYEU868.cpp | 3 +++ features/lorawan/lorastack/phy/LoRaPHYIN865.cpp | 3 +++ features/lorawan/lorastack/phy/LoRaPHYKR920.cpp | 3 +++ 6 files changed, 19 insertions(+), 2 deletions(-) diff --git a/features/lorawan/lorastack/phy/LoRaPHYAS923.cpp b/features/lorawan/lorastack/phy/LoRaPHYAS923.cpp index 4ce26dd84c..9ce54904db 100644 --- a/features/lorawan/lorastack/phy/LoRaPHYAS923.cpp +++ b/features/lorawan/lorastack/phy/LoRaPHYAS923.cpp @@ -249,7 +249,9 @@ LoRaPHYAS923::LoRaPHYAS923(LoRaWANTimeHandler &lora_time) // Default Channels are always enabled in the channel list, // rest will be added later channels[0] = AS923_LC1; + channels[0].band = 0; channels[1] = AS923_LC2; + channels[1].band = 0; // Initialize the default channel mask default_channel_mask[0] = LC(1) + LC(2); diff --git a/features/lorawan/lorastack/phy/LoRaPHYCN779.cpp b/features/lorawan/lorastack/phy/LoRaPHYCN779.cpp index a5e2137396..6f1f618bde 100644 --- a/features/lorawan/lorastack/phy/LoRaPHYCN779.cpp +++ b/features/lorawan/lorastack/phy/LoRaPHYCN779.cpp @@ -237,8 +237,11 @@ LoRaPHYCN779::LoRaPHYCN779(LoRaWANTimeHandler &lora_time) // Channels channels[0] = CN779_LC1; + channels[0].band = 0; channels[1] = CN779_LC2; + channels[1].band = 0; channels[2] = CN779_LC3; + channels[2].band = 0; // Initialize the channels default mask default_channel_mask[0] = LC(1) + LC(2) + LC(3); diff --git a/features/lorawan/lorastack/phy/LoRaPHYEU433.cpp b/features/lorawan/lorastack/phy/LoRaPHYEU433.cpp index b0e5f3841e..fdd9361736 100644 --- a/features/lorawan/lorastack/phy/LoRaPHYEU433.cpp +++ b/features/lorawan/lorastack/phy/LoRaPHYEU433.cpp @@ -238,8 +238,11 @@ LoRaPHYEU433::LoRaPHYEU433(LoRaWANTimeHandler &lora_time) // Channels channels[0] = EU433_LC1; - channels[1] = EU433_LC2;; - channels[2] = EU433_LC3;; + channels[0].band = 0; + channels[1] = EU433_LC2; + channels[1].band = 0; + channels[2] = EU433_LC3; + channels[2].band = 0; // Initialize the channels default mask default_channel_mask[0] = LC(1) + LC(2) + LC(3); diff --git a/features/lorawan/lorastack/phy/LoRaPHYEU868.cpp b/features/lorawan/lorastack/phy/LoRaPHYEU868.cpp index 4c0b1a369b..381cd003b7 100644 --- a/features/lorawan/lorastack/phy/LoRaPHYEU868.cpp +++ b/features/lorawan/lorastack/phy/LoRaPHYEU868.cpp @@ -268,8 +268,11 @@ LoRaPHYEU868::LoRaPHYEU868(LoRaWANTimeHandler &lora_time) // Default Channels are always enabled, rest will be added later channels[0] = EU868_LC1; + channels[0].band = 1; channels[1] = EU868_LC2; + channels[1].band = 1; channels[2] = EU868_LC3; + channels[2].band = 1; // Initialize the channels default mask default_channel_mask[0] = LC(1) + LC(2) + LC(3); diff --git a/features/lorawan/lorastack/phy/LoRaPHYIN865.cpp b/features/lorawan/lorastack/phy/LoRaPHYIN865.cpp index 5594647ebc..fffe91cc4b 100644 --- a/features/lorawan/lorastack/phy/LoRaPHYIN865.cpp +++ b/features/lorawan/lorastack/phy/LoRaPHYIN865.cpp @@ -239,8 +239,11 @@ LoRaPHYIN865::LoRaPHYIN865(LoRaWANTimeHandler &lora_time) // Default Channels are always enabled, rest will be added later channels[0] = IN865_LC1; + channels[0].band = 0; channels[1] = IN865_LC2; + channels[1].band = 0; channels[2] = IN865_LC3; + channels[2].band = 0; // Initialize the channels default mask default_channel_mask[0] = LC(1) + LC(2) + LC(3); diff --git a/features/lorawan/lorastack/phy/LoRaPHYKR920.cpp b/features/lorawan/lorastack/phy/LoRaPHYKR920.cpp index a2d40f736b..fd238b4ba5 100644 --- a/features/lorawan/lorastack/phy/LoRaPHYKR920.cpp +++ b/features/lorawan/lorastack/phy/LoRaPHYKR920.cpp @@ -248,8 +248,11 @@ LoRaPHYKR920::LoRaPHYKR920(LoRaWANTimeHandler &lora_time) // Channels channels[0] = KR920_LC1; + channels[0].band = 0; channels[1] = KR920_LC2; + channels[1].band = 0; channels[2] = KR920_LC3; + channels[2].band = 0; // Initialize the channels default mask default_channel_mask[0] = LC( 1 ) + LC( 2 ) + LC( 3 );