Skip to content

Commit

Permalink
Bluetooth: Mesh: Fix build error when LPN is not enabled
Browse files Browse the repository at this point in the history
Some versions of gcc do not seem to compile out the inaccessible code
in this case and instead give the following error:

subsys/bluetooth/host/mesh/transport.c:419: undefined reference to
`bt_mesh_lpn_poll'

This happens at least when building samples/bluetooth/mesh for
native_posix on Fedora 28.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  • Loading branch information
Johan Hedberg authored and jhedberg committed May 25, 2018
1 parent 8e41572 commit c4b0f1c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion subsys/bluetooth/host/mesh/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,8 @@ static int send_seg(struct bt_mesh_net_tx *net_tx, struct net_buf_simple *sdu,
}
}

if (bt_mesh_lpn_established()) {
if (IS_ENABLED(CONFIG_BT_MESH_LOW_POWER) &&
bt_mesh_lpn_established()) {
bt_mesh_lpn_poll();
}

Expand Down

0 comments on commit c4b0f1c

Please sign in to comment.