mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-09-15 13:40:01 +00:00
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:
@@ -675,7 +675,6 @@ int bt_mesh_net_resend(struct bt_mesh_subnet *sub, struct os_mbuf *buf,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (MYNEWT_VAL(BLE_MESH_LOCAL_INTERFACE))
|
|
||||||
static void bt_mesh_net_local(struct os_event *work)
|
static void bt_mesh_net_local(struct os_event *work)
|
||||||
{
|
{
|
||||||
struct os_mbuf *buf;
|
struct os_mbuf *buf;
|
||||||
@@ -686,7 +685,6 @@ static void bt_mesh_net_local(struct os_event *work)
|
|||||||
net_buf_unref(buf);
|
net_buf_unref(buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
int bt_mesh_net_encode(struct bt_mesh_net_tx *tx, struct os_mbuf *buf,
|
int bt_mesh_net_encode(struct bt_mesh_net_tx *tx, struct os_mbuf *buf,
|
||||||
bool proxy)
|
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 */
|
/* Deliver to local network interface if necessary */
|
||||||
if (bt_mesh_fixed_group_match(tx->ctx->addr) ||
|
if (bt_mesh_fixed_group_match(tx->ctx->addr) ||
|
||||||
bt_mesh_elem_find(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 {
|
} else {
|
||||||
bt_mesh_adv_send(buf, cb);
|
bt_mesh_adv_send(buf, cb);
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
bt_mesh_adv_send(buf, cb);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
done:
|
done:
|
||||||
net_buf_unref(buf);
|
net_buf_unref(buf);
|
||||||
@@ -977,9 +971,6 @@ static int net_find_and_decrypt(const u8_t *data, size_t data_len,
|
|||||||
return false;
|
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,
|
static void bt_mesh_net_relay(struct os_mbuf *sbuf,
|
||||||
struct bt_mesh_net_rx *rx)
|
struct bt_mesh_net_rx *rx)
|
||||||
{
|
{
|
||||||
@@ -1086,7 +1077,6 @@ static void bt_mesh_net_relay(struct os_mbuf *sbuf,
|
|||||||
done:
|
done:
|
||||||
net_buf_unref(buf);
|
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,
|
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,
|
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);
|
net_buf_simple_restore(buf, &state);
|
||||||
bt_mesh_net_relay(buf, &rx);
|
bt_mesh_net_relay(buf, &rx);
|
||||||
#endif /* MYNEWT_VAL(BLE_MESH_RELAY) || FRIEND || GATT_PROXY */
|
|
||||||
|
|
||||||
done:
|
done:
|
||||||
os_mbuf_free_chain(buf);
|
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);
|
k_delayed_work_init(&bt_mesh.ivu_complete, ivu_complete);
|
||||||
|
|
||||||
#if (MYNEWT_VAL(BLE_MESH_LOCAL_INTERFACE))
|
|
||||||
os_eventq_init(&bt_mesh.local_queue);
|
os_eventq_init(&bt_mesh.local_queue);
|
||||||
k_work_init(&bt_mesh.local_work, bt_mesh_net_local);
|
k_work_init(&bt_mesh.local_work, bt_mesh_net_local);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -177,12 +177,10 @@ struct bt_mesh_net
|
|||||||
|
|
||||||
s64_t last_update; /* Time since last IV Update change */
|
s64_t last_update; /* Time since last IV Update change */
|
||||||
|
|
||||||
#if MYNEWT_VAL(BLE_MESH_LOCAL_INTERFACE)
|
|
||||||
/* Local network interface */
|
/* Local network interface */
|
||||||
struct os_callout local_work;
|
struct os_callout local_work;
|
||||||
struct os_eventq local_queue;
|
struct os_eventq local_queue;
|
||||||
struct os_event local_ev;
|
struct os_event local_ev;
|
||||||
#endif
|
|
||||||
|
|
||||||
#if MYNEWT_VAL(BLE_MESH_FRIEND)
|
#if MYNEWT_VAL(BLE_MESH_FRIEND)
|
||||||
struct bt_mesh_friend frnd; /* Friend state */
|
struct bt_mesh_friend frnd; /* Friend state */
|
||||||
|
|||||||
@@ -55,13 +55,6 @@ syscfg.defs:
|
|||||||
This option specifies how many Proxy Filter entries the local
|
This option specifies how many Proxy Filter entries the local
|
||||||
node supports.
|
node supports.
|
||||||
value: 1
|
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:
|
BLE_MESH_SUBNET_COUNT:
|
||||||
description: >
|
description: >
|
||||||
|
|||||||
Reference in New Issue
Block a user