Skip to content

Commit

Permalink
Merge pull request #36 from imliubo/master
Browse files Browse the repository at this point in the history
TTN frequency plan support China 470(uplink).
  • Loading branch information
brentru committed Jan 22, 2021
2 parents 69b1af2 + 4da105a commit 8e04634
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions adafruit_tinylora/adafruit_tinylora.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ def __init__(self, spi, cs, irq, rst, ttn_config, channel=None):
elif ttn_config.country == "EU":
from adafruit_tinylora.ttn_eu import TTN_FREQS

self._frequencies = TTN_FREQS
elif ttn_config.country == "CN":
from adafruit_tinylora.ttn_cn import TTN_FREQS

self._frequencies = TTN_FREQS
else:
raise TypeError("Country Code Incorrect/Unsupported")
Expand Down
21 changes: 21 additions & 0 deletions adafruit_tinylora/ttn_cn.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# SPDX-FileCopyrightText: 2018 Brent Rubell for Adafruit Industries
# SPDX-FileCopyrightText: 2021 IAMLIUBO
#
# SPDX-License-Identifier: MIT

"""
`ttn_cn.py`
======================================================
The Things Network Frequency Plans - CN470
* Author(s): IAMLIUBO
"""
TTN_FREQS = {
0: (0x79, 0x93, 0x33), # 486.3 MHz
1: (0x79, 0xA0, 0x00), # 486.5 MHz
2: (0x79, 0xAC, 0xCC), # 486.7 MHz
3: (0x79, 0xB9, 0x99), # 486.9 MHz
4: (0x79, 0xC6, 0x66), # 487.1 MHz
5: (0x79, 0xD3, 0x33), # 487.3 MHz
6: (0x79, 0xE0, 0x00), # 487.5 MHz
7: (0x79, 0xEC, 0xCC),
} # 487.7 MHz

0 comments on commit 8e04634

Please sign in to comment.