@@ -815,6 +815,31 @@ static bool ws_bootstrap_network_found(protocol_interface_info_entry_t *cur)
815
815
return true;
816
816
}
817
817
818
+ static bool ws_channel_plan_zero_compare (ws_channel_plan_zero_t * rx_plan , ws_hopping_schedule_t * hopping_schdule )
819
+ {
820
+ if (rx_plan -> operation_class != hopping_schdule -> operating_class ) {
821
+ return false;
822
+ } else if ( rx_plan -> regulator_domain != hopping_schdule -> regulatory_domain ) {
823
+ return false;
824
+ }
825
+ return true;
826
+ }
827
+
828
+ static bool ws_channel_plan_one_compare (ws_channel_plan_one_t * rx_plan , ws_hopping_schedule_t * hopping_schdule )
829
+ {
830
+ uint16_t num_of_channel = hopping_schdule -> number_of_channels ;
831
+ if (rx_plan -> ch0 != hopping_schdule -> ch0_freq ) {
832
+ return false;
833
+ } else if ( rx_plan -> channel_spacing != hopping_schdule -> channel_spacing ) {
834
+ return false;
835
+ } else if (rx_plan -> number_of_channel != num_of_channel ) {
836
+ return false;
837
+ }
838
+ return true;
839
+ }
840
+
841
+
842
+
818
843
819
844
static void ws_bootstrap_asynch_ind (struct protocol_interface_info_entry * cur , const struct mcps_data_ind_s * data , const struct mcps_data_ie_list * ie_ext , uint8_t message_type )
820
845
{
@@ -831,7 +856,6 @@ static void ws_bootstrap_asynch_ind(struct protocol_interface_info_entry *cur, c
831
856
//Check Network Name
832
857
if (!ws_bootstrap_network_name_matches (ie_ext , cur -> ws_info -> network_name )) {
833
858
// Not in our network
834
- tr_debug ("Network name not matching" );
835
859
return ;
836
860
}
837
861
break ;
@@ -845,17 +869,30 @@ static void ws_bootstrap_asynch_ind(struct protocol_interface_info_entry *cur, c
845
869
ws_utt_ie_t ws_utt ;
846
870
if (!ws_wh_utt_read (ie_ext -> headerIeList , ie_ext -> headerIeListLength , & ws_utt )) {
847
871
// Corrupted
848
- tr_error ("No ufsi" );
849
872
return ;
850
873
}
851
874
852
875
ws_us_ie_t ws_us ;
853
876
if (!ws_wp_nested_us_read (ie_ext -> payloadIeList , ie_ext -> payloadIeListLength , & ws_us )) {
854
877
// Corrupted
855
- tr_error ("No unicast schedule" );
856
878
return ;
857
879
}
858
880
881
+ //Compare Unicast channel Plan
882
+ if (ws_us .channel_plan != cur -> ws_info -> hopping_schdule .channel_plan ) {
883
+ return ;
884
+ }
885
+
886
+ if (ws_us .channel_plan == 0 ) {
887
+ if (!ws_channel_plan_zero_compare (& ws_us .plan .zero , & cur -> ws_info -> hopping_schdule )) {
888
+ return ;
889
+ }
890
+ } else if (ws_us .channel_plan == 1 ) {
891
+ if (!ws_channel_plan_one_compare (& ws_us .plan .one , & cur -> ws_info -> hopping_schdule )) {
892
+ return ;
893
+ }
894
+ }
895
+
859
896
//Handle Message's
860
897
switch (message_type ) {
861
898
case WS_FT_PAN_ADVERT :
0 commit comments