Skip to content

Commit

Permalink
Getting rid of loRaSyncWord and gFSKSyncWord from Region implementati…
Browse files Browse the repository at this point in the history
…on (Azure#604)

* Getting rid of loRaSyncWord and gFSKSyncWord from Region implementation

* Adapting CN470 to get rid of sync words

* Formatting
  • Loading branch information
danigian authored Oct 21, 2021
1 parent a67f973 commit 0bac12b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ public abstract class Region

public LoRaRegionType LoRaRegion { get; set; }

public byte LoRaSyncWord { get; private set; }

public IReadOnlyList<byte> GFSKSyncWord { get; private set; }

/// <summary>
/// Gets or sets datarate to configuration and max payload size (M)
/// max application payload size N should be N= M-8 bytes.
Expand Down Expand Up @@ -98,14 +94,11 @@ public abstract class Region
/// </summary>
public int MaxADRDataRate { get; set; }

protected Region(LoRaRegionType regionEnum, byte loRaSyncWord, byte[] gFSKSyncWord, (double frequency, ushort datr) rx2DefaultReceiveWindows)
protected Region(LoRaRegionType regionEnum, (double frequency, ushort datr) rx2DefaultReceiveWindows)
{
LoRaRegion = regionEnum;
RetransmitTimeout = (min: 1, max: 3);

LoRaSyncWord = loRaSyncWord;
GFSKSyncWord = gFSKSyncWord;

RX2DefaultReceiveWindows = rx2DefaultReceiveWindows;
ReceiveDelay1 = 1;
ReceiveDelay2 = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ public class RegionCN470 : Region
private readonly List<List<double>> DownstreamFrequenciesByPlanType;

public RegionCN470()
: base(
LoRaRegionType.CN470,
0x34,
null,
: base(LoRaRegionType.CN470,
(frequency: 485.3, datr: 1)) // TODO: support multiple RX2 receive windows, see #561
{
// Values assuming FOpts param is not used
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@
namespace LoRaTools.Regions
{
using LoRaTools.LoRaPhysical;
using LoRaTools.Utils;
using System;

public class RegionEU868 : Region
{
public RegionEU868()
: base(
LoRaRegionType.EU868,
0x34,
ConversionHelper.StringToByteArray("C194C1"),
(frequency: 869.525, datr: 0))
: base(LoRaRegionType.EU868,
(frequency: 869.525, datr: 0))
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@ public class RegionUS915 : Region
private static readonly double[] DownstreamChannelFrequencies = new double[] { 923.3, 923.9, 924.5, 925.1, 925.7, 926.3, 926.9, 927.5 };

public RegionUS915()
: base(
LoRaRegionType.US915,
0x34,
null, // no GFSK in US Band
(frequency: 923.3, datr: 8))
: base(LoRaRegionType.US915,
(frequency: 923.3, datr: 8))
{
}

Expand Down

0 comments on commit 0bac12b

Please sign in to comment.