Skip to content

Commit

Permalink
[Telemetry] add peer_br_count in WpanTopoFull (#2383)
Browse files Browse the repository at this point in the history
`peer_br_count` is the number of border routers retrieved from network
data.
  • Loading branch information
zesonzhang authored Jul 23, 2024
1 parent 9f69fd0 commit 43f6bd9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/proto/thread_telemetry.proto
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ message TelemetryData {
optional uint32 neighbor_table_size = 15;
optional int32 instant_rssi = 16;
optional uint64 extended_pan_id = 17;
// Indicates the number peer BR in Thread mesh network (from network data)
optional uint32 peer_br_count = 18;
}

message TopoEntry {
Expand Down
3 changes: 3 additions & 0 deletions src/utils/thread_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1234,6 +1234,9 @@ otError ThreadHelper::RetrieveTelemetryData(Mdns::Publisher *aPublisher, threadn

extPanIdVal = ConvertOpenThreadUint64(extPanId->m8);
wpanTopoFull->set_extended_pan_id(extPanIdVal);
#if OTBR_ENABLE_BORDER_ROUTING
wpanTopoFull->set_peer_br_count(otBorderRoutingCountPeerBrs(mInstance, /*minAge=*/nullptr));
#endif
// End of WpanTopoFull section.

// Begin of TopoEntry section.
Expand Down
1 change: 1 addition & 0 deletions tests/dbus/test_dbus_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ void CheckTelemetryData(ThreadApiDBus *aApi)
TEST_ASSERT(telemetryData.wpan_topo_full().network_data().size() > 0);
TEST_ASSERT(telemetryData.wpan_topo_full().partition_id() > 0);
TEST_ASSERT(telemetryData.wpan_topo_full().extended_pan_id() > 0);
TEST_ASSERT(telemetryData.wpan_topo_full().peer_br_count() == 0);
TEST_ASSERT(telemetryData.topo_entries_size() == 1);
TEST_ASSERT(telemetryData.topo_entries(0).rloc16() < 0xffff);
TEST_ASSERT(telemetryData.wpan_border_router().border_routing_counters().rs_tx_failure() == 0);
Expand Down

0 comments on commit 43f6bd9

Please sign in to comment.