mesh: Remove local network interface MYNEWT_VAL option

From section 3.4.5.3 in the Mesh Profile Specification 1.0:

	"A node shall implement a Local Network Interface."

This patch solves also the issue when sending group message and
BT_MESH_RELAY us not on. In such case message whas not broadcasted.

X-Original-Commit: bd916bd90d897a65701ba5cf8455aff761b49482
This commit is contained in:
Łukasz Rymanowski
2017-09-27 14:50:48 +02:00
parent 09373b18a1
commit 69063dca79
3 changed files with 0 additions and 25 deletions
-16
View File
@@ -675,7 +675,6 @@ int bt_mesh_net_resend(struct bt_mesh_subnet *sub, struct os_mbuf *buf,
return 0;
}
#if (MYNEWT_VAL(BLE_MESH_LOCAL_INTERFACE))
static void bt_mesh_net_local(struct os_event *work)
{
struct os_mbuf *buf;
@@ -686,7 +685,6 @@ static void bt_mesh_net_local(struct os_event *work)
net_buf_unref(buf);
}
}
#endif
int bt_mesh_net_encode(struct bt_mesh_net_tx *tx, struct os_mbuf *buf,
bool proxy)
@@ -802,7 +800,6 @@ int bt_mesh_net_send(struct bt_mesh_net_tx *tx, struct os_mbuf *buf,
}
}
#if (MYNEWT_VAL(BLE_MESH_LOCAL_INTERFACE))
/* Deliver to local network interface if necessary */
if (bt_mesh_fixed_group_match(tx->ctx->addr) ||
bt_mesh_elem_find(tx->ctx->addr)) {
@@ -814,9 +811,6 @@ int bt_mesh_net_send(struct bt_mesh_net_tx *tx, struct os_mbuf *buf,
} else {
bt_mesh_adv_send(buf, cb);
}
#else
bt_mesh_adv_send(buf, cb);
#endif
done:
net_buf_unref(buf);
@@ -977,9 +971,6 @@ static int net_find_and_decrypt(const u8_t *data, size_t data_len,
return false;
}
#if ((MYNEWT_VAL(BLE_MESH_RELAY)) || \
(MYNEWT_VAL(BLE_MESH_FRIEND)) || \
(MYNEWT_VAL(BLE_MESH_GATT_PROXY)))
static void bt_mesh_net_relay(struct os_mbuf *sbuf,
struct bt_mesh_net_rx *rx)
{
@@ -1086,7 +1077,6 @@ static void bt_mesh_net_relay(struct os_mbuf *sbuf,
done:
net_buf_unref(buf);
}
#endif /* RELAY || FRIEND || GATT_PROXY */
int bt_mesh_net_decode(struct os_mbuf *data, enum bt_mesh_net_if net_if,
struct bt_mesh_net_rx *rx, struct os_mbuf *buf,
@@ -1201,12 +1191,8 @@ void bt_mesh_net_recv(struct os_mbuf *data, s8_t rssi,
}
}
#if ((MYNEWT_VAL(BLE_MESH_RELAY)) || \
(MYNEWT_VAL(BLE_MESH_FRIEND)) || \
(MYNEWT_VAL(BLE_MESH_GATT_PROXY)))
net_buf_simple_restore(buf, &state);
bt_mesh_net_relay(buf, &rx);
#endif /* MYNEWT_VAL(BLE_MESH_RELAY) || FRIEND || GATT_PROXY */
done:
os_mbuf_free_chain(buf);
@@ -1224,8 +1210,6 @@ void bt_mesh_net_init(void)
{
k_delayed_work_init(&bt_mesh.ivu_complete, ivu_complete);
#if (MYNEWT_VAL(BLE_MESH_LOCAL_INTERFACE))
os_eventq_init(&bt_mesh.local_queue);
k_work_init(&bt_mesh.local_work, bt_mesh_net_local);
#endif
}
-2
View File
@@ -177,12 +177,10 @@ struct bt_mesh_net
s64_t last_update; /* Time since last IV Update change */
#if MYNEWT_VAL(BLE_MESH_LOCAL_INTERFACE)
/* Local network interface */
struct os_callout local_work;
struct os_eventq local_queue;
struct os_event local_ev;
#endif
#if MYNEWT_VAL(BLE_MESH_FRIEND)
struct bt_mesh_friend frnd; /* Friend state */
-7
View File
@@ -55,13 +55,6 @@ syscfg.defs:
This option specifies how many Proxy Filter entries the local
node supports.
value: 1
BLE_MESH_LOCAL_INTERFACE:
description: >
This is needed in order to send messages between two local Mesh
elements. Only disable it if you're sure this will not be needed
(which description: >s save a little bit of memory).
value: 1
BLE_MESH_SUBNET_COUNT:
description: >