mesh: Fix build error when LPN is not enabled
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.
@@ -403,7 +403,8 @@ static int send_seg(struct bt_mesh_net_tx *net_tx, struct os_mbuf *sdu,
}
}
- if (bt_mesh_lpn_established()) {
+ if (IS_ENABLED(CONFIG_BT_MESH_LOW_POWER) &&
+ bt_mesh_lpn_established()) {
bt_mesh_lpn_poll();
}
