@@ -891,46 +891,39 @@ static int thread_extension_bbr_pbbr_start(thread_pbbr_t *this)
891
891
//If started only refresh network data
892
892
return 0 ;
893
893
}
894
+ // Register to backbone CoAP service
895
+ this -> br_bb_service_id = coap_service_initialize (this -> backbone_interface_id , this -> pbbr_port , COAP_SERVICE_OPTIONS_SELECT_SOCKET_IF , NULL , NULL );
896
+ if (this -> br_bb_service_id < 0 ) {
897
+ tr_error ("pBBR Commercial service start failed" );
898
+ thread_extension_bbr_pbbr_stop (this );
899
+ return -1 ;
900
+ }
894
901
// Allow only filtered addresses to be forwarded
895
902
multicast_fwd_full_for_scope (this -> interface_id , 0x10 );
896
903
multicast_fwd_full_for_scope (this -> backbone_interface_id , 0 );
897
904
898
- //Register baseline 1.2 features
899
- coap_service_register_uri (this -> coap_service_id , THREAD_URI_BBR_MCAST_LISTENER_REPORT , COAP_SERVICE_ACCESS_POST_ALLOWED , thread_extension_bbr_mlr_cb );
900
- this -> pbbr_started = true;
901
-
902
905
// Generate pbbr multicast address
903
906
memset (this -> pbbr_multicast_address , 0 , 16 );
904
907
this -> pbbr_multicast_address [0 ] = 0xff ;
905
908
this -> pbbr_multicast_address [1 ] = 0x30 | 3 ; //Thread specification says p and t bits are 1 Scope is 3
906
909
this -> pbbr_multicast_address [2 ] = 0x00 ; //Reserved
907
910
this -> pbbr_multicast_address [3 ] = 0x40 ; //Prefix length 64 bits
908
911
this -> pbbr_multicast_address [15 ] = 2 ;
909
- if (0 != thread_extension_network_prefix_get (this -> interface_id , NULL , & this -> pbbr_multicast_address [4 ], NULL )) {
910
- //No domain prefix in settings DUA handling not used
911
- tr_info ("pBBR service started (Home network)" );
912
- return 0 ;
913
- }
912
+
914
913
tr_info ("pBBR service started (Commercial network)" );
915
- // Start commercial mode features
914
+ // Register Primary BBR backbone multicast address
916
915
multicast_add_address (this -> pbbr_multicast_address , false);
917
916
918
- // Register to backbone CoAP service
919
- this -> br_bb_service_id = coap_service_initialize (this -> backbone_interface_id , this -> pbbr_port , COAP_SERVICE_OPTIONS_SELECT_SOCKET_IF , NULL , NULL );
920
- if (this -> br_bb_service_id < 0 ) {
921
- tr_error ("pBBR Commercial service start failed" );
922
- thread_extension_bbr_pbbr_stop (this );
923
- return -1 ;
924
- }
925
- // Register Primary BBR backbone multicast address
917
+ this -> pbbr_started = true;
926
918
927
- // Register commercial features
919
+ // Register Backbone commercial features
928
920
coap_service_register_uri (this -> br_bb_service_id , THREAD_URI_BBR_BB_QRY_NTF , COAP_SERVICE_ACCESS_POST_ALLOWED , thread_pbbr_bb_qry_cb );
929
921
coap_service_register_uri (this -> br_bb_service_id , THREAD_URI_BBR_BB_ANS_NTF , COAP_SERVICE_ACCESS_POST_ALLOWED , thread_pbbr_bb_ans_cb );
930
922
coap_service_register_uri (this -> br_bb_service_id , THREAD_URI_TRI_TX_NTF , COAP_SERVICE_ACCESS_POST_ALLOWED , thread_pbbr_relay_from_tri_cb );
931
923
coap_service_register_uri (this -> br_bb_service_id , THREAD_URI_BBR_BMLR_NTF , COAP_SERVICE_ACCESS_POST_ALLOWED , thread_extension_bbr_bmlr_cb );
932
924
933
925
// Register Mesh address registration URI
926
+ coap_service_register_uri (this -> coap_service_id , THREAD_URI_BBR_MCAST_LISTENER_REPORT , COAP_SERVICE_ACCESS_POST_ALLOWED , thread_extension_bbr_mlr_cb );
934
927
coap_service_register_uri (this -> coap_service_id , THREAD_URI_BBR_DOMAIN_ADDRESS_REGISTRATION , COAP_SERVICE_ACCESS_POST_ALLOWED , thread_extension_bbr_dua_cb );
935
928
// Register Mesh side relay URI
936
929
coap_service_register_uri (this -> coap_service_id , THREAD_URI_BBR_TRI_RX_NTF , COAP_SERVICE_ACCESS_POST_ALLOWED , thread_pbbr_relay_to_tri_cb );
@@ -942,7 +935,7 @@ static int thread_extension_bbr_pbbr_start(thread_pbbr_t *this)
942
935
thread_extension_bootstrap_network_certificate_enable (cur , this -> coap_nmkp_virtual_service_id );
943
936
coap_service_register_uri (this -> coap_nmkp_virtual_service_id , THREAD_URI_BBR_NMKP_REQ , COAP_SERVICE_ACCESS_POST_ALLOWED , thread_pbbr_nmkp_req_recv_cb );
944
937
coap_service_virtual_socket_set_cb (this -> coap_nmkp_virtual_service_id , thread_pbbr_nmkp_virtual_socket_send_cb );
945
- // Set the partition weight to be 72
938
+
946
939
return 0 ;
947
940
}
948
941
@@ -986,6 +979,8 @@ int8_t thread_extension_bbr_init(int8_t interface_id, int8_t backbone_interface_
986
979
}
987
980
ns_list_add_to_start (& pbbr_instance_list , this );
988
981
982
+ // Set the partition weight to be 72
983
+ thread_management_partition_weighting_set (this -> interface_id , 72 );
989
984
return 0 ;
990
985
}
991
986
@@ -1066,12 +1061,6 @@ void thread_extension_bbr_seconds_timer(int8_t interface_id, uint32_t seconds)
1066
1061
1067
1062
thread_extension_bbr_pbbr_start (this );
1068
1063
} else {
1069
- if (this -> br_bb_service_id < 0 &&
1070
- thread_extension_network_prefix_get (cur -> id , NULL , NULL , NULL ) == 0 ) {
1071
- // Settings changed to commercial
1072
- thread_extension_bbr_pbbr_stop (this );
1073
- thread_extension_bbr_pbbr_start (this );
1074
- }
1075
1064
if (thread_extension_bbr_downgrade_to_secondary (cur )) {
1076
1065
tr_info ("pbbr downgraded" );
1077
1066
thread_extension_bbr_pbbr_stop (this );
0 commit comments