Skip to content

Commit 807fd79

Browse files
authored
Merge pull request #15320 from dgoo2308/lora_as923_sub_region
LoRaWAN AS923 Add SUB_REGION AS1..AS4
2 parents d4f97aa + 3508ec2 commit 807fd79

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

connectivity/lorawan/lorastack/phy/LoRaPHYAS923.cpp

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,80 @@
3737
*/
3838
#define AS923_NUMB_DEFAULT_CHANNELS 2
3939

40+
/*!
41+
* Set default SUB region if not defined
42+
*/
43+
#ifndef MBED_CONF_LORA_PHY_AS923_SUB_REGION
44+
#define MBED_CONF_LORA_PHY_AS923_SUB_REGION AS1
45+
#warning "MBED_CONF_LORA_PHY_AS923_SUB_REGION is not set in mbed_app.json, default to `AS1`!"
46+
#endif
47+
48+
/*!
49+
* Define the SUB-REGION's
50+
*/
51+
#define LORA_AS923_SUB_REGION_AS1 0x01
52+
#define LORA_AS923_SUB_REGION_AS2 0x02
53+
#define LORA_AS923_SUB_REGION_AS3 0x03
54+
#define LORA_AS923_SUB_REGION_AS4 0x04
55+
56+
/*!
57+
* Parse SUB-REGION config
58+
*/
59+
#define mbed_lora_concat_(x) LORA_AS923_SUB_REGION_##x
60+
#define mbed_lora_concat(x) mbed_lora_concat_(x)
61+
#define LORA_AS923_SUB_REGION mbed_lora_concat(MBED_CONF_LORA_PHY_AS923_SUB_REGION)
62+
63+
64+
/*!
65+
* Define the Frequencies for teh SUB REGION within AS923 for AS1,AS2, AS3,AS4.
66+
*/
67+
#if ( LORA_AS923_SUB_REGION == LORA_AS923_SUB_REGION_AS1 )
68+
// Singapore, Japan, Malaysia, Myanmar ....
69+
// Historical AS923 =>RP002-1.0.0 LoRaWAN - 923..928Mhz
70+
/*!
71+
* Default transmit channel frequency's definition.
72+
*/
73+
#define AS923_LC1_FREQ 923200000
74+
#define AS923_LC2_FREQ 923400000
75+
/*!
76+
* channel frequnetie range.
77+
*/
78+
#define AS923_LOWER_FREQ 923000000
79+
#define AS923_UPPER_FREQ 928000000
80+
/*!
81+
* Second reception window channel frequency definition.
82+
*/
83+
#define AS923_RX_WND_2_FREQ 923200000
84+
#elif ( LORA_AS923_SUB_REGION == LORA_AS923_SUB_REGION_AS2 )
85+
// Brunei, Hong Kong, Indonesia, Laos, Cambodia, Thaland, Taiwan, Vietnam
86+
// OFFSET -1.8 MHz AS923-1 =>RP002-1.0.1 LoRaWAN - 920..923Mhz
87+
#define AS923_LC1_FREQ 921400000
88+
#define AS923_LC2_FREQ 921600000
89+
#define AS923_LOWER_FREQ 920000000
90+
#define AS923_UPPER_FREQ 923000000
91+
#define AS923_RX_WND_2_FREQ 921400000
92+
#elif ( LORA_AS923_SUB_REGION == LORA_AS923_SUB_REGION_AS3 )
93+
// Philipines, Quatar, Switzerland, Hungary, Cuba, Denmark .... 18 countries
94+
// OFFSET -6.6Mhz AS923-1 =>RP002-1.0.1 LoRaWAN - 915..921Mhz
95+
#define AS923_LC1_FREQ 916600000
96+
#define AS923_LC2_FREQ 916800000
97+
#define AS923_LOWER_FREQ 915000000
98+
#define AS923_UPPER_FREQ 921000000
99+
#define AS923_RX_WND_2_FREQ 916600000
100+
#elif ( LORA_AS923_SUB_REGION == LORA_AS923_SUB_REGION_AS4 )
101+
// Israel
102+
// OFFSET -5.9MHz AS923-1 =>RP002-1.0.3 LoRaWAN - 917..920Mhz
103+
#define AS923_LC1_FREQ 917300000
104+
#define AS923_LC2_FREQ 917500000
105+
#define AS923_LOWER_FREQ 917000000
106+
#define AS923_UPPER_FREQ 920000000
107+
#define AS923_RX_WND_2_FREQ 917300000
108+
#else
109+
#error "Invalid SUB region configuration, update mbed_app.json with correct MBED_CONF_LORA_PHY_AS923_SUB_REGION value"
110+
#endif
111+
112+
113+
40114
/*!
41115
* Number of channels to apply for the CF list
42116
*/

connectivity/lorawan/mbed_lib.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
"help": "LoRa PHY region: EU868, AS923, AU915, CN470, CN779, EU433, IN865, KR920, US915",
77
"value": "EU868"
88
},
9+
"phy-as923-sub-region" : {
10+
"help": "AS923 sub region: AS1, AS2, AS3, AS4",
11+
"value": "AS1"
12+
},
913
"over-the-air-activation": {
1014
"help": "When set to 1 the application uses the Over-the-Air activation procedure, default: true",
1115
"value": true

0 commit comments

Comments
 (0)