mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
ble_mesh: miscellaneous modifications
1. Clean up client_common.c 2. Clean up esp_ble_mesh directory 3. Update Kconfig.in 4. Format esp_ble_mesh files
This commit is contained in:
parent
30aa236219
commit
2bba9d7700
@ -311,9 +311,10 @@ if(CONFIG_BT_ENABLED)
|
||||
|
||||
if(CONFIG_BLE_MESH)
|
||||
list(APPEND include_dirs
|
||||
"esp_ble_mesh/mesh_common/include"
|
||||
"esp_ble_mesh/mesh_core"
|
||||
"esp_ble_mesh/mesh_core/include"
|
||||
"esp_ble_mesh/mesh_core/settings"
|
||||
"esp_ble_mesh/mesh_core/storage"
|
||||
"esp_ble_mesh/btc/include"
|
||||
"esp_ble_mesh/mesh_models/common/include"
|
||||
"esp_ble_mesh/mesh_models/client/include"
|
||||
@ -341,7 +342,13 @@ if(CONFIG_BT_ENABLED)
|
||||
"esp_ble_mesh/btc/btc_ble_mesh_prov.c"
|
||||
"esp_ble_mesh/btc/btc_ble_mesh_sensor_model.c"
|
||||
"esp_ble_mesh/btc/btc_ble_mesh_time_scene_model.c"
|
||||
"esp_ble_mesh/mesh_core/settings/settings_nvs.c"
|
||||
"esp_ble_mesh/mesh_common/mesh_aes_encrypt.c"
|
||||
"esp_ble_mesh/mesh_common/mesh_atomic.c"
|
||||
"esp_ble_mesh/mesh_common/mesh_buf.c"
|
||||
"esp_ble_mesh/mesh_common/mesh_common.c"
|
||||
"esp_ble_mesh/mesh_common/mesh_kernel.c"
|
||||
"esp_ble_mesh/mesh_common/mesh_util.c"
|
||||
"esp_ble_mesh/mesh_core/storage/settings_nvs.c"
|
||||
"esp_ble_mesh/mesh_core/access.c"
|
||||
"esp_ble_mesh/mesh_core/adv.c"
|
||||
"esp_ble_mesh/mesh_core/beacon.c"
|
||||
@ -352,12 +359,7 @@ if(CONFIG_BT_ENABLED)
|
||||
"esp_ble_mesh/mesh_core/health_cli.c"
|
||||
"esp_ble_mesh/mesh_core/health_srv.c"
|
||||
"esp_ble_mesh/mesh_core/lpn.c"
|
||||
"esp_ble_mesh/mesh_core/mesh_aes_encrypt.c"
|
||||
"esp_ble_mesh/mesh_core/mesh_atomic.c"
|
||||
"esp_ble_mesh/mesh_core/mesh_buf.c"
|
||||
"esp_ble_mesh/mesh_core/mesh_kernel.c"
|
||||
"esp_ble_mesh/mesh_core/mesh_main.c"
|
||||
"esp_ble_mesh/mesh_core/mesh_util.c"
|
||||
"esp_ble_mesh/mesh_core/main.c"
|
||||
"esp_ble_mesh/mesh_core/net.c"
|
||||
"esp_ble_mesh/mesh_core/prov.c"
|
||||
"esp_ble_mesh/mesh_core/provisioner_beacon.c"
|
||||
@ -368,7 +370,6 @@ if(CONFIG_BT_ENABLED)
|
||||
"esp_ble_mesh/mesh_core/settings.c"
|
||||
"esp_ble_mesh/mesh_core/test.c"
|
||||
"esp_ble_mesh/mesh_core/transport.c"
|
||||
"esp_ble_mesh/mesh_models/common/mesh_common.c"
|
||||
"esp_ble_mesh/mesh_models/client/client_common.c"
|
||||
"esp_ble_mesh/mesh_models/client/generic_client.c"
|
||||
"esp_ble_mesh/mesh_models/client/lighting_client.c"
|
||||
|
@ -140,9 +140,10 @@ endif
|
||||
endif
|
||||
|
||||
ifdef CONFIG_BLE_MESH
|
||||
COMPONENT_ADD_INCLUDEDIRS += esp_ble_mesh/mesh_core \
|
||||
COMPONENT_ADD_INCLUDEDIRS += esp_ble_mesh/mesh_common/include \
|
||||
esp_ble_mesh/mesh_core \
|
||||
esp_ble_mesh/mesh_core/include \
|
||||
esp_ble_mesh/mesh_core/settings \
|
||||
esp_ble_mesh/mesh_core/storage \
|
||||
esp_ble_mesh/btc/include \
|
||||
esp_ble_mesh/mesh_models/common/include \
|
||||
esp_ble_mesh/mesh_models/client/include \
|
||||
@ -151,10 +152,10 @@ COMPONENT_ADD_INCLUDEDIRS += esp_ble_mesh/mesh_core \
|
||||
esp_ble_mesh/api/models/include \
|
||||
esp_ble_mesh/api
|
||||
|
||||
COMPONENT_SRCDIRS += esp_ble_mesh/mesh_core \
|
||||
esp_ble_mesh/mesh_core/settings \
|
||||
COMPONENT_SRCDIRS += esp_ble_mesh/mesh_common \
|
||||
esp_ble_mesh/mesh_core \
|
||||
esp_ble_mesh/mesh_core/storage \
|
||||
esp_ble_mesh/btc \
|
||||
esp_ble_mesh/mesh_models/common \
|
||||
esp_ble_mesh/mesh_models/client \
|
||||
esp_ble_mesh/mesh_models/server \
|
||||
esp_ble_mesh/api/core \
|
||||
|
@ -60,7 +60,7 @@ if BLE_MESH
|
||||
config BLE_MESH_MAX_STORED_NODES
|
||||
int "Maximum number of nodes whose information can be stored"
|
||||
default 20
|
||||
range 1 1000
|
||||
range BLE_MESH_MAX_PROV_NODES 1000
|
||||
help
|
||||
This option specifies the maximum number of nodes whose information can be
|
||||
stored by a Provisioner in its upper layer.
|
||||
@ -71,7 +71,7 @@ if BLE_MESH
|
||||
config BLE_MESH_MAX_PROV_NODES
|
||||
int "Maximum number of devices that can be provisioned by Provisioner"
|
||||
default 20
|
||||
range 1 100
|
||||
range 1 1000
|
||||
help
|
||||
This option specifies how many devices can be provisioned by a Provisioner.
|
||||
This value indicates the maximum number of unprovisioned devices which can be
|
||||
@ -161,8 +161,8 @@ if BLE_MESH
|
||||
config BLE_MESH_GATT_PROXY_SERVER
|
||||
bool "BLE Mesh GATT Proxy Server"
|
||||
select BLE_MESH_PROXY
|
||||
default y if BLE_MESH_NODE
|
||||
default n if BLE_MESH_PROVISIONER
|
||||
depends on BLE_MESH_NODE
|
||||
default y
|
||||
help
|
||||
This option enables support for Mesh GATT Proxy Service, i.e. the
|
||||
ability to act as a proxy between a Mesh GATT Client and a Mesh network.
|
||||
@ -427,6 +427,8 @@ if BLE_MESH
|
||||
|
||||
config BLE_MESH_RELAY
|
||||
bool "Relay support"
|
||||
depends on BLE_MESH_NODE
|
||||
default y
|
||||
help
|
||||
Support for acting as a Mesh Relay Node. Enabling this option will allow
|
||||
a node to support the Relay feature, and the Relay feature can still
|
||||
@ -457,7 +459,7 @@ if BLE_MESH
|
||||
|
||||
config BLE_MESH_LOW_POWER
|
||||
bool "Support for Low Power features"
|
||||
select BLE_MESH_NODE
|
||||
depends on BLE_MESH_NODE
|
||||
help
|
||||
Enable this option to operate as a Low Power Node. If low power consumption
|
||||
is required by a node, this option should be enabled. And once the node
|
||||
@ -581,7 +583,7 @@ if BLE_MESH
|
||||
config BLE_MESH_LPN_GROUPS
|
||||
int "Number of groups the LPN can subscribe to"
|
||||
range 0 16384
|
||||
default 2
|
||||
default 8
|
||||
help
|
||||
Maximum number of groups to which the LPN can subscribe.
|
||||
|
||||
@ -589,7 +591,7 @@ if BLE_MESH
|
||||
|
||||
config BLE_MESH_FRIEND
|
||||
bool "Support for acting as a Friend Node"
|
||||
select BLE_MESH_NODE
|
||||
depends on BLE_MESH_NODE
|
||||
help
|
||||
Enable this option to be able to act as a Friend Node.
|
||||
|
||||
@ -724,16 +726,6 @@ if BLE_MESH
|
||||
|
||||
endmenu #BLE Mesh NET BUF DEBUG LOG LEVEL
|
||||
|
||||
config BLE_MESH_IRQ_LOCK
|
||||
bool "Used the IRQ lock instead of task lock"
|
||||
help
|
||||
To improve the real-time requirements of bt controller in BLE Mesh,
|
||||
task lock is used to replace IRQ lock.
|
||||
With this option enabled, interrupt lock instead of the mutex will
|
||||
be used and the BLE Mesh stack will try to change interrupt level to
|
||||
protect some critical situations. Users need to ensure that this option
|
||||
is disabled so mutex will be used in the bottom layer.
|
||||
|
||||
config BLE_MESH_CLIENT_MSG_TIMEOUT
|
||||
int "Timeout(ms) for client message response"
|
||||
range 100 1200000
|
||||
|
@ -41,7 +41,13 @@ static esp_err_t ble_mesh_model_send_msg(esp_ble_mesh_model_t *model,
|
||||
|
||||
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
|
||||
|
||||
if (ctx && ctx->addr == ESP_BLE_MESH_ADDR_UNASSIGNED) {
|
||||
LOG_ERROR("%s, Invalid destination address 0x0000", __func__);
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
if (device_role > ROLE_FAST_PROV) {
|
||||
LOG_ERROR("%s, Invalid device role 0x%02x", __func__, device_role);
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
|
@ -103,12 +103,12 @@ esp_err_t esp_ble_mesh_proxy_client_disconnect(uint8_t conn_handle)
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_mesh_proxy_client_set_filter_type(uint8_t conn_handle,
|
||||
uint16_t net_idx, uint8_t filter_type)
|
||||
uint16_t net_idx, esp_ble_mesh_proxy_filter_type_t filter_type)
|
||||
{
|
||||
btc_ble_mesh_prov_args_t arg = {0};
|
||||
btc_msg_t msg = {0};
|
||||
|
||||
if (filter_type > 0x01) {
|
||||
if (filter_type > PROXY_FILTER_BLACKLIST) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,14 @@ esp_err_t esp_ble_mesh_lpn_disable(bool force);
|
||||
/**
|
||||
* @brief LPN tries to poll messages from the Friend Node.
|
||||
*
|
||||
* @note Once called, Friend Poll will be sent to the Friend Node.
|
||||
* @note The Friend Poll message is sent by a Low Power node to ask the Friend
|
||||
* node to send a message that it has stored for the Low Power node.
|
||||
* Users can call this API to send Friend Poll message manually. If this
|
||||
* API is not invoked, the bottom layer of the Low Power node will send
|
||||
* Friend Poll before the PollTimeout timer expires.
|
||||
* If the corresponding Friend Update is received and MD is set to 0,
|
||||
* which means there are no messages for the Low Power node, then the
|
||||
* Low Power node will stop scanning.
|
||||
*
|
||||
* @return ESP_OK on success or error code otherwise.
|
||||
*
|
||||
|
@ -84,7 +84,7 @@ esp_err_t esp_ble_mesh_proxy_client_disconnect(uint8_t conn_handle);
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_ble_mesh_proxy_client_set_filter_type(uint8_t conn_handle,
|
||||
uint16_t net_idx, uint8_t filter_type);
|
||||
uint16_t net_idx, esp_ble_mesh_proxy_filter_type_t filter_type);
|
||||
|
||||
/**
|
||||
* @brief Proxy Client adds address to the Proxy Server filter list.
|
||||
|
@ -695,6 +695,12 @@ typedef enum {
|
||||
FAST_PROV_ACT_MAX,
|
||||
} esp_ble_mesh_fast_prov_action_t;
|
||||
|
||||
/*!< This enum value is the type of proxy filter */
|
||||
typedef enum {
|
||||
PROXY_FILTER_WHITELIST,
|
||||
PROXY_FILTER_BLACKLIST,
|
||||
} esp_ble_mesh_proxy_filter_type_t;
|
||||
|
||||
/*!< This enum value is the event of node/provisioner/fast provisioning */
|
||||
typedef enum {
|
||||
ESP_BLE_MESH_PROV_REGISTER_COMP_EVT, /*!< Initialize BLE Mesh provisioning capabilities and internal data information completion event */
|
||||
|
@ -1816,7 +1816,9 @@ void btc_ble_mesh_prov_call_handler(btc_msg_t *msg)
|
||||
/* Callback operation completion events */
|
||||
btc_ble_mesh_prov_set_complete_cb(¶m, act);
|
||||
|
||||
if (msg->arg) {
|
||||
btc_ble_mesh_prov_arg_deep_free(msg);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -39,25 +39,16 @@ typedef struct alarm_t {
|
||||
|
||||
unsigned int bt_mesh_irq_lock(void)
|
||||
{
|
||||
#if defined(CONFIG_BLE_MESH_IRQ_LOCK) && CONFIG_BLE_MESH_IRQ_LOCK
|
||||
unsigned int key = XTOS_SET_INTLEVEL(XCHAL_EXCM_LEVEL);
|
||||
return key;
|
||||
#else
|
||||
/* Change by Espressif. In BLE Mesh, in order to improve the real-time
|
||||
* requirements of bt controller, we use task lock to replace IRQ lock.
|
||||
/* Changed by Espressif. In BLE Mesh, in order to improve the real-time
|
||||
* requirements of bt controller, we use task lock instead of IRQ lock.
|
||||
*/
|
||||
osi_mutex_lock(&bm_irq_lock, OSI_MUTEX_MAX_TIMEOUT);
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void bt_mesh_irq_unlock(unsigned int key)
|
||||
{
|
||||
#if defined(CONFIG_BLE_MESH_IRQ_LOCK) && CONFIG_BLE_MESH_IRQ_LOCK
|
||||
XTOS_RESTORE_INTLEVEL(key);
|
||||
#else
|
||||
osi_mutex_unlock(&bm_irq_lock);
|
||||
#endif
|
||||
}
|
||||
|
||||
s64_t k_uptime_get(void)
|
@ -73,6 +73,8 @@
|
||||
/* 2 transmissions, 20ms interval */
|
||||
#define POLL_XMIT BLE_MESH_TRANSMIT(1, 20)
|
||||
|
||||
#define FIRST_POLL_ATTEMPTS 6
|
||||
|
||||
static void (*lpn_cb)(u16_t friend_addr, bool established);
|
||||
|
||||
static const char *state2str(int state)
|
||||
@ -743,7 +745,7 @@ static void update_timeout(struct bt_mesh_lpn *lpn)
|
||||
bt_mesh_scan_disable();
|
||||
}
|
||||
|
||||
if (lpn->req_attempts < 6) {
|
||||
if (lpn->req_attempts < FIRST_POLL_ATTEMPTS) {
|
||||
BT_WARN("Retrying first Friend Poll");
|
||||
lpn->sent_req = 0U;
|
||||
if (send_friend_poll() == 0) {
|
||||
@ -795,7 +797,7 @@ static void lpn_timeout(struct k_work *work)
|
||||
k_delayed_work_submit(&lpn->timer, FRIEND_REQ_RETRY_TIMEOUT);
|
||||
break;
|
||||
case BLE_MESH_LPN_OFFER_RECV:
|
||||
if (lpn->req_attempts < 6) {
|
||||
if (lpn->req_attempts < FIRST_POLL_ATTEMPTS) {
|
||||
BT_WARN("Retrying the first Friend Poll, %d attempts", lpn->req_attempts);
|
||||
lpn->sent_req = 0U;
|
||||
send_friend_poll();
|
||||
|
@ -1503,12 +1503,13 @@ static int dummy_access_cb(uint16_t conn_handle, uint16_t attr_handle,
|
||||
}
|
||||
|
||||
static const struct ble_gatt_svc_def svc_defs [] = {
|
||||
#ifdef CONFIG_BLE_MESH_GATT_PROXY
|
||||
#ifdef CONFIG_BLE_MESH_GATT_PROXY_SERVER
|
||||
{
|
||||
.type = BLE_GATT_SVC_TYPE_PRIMARY,
|
||||
.uuid = BLE_UUID16_DECLARE(BT_UUID_MESH_PROXY_VAL),
|
||||
.includes = NULL,
|
||||
.characteristics = (struct ble_gatt_chr_def[]) { {
|
||||
.characteristics = (struct ble_gatt_chr_def[])
|
||||
{ {
|
||||
.uuid = BLE_UUID16_DECLARE(BT_UUID_MESH_PROXY_DATA_IN_VAL),
|
||||
.access_cb = proxy_char_access_cb,
|
||||
.flags = BLE_GATT_CHR_F_WRITE_NO_RSP,
|
||||
@ -1518,7 +1519,8 @@ static const struct ble_gatt_svc_def svc_defs [] = {
|
||||
.flags = BLE_GATT_CHR_F_NOTIFY,
|
||||
}, {
|
||||
0, /* No more characteristics in this service. */
|
||||
} },
|
||||
}
|
||||
},
|
||||
},
|
||||
#endif
|
||||
#ifdef CONFIG_BLE_MESH_PB_GATT
|
||||
@ -1526,7 +1528,8 @@ static const struct ble_gatt_svc_def svc_defs [] = {
|
||||
.type = BLE_GATT_SVC_TYPE_PRIMARY,
|
||||
.uuid = BLE_UUID16_DECLARE(BT_UUID_MESH_PROV_VAL),
|
||||
.includes = NULL,
|
||||
.characteristics = (struct ble_gatt_chr_def[]) { {
|
||||
.characteristics = (struct ble_gatt_chr_def[])
|
||||
{ {
|
||||
.uuid = BLE_UUID16_DECLARE(BT_UUID_MESH_PROV_DATA_IN_VAL),
|
||||
.access_cb = proxy_char_access_cb,
|
||||
.flags = BLE_GATT_CHR_F_WRITE_NO_RSP,
|
||||
@ -1536,7 +1539,8 @@ static const struct ble_gatt_svc_def svc_defs [] = {
|
||||
.flags = BLE_GATT_CHR_F_NOTIFY,
|
||||
}, {
|
||||
0, /* No more characteristics in this service. */
|
||||
} },
|
||||
}
|
||||
},
|
||||
},
|
||||
#endif
|
||||
{
|
||||
|
@ -26,6 +26,24 @@
|
||||
#include "mesh.h"
|
||||
#include "client_common.h"
|
||||
|
||||
static bt_mesh_client_node_t *bt_mesh_client_pick_node(sys_slist_t *list, u16_t tx_dst)
|
||||
{
|
||||
if (sys_slist_is_empty(list)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
sys_snode_t *cur = NULL; bt_mesh_client_node_t *node = NULL;
|
||||
for (cur = sys_slist_peek_head(list);
|
||||
cur != NULL; cur = sys_slist_peek_next(cur)) {
|
||||
node = (bt_mesh_client_node_t *)cur;
|
||||
if (node->ctx.addr == tx_dst) {
|
||||
return node;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bt_mesh_client_node_t *bt_mesh_is_client_recv_publish_msg(
|
||||
struct bt_mesh_model *model,
|
||||
struct bt_mesh_msg_ctx *ctx,
|
||||
@ -34,7 +52,6 @@ bt_mesh_client_node_t *bt_mesh_is_client_recv_publish_msg(
|
||||
bt_mesh_client_internal_data_t *data = NULL;
|
||||
bt_mesh_client_user_data_t *cli = NULL;
|
||||
bt_mesh_client_node_t *node = NULL;
|
||||
u32_t rsp;
|
||||
|
||||
if (!model || !ctx || !buf) {
|
||||
BT_ERR("%s, Invalid parameter", __func__);
|
||||
@ -47,16 +64,14 @@ bt_mesh_client_node_t *bt_mesh_is_client_recv_publish_msg(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
rsp = ctx->recv_op;
|
||||
|
||||
/** If the received message address is not a unicast address,
|
||||
* the address may be a group/virtual address, and we push
|
||||
* this message to the application layer.
|
||||
*/
|
||||
if (!BLE_MESH_ADDR_IS_UNICAST(ctx->recv_dst)) {
|
||||
BT_DBG("Unexpected status message 0x%x", rsp);
|
||||
BT_DBG("Unexpected status message 0x%x", ctx->recv_op);
|
||||
if (cli->publish_status && need_pub) {
|
||||
cli->publish_status(rsp, model, ctx, buf);
|
||||
cli->publish_status(ctx->recv_op, model, ctx, buf);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@ -73,17 +88,17 @@ bt_mesh_client_node_t *bt_mesh_is_client_recv_publish_msg(
|
||||
}
|
||||
|
||||
if ((node = bt_mesh_client_pick_node(&data->queue, ctx->addr)) == NULL) {
|
||||
BT_DBG("Unexpected status message 0x%x", rsp);
|
||||
BT_DBG("Unexpected status message 0x%x", ctx->recv_op);
|
||||
if (cli->publish_status && need_pub) {
|
||||
cli->publish_status(rsp, model, ctx, buf);
|
||||
cli->publish_status(ctx->recv_op, model, ctx, buf);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (node->op_pending != rsp) {
|
||||
BT_DBG("Unexpected status message 0x%x", rsp);
|
||||
if (node->op_pending != ctx->recv_op) {
|
||||
BT_DBG("Unexpected status message 0x%x", ctx->recv_op);
|
||||
if (cli->publish_status && need_pub) {
|
||||
cli->publish_status(rsp, model, ctx, buf);
|
||||
cli->publish_status(ctx->recv_op, model, ctx, buf);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@ -91,26 +106,7 @@ bt_mesh_client_node_t *bt_mesh_is_client_recv_publish_msg(
|
||||
return node;
|
||||
}
|
||||
|
||||
bool bt_mesh_client_find_opcode_in_list(sys_slist_t *list, u32_t opcode)
|
||||
{
|
||||
if (sys_slist_is_empty(list)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
sys_snode_t *cur = NULL; bt_mesh_client_node_t *node = NULL;
|
||||
for (cur = sys_slist_peek_head(list);
|
||||
cur != NULL; cur = sys_slist_peek_next(cur)) {
|
||||
node = (bt_mesh_client_node_t *)cur;
|
||||
if (node->op_pending == opcode) {
|
||||
return true;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
bool bt_mesh_client_check_node_in_list(sys_slist_t *list, u16_t tx_dst)
|
||||
static bool bt_mesh_client_check_node_in_list(sys_slist_t *list, u16_t tx_dst)
|
||||
{
|
||||
if (sys_slist_is_empty(list)) {
|
||||
return false;
|
||||
@ -128,24 +124,6 @@ bool bt_mesh_client_check_node_in_list(sys_slist_t *list, u16_t tx_dst)
|
||||
return false;
|
||||
}
|
||||
|
||||
bt_mesh_client_node_t *bt_mesh_client_pick_node(sys_slist_t *list, u16_t tx_dst)
|
||||
{
|
||||
if (sys_slist_is_empty(list)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
sys_snode_t *cur = NULL; bt_mesh_client_node_t *node = NULL;
|
||||
for (cur = sys_slist_peek_head(list);
|
||||
cur != NULL; cur = sys_slist_peek_next(cur)) {
|
||||
node = (bt_mesh_client_node_t *)cur;
|
||||
if (node->ctx.addr == tx_dst) {
|
||||
return node;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static u32_t bt_mesh_client_get_status_op(const bt_mesh_client_op_pair_t *op_pair,
|
||||
int size, u32_t opcode)
|
||||
{
|
||||
|
@ -98,12 +98,6 @@ bt_mesh_client_node_t *bt_mesh_is_client_recv_publish_msg(
|
||||
struct bt_mesh_msg_ctx *ctx,
|
||||
struct net_buf_simple *buf, bool need_pub);
|
||||
|
||||
bool bt_mesh_client_find_opcode_in_list(sys_slist_t *list, u32_t opcode);
|
||||
|
||||
bool bt_mesh_client_check_node_in_list(sys_slist_t *list, uint16_t tx_dst);
|
||||
|
||||
bt_mesh_client_node_t *bt_mesh_client_pick_node(sys_slist_t *list, u16_t tx_dst);
|
||||
|
||||
int bt_mesh_client_send_msg(struct bt_mesh_model *model,
|
||||
u32_t opcode,
|
||||
struct bt_mesh_msg_ctx *ctx,
|
||||
|
@ -2332,8 +2332,12 @@ const struct bt_mesh_model_op gen_client_prop_srv_op[] = {
|
||||
|
||||
static inline int property_id_compare(const void *p1, const void *p2)
|
||||
{
|
||||
if (*(u16_t *)p1 < *(u16_t *)p2) return -1;
|
||||
if (*(u16_t *)p1 > *(u16_t *)p2) return 1;
|
||||
if (*(u16_t *)p1 < * (u16_t *)p2) {
|
||||
return -1;
|
||||
}
|
||||
if (*(u16_t *)p1 > *(u16_t *)p2) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -223,3 +223,5 @@ CONFIG_BLE_HOST_QUEUE_CONGESTION_CHECK CONFIG_BT_BLE_HOST_Q
|
||||
CONFIG_SMP_ENABLE CONFIG_BT_SMP_ENABLE
|
||||
CONFIG_BLE_ACTIVE_SCAN_REPORT_ADV_SCAN_RSP_INDIVIDUALLY CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN
|
||||
CONFIG_BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT
|
||||
|
||||
CONFIG_BLE_MESH_GATT_PROXY CONFIG_BLE_MESH_GATT_PROXY_SERVER
|
Loading…
x
Reference in New Issue
Block a user