Skip to content

Commit 271da26

Browse files
Johan HedbergAnas Nashif
authored andcommitted
Bluetooth: Mesh: Remove local network interface Kconfig option
From section 3.4.5.3 in the Mesh Profile Specification 1.0: "A node shall implement a Local Network Interface." Removing the Kconfig option also helps clean up quite a lot of code. Signed-off-by: Johan Hedberg <[email protected]>
1 parent 061e809 commit 271da26

File tree

3 files changed

+0
-26
lines changed

3 files changed

+0
-26
lines changed

subsys/bluetooth/host/mesh/Kconfig

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,6 @@ endif # BT_MESH_PROXY
6767

6868
endif # BT_CONN
6969

70-
config BT_MESH_LOCAL_INTERFACE
71-
bool "Local network interface"
72-
default y
73-
help
74-
This is needed in order to send messages between two local Mesh
75-
elements. Only disable it if you're sure this will not be needed
76-
(which helps save a little bit of memory).
77-
7870
config BT_MESH_SELF_TEST
7971
bool "Perform self-tests"
8072
help

subsys/bluetooth/host/mesh/net.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,6 @@ int bt_mesh_net_resend(struct bt_mesh_subnet *sub, struct net_buf *buf,
677677
return 0;
678678
}
679679

680-
#if defined(CONFIG_BT_MESH_LOCAL_INTERFACE)
681680
static void bt_mesh_net_local(struct k_work *work)
682681
{
683682
struct net_buf *buf;
@@ -688,7 +687,6 @@ static void bt_mesh_net_local(struct k_work *work)
688687
net_buf_unref(buf);
689688
}
690689
}
691-
#endif
692690

693691
int bt_mesh_net_encode(struct bt_mesh_net_tx *tx, struct net_buf_simple *buf,
694692
bool proxy)
@@ -801,7 +799,6 @@ int bt_mesh_net_send(struct bt_mesh_net_tx *tx, struct net_buf *buf,
801799
}
802800
}
803801

804-
#if defined(CONFIG_BT_MESH_LOCAL_INTERFACE)
805802
/* Deliver to local network interface if necessary */
806803
if (bt_mesh_fixed_group_match(tx->ctx->addr) ||
807804
bt_mesh_elem_find(tx->ctx->addr)) {
@@ -813,9 +810,6 @@ int bt_mesh_net_send(struct bt_mesh_net_tx *tx, struct net_buf *buf,
813810
} else {
814811
bt_mesh_adv_send(buf, cb);
815812
}
816-
#else
817-
bt_mesh_adv_send(buf, cb);
818-
#endif
819813

820814
done:
821815
net_buf_unref(buf);
@@ -975,9 +969,6 @@ static int net_find_and_decrypt(const u8_t *data, size_t data_len,
975969
return false;
976970
}
977971

978-
#if (defined(CONFIG_BT_MESH_RELAY) || \
979-
defined(CONFIG_BT_MESH_FRIEND) || \
980-
defined(CONFIG_BT_MESH_GATT_PROXY))
981972
static void bt_mesh_net_relay(struct net_buf_simple *sbuf,
982973
struct bt_mesh_net_rx *rx)
983974
{
@@ -1081,7 +1072,6 @@ static void bt_mesh_net_relay(struct net_buf_simple *sbuf,
10811072
done:
10821073
net_buf_unref(buf);
10831074
}
1084-
#endif /* RELAY || FRIEND || GATT_PROXY */
10851075

10861076
int bt_mesh_net_decode(struct net_buf_simple *data, enum bt_mesh_net_if net_if,
10871077
struct bt_mesh_net_rx *rx, struct net_buf_simple *buf,
@@ -1191,12 +1181,8 @@ void bt_mesh_net_recv(struct net_buf_simple *data, s8_t rssi,
11911181
}
11921182
}
11931183

1194-
#if (defined(CONFIG_BT_MESH_RELAY) || \
1195-
defined(CONFIG_BT_MESH_FRIEND) || \
1196-
defined(CONFIG_BT_MESH_GATT_PROXY))
11971184
net_buf_simple_restore(buf, &state);
11981185
bt_mesh_net_relay(buf, &rx);
1199-
#endif /* CONFIG_BT_MESH_RELAY || FRIEND || GATT_PROXY */
12001186
}
12011187

12021188
static void ivu_complete(struct k_work *work)
@@ -1211,7 +1197,5 @@ void bt_mesh_net_init(void)
12111197
{
12121198
k_delayed_work_init(&bt_mesh.ivu_complete, ivu_complete);
12131199

1214-
#if defined(CONFIG_BT_MESH_LOCAL_INTERFACE)
12151200
k_work_init(&bt_mesh.local_work, bt_mesh_net_local);
1216-
#endif
12171201
}

subsys/bluetooth/host/mesh/net.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,9 @@ struct bt_mesh_net {
166166

167167
s64_t last_update; /* Time since last IV Update change */
168168

169-
#if defined(CONFIG_BT_MESH_LOCAL_INTERFACE)
170169
/* Local network interface */
171170
struct k_work local_work;
172171
struct k_fifo local_queue;
173-
#endif
174172

175173
#if defined(CONFIG_BT_MESH_FRIEND)
176174
struct bt_mesh_friend frnd; /* Friend state */

0 commit comments

Comments
 (0)