Skip to content

Commit 861d722

Browse files
authored
[border agent] refactor border agent to use MeshCoP Service state changed callback (#2727)
1 parent b852388 commit 861d722

File tree

9 files changed

+165
-234
lines changed

9 files changed

+165
-234
lines changed

src/agent/application.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,11 @@ void Application::InitRcpMode(void)
255255
mPublisher->Start();
256256
#endif
257257
#if OTBR_ENABLE_BORDER_AGENT
258-
mBorderAgent->Init();
258+
mHost.SetBorderAgentMeshCoPServiceChangedCallback(
259+
[this](bool aIsActive, uint16_t aPort, const uint8_t *aTxtData, uint16_t aLength) {
260+
mBorderAgent->HandleBorderAgentMeshCoPServiceChanged(aIsActive, aPort,
261+
std::vector<uint8_t>(aTxtData, aTxtData + aLength));
262+
});
259263
// This is for delaying publishing the MeshCoP service until the correct
260264
// vendor name and OUI etc. are correctly set by BorderAgent::SetMeshCopServiceValues()
261265
#if OTBR_STOP_BORDER_AGENT_ON_INIT

0 commit comments

Comments
 (0)