@@ -49,12 +49,34 @@ uint8_t DEVICE_MIN_SENS = 174 - 93;
49
49
50
50
uint16_t test_max_child_count_override = 0xffff ;
51
51
52
-
53
- int8_t ws_generate_channel_list (uint32_t * channel_mask , uint16_t number_of_channels , uint8_t regulatory_domain )
52
+ int8_t ws_generate_channel_list (uint32_t * channel_mask , uint16_t number_of_channels , uint8_t regulatory_domain , uint8_t operating_class )
54
53
{
55
- (void )regulatory_domain ;
56
- for (uint8_t i = 0 ; i < number_of_channels ; i ++ ) {
57
- channel_mask [0 + (i / 32 )] |= (1 << (i % 32 ));
54
+ uint32_t excluded_start_channel = 0xFFFFFFFF ;
55
+ uint32_t excluded_end_channel = 0xFFFFFFFF ;
56
+
57
+ if (regulatory_domain == REG_DOMAIN_BZ ) {
58
+ if (operating_class == 1 ) {
59
+ excluded_start_channel = 26 ;
60
+ excluded_end_channel = 64 ;
61
+ } else if (operating_class == 2 ) {
62
+ excluded_start_channel = 12 ;
63
+ excluded_end_channel = 32 ;
64
+ } else if (operating_class == 3 ) {
65
+ excluded_start_channel = 7 ;
66
+ excluded_end_channel = 21 ;
67
+ }
68
+ }
69
+
70
+ // Clear channel mask
71
+ for (uint8_t i = 0 ; i < 8 ; i ++ ) {
72
+ channel_mask [i ] = 0 ;
73
+ }
74
+
75
+ // Set channel maks outside excluded channels
76
+ for (uint16_t i = 0 ; i < number_of_channels ; i ++ ) {
77
+ if (i < excluded_start_channel || i > excluded_end_channel ) {
78
+ channel_mask [0 + (i / 32 )] |= (1 << (i % 32 ));
79
+ }
58
80
}
59
81
return 0 ;
60
82
}
@@ -159,6 +181,19 @@ int8_t ws_common_regulatory_domain_config(protocol_interface_info_entry_t *cur,
159
181
} else {
160
182
return -1 ;
161
183
}
184
+ } else if (hopping_schdule -> regulatory_domain == REG_DOMAIN_BZ ) {
185
+ if (hopping_schdule -> operating_class == 1 ) {
186
+ hopping_schdule -> ch0_freq = 9022 ;
187
+ hopping_schdule -> channel_spacing = CHANNEL_SPACING_200 ;
188
+ } else if (hopping_schdule -> operating_class == 2 ) {
189
+ hopping_schdule -> ch0_freq = 9024 ;
190
+ hopping_schdule -> channel_spacing = CHANNEL_SPACING_400 ;
191
+ } else if (hopping_schdule -> operating_class == 3 ) {
192
+ hopping_schdule -> ch0_freq = 9026 ;
193
+ hopping_schdule -> channel_spacing = CHANNEL_SPACING_600 ;
194
+ } else {
195
+ return -1 ;
196
+ }
162
197
} else if (hopping_schdule -> regulatory_domain == REG_DOMAIN_JP ) {
163
198
if (hopping_schdule -> operating_class == 1 ) {
164
199
hopping_schdule -> ch0_freq = 9206 ;
@@ -189,6 +224,7 @@ int8_t ws_common_regulatory_domain_config(protocol_interface_info_entry_t *cur,
189
224
if (!hopping_schdule -> number_of_channels ) {
190
225
return -1 ;
191
226
}
227
+
192
228
return 0 ;
193
229
}
194
230
@@ -232,6 +268,14 @@ uint16_t ws_common_channel_number_calc(uint8_t regulatory_domain, uint8_t operat
232
268
} else if (operating_class == 3 ) {
233
269
return 12 ;
234
270
}
271
+ } else if (regulatory_domain == REG_DOMAIN_BZ ) {
272
+ if (operating_class == 1 ) {
273
+ return 129 ;
274
+ } else if (operating_class == 2 ) {
275
+ return 64 ;
276
+ } else if (operating_class == 3 ) {
277
+ return 42 ;
278
+ }
235
279
} else if (regulatory_domain == REG_DOMAIN_WW ) {
236
280
if (operating_class == 1 ) {
237
281
// TODO we dont support this yet, but it is used as test value
0 commit comments