@@ -49,12 +49,34 @@ uint8_t DEVICE_MIN_SENS = 174 - 93;
4949
5050uint16_t test_max_child_count_override = 0xffff ;
5151
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 )
5453{
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+ }
5880 }
5981 return 0 ;
6082}
@@ -159,6 +181,19 @@ int8_t ws_common_regulatory_domain_config(protocol_interface_info_entry_t *cur,
159181 } else {
160182 return -1 ;
161183 }
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+ }
162197 } else if (hopping_schdule -> regulatory_domain == REG_DOMAIN_JP ) {
163198 if (hopping_schdule -> operating_class == 1 ) {
164199 hopping_schdule -> ch0_freq = 9206 ;
@@ -189,6 +224,7 @@ int8_t ws_common_regulatory_domain_config(protocol_interface_info_entry_t *cur,
189224 if (!hopping_schdule -> number_of_channels ) {
190225 return -1 ;
191226 }
227+
192228 return 0 ;
193229}
194230
@@ -232,6 +268,14 @@ uint16_t ws_common_channel_number_calc(uint8_t regulatory_domain, uint8_t operat
232268 } else if (operating_class == 3 ) {
233269 return 12 ;
234270 }
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+ }
235279 } else if (regulatory_domain == REG_DOMAIN_WW ) {
236280 if (operating_class == 1 ) {
237281 // TODO we dont support this yet, but it is used as test value
0 commit comments