Skip to content

Commit

Permalink
[bbr] add a flag to enable BBR on init (#2265)
Browse files Browse the repository at this point in the history
Flag `OTBR_ENABLE_BACKBONE_ROUTER_ON_INIT` is created for enabling BBR
on init. It's set to OTBR_ENABLE_BACKBONE_ROUTER by default and this
works when infra link is statically configured. If infra link is
dynamically configured then this flag should be set to 0, the
component that sets infra link should enable/disable BBR feature with
the otBackboneRouterSetEnabled API.
  • Loading branch information
sunytt authored Apr 30, 2024
1 parent 5afa125 commit 35ba9fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/backbone_router/backbone_agent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ void BackboneAgent::Init(void)
mNdProxyManager.Init();
#endif

#if OTBR_ENABLE_BACKBONE_ROUTER_ON_INIT
otBackboneRouterSetEnabled(mNcp.GetInstance(), /* aEnabled */ true);
#endif
}

void BackboneAgent::HandleThreadStateChanged(otChangedFlags aFlags)
Expand Down
4 changes: 4 additions & 0 deletions src/backbone_router/backbone_agent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@

#include "openthread-br/config.h"

#ifndef OTBR_ENABLE_BACKBONE_ROUTER_ON_INIT
#define OTBR_ENABLE_BACKBONE_ROUTER_ON_INIT OTBR_ENABLE_BACKBONE_ROUTER
#endif

#if OTBR_ENABLE_BACKBONE_ROUTER

#include <openthread/backbone_router_ftd.h>
Expand Down

0 comments on commit 35ba9fe

Please sign in to comment.