Bluetooth: Mesh: Rename gatt adv func

Since this module is already changed, current really
confuses when trying to understand the code.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
This commit is contained in:
Lingao Meng 2021-11-18 09:23:08 +08:00 committed by Johan Hedberg
commit 83bc5d0953
9 changed files with 29 additions and 29 deletions

View file

@ -57,7 +57,7 @@ struct net_buf *bt_mesh_adv_buf_get(k_timeout_t timeout);
struct net_buf *bt_mesh_adv_buf_relay_get(k_timeout_t timeout); struct net_buf *bt_mesh_adv_buf_relay_get(k_timeout_t timeout);
void bt_mesh_adv_update(void); void bt_mesh_adv_gatt_update(void);
void bt_mesh_adv_buf_get_cancel(void); void bt_mesh_adv_buf_get_cancel(void);
@ -73,9 +73,9 @@ void bt_mesh_adv_buf_local_ready(void);
void bt_mesh_adv_buf_relay_ready(void); void bt_mesh_adv_buf_relay_ready(void);
int bt_mesh_adv_start(const struct bt_le_adv_param *param, int32_t duration, int bt_mesh_adv_gatt_start(const struct bt_le_adv_param *param, int32_t duration,
const struct bt_data *ad, size_t ad_len, const struct bt_data *ad, size_t ad_len,
const struct bt_data *sd, size_t sd_len); const struct bt_data *sd, size_t sd_len);
static inline void bt_mesh_adv_send_start(uint16_t duration, int err, static inline void bt_mesh_adv_send_start(uint16_t duration, int err,
struct bt_mesh_adv *adv) struct bt_mesh_adv *adv)

View file

@ -303,7 +303,7 @@ static bool schedule_send(struct ext_adv *adv)
return true; return true;
} }
void bt_mesh_adv_update(void) void bt_mesh_adv_gatt_update(void)
{ {
(void)schedule_send(BT_MESH_ADV_EXT_GATT_SEPARATE_INS); (void)schedule_send(BT_MESH_ADV_EXT_GATT_SEPARATE_INS);
} }
@ -435,9 +435,9 @@ int bt_mesh_adv_enable(void)
return 0; return 0;
} }
int bt_mesh_adv_start(const struct bt_le_adv_param *param, int32_t duration, int bt_mesh_adv_gatt_start(const struct bt_le_adv_param *param, int32_t duration,
const struct bt_data *ad, size_t ad_len, const struct bt_data *ad, size_t ad_len,
const struct bt_data *sd, size_t sd_len) const struct bt_data *sd, size_t sd_len)
{ {
struct ext_adv *adv = BT_MESH_ADV_EXT_GATT_SEPARATE_INS; struct ext_adv *adv = BT_MESH_ADV_EXT_GATT_SEPARATE_INS;
struct bt_le_ext_adv_start_param start = { struct bt_le_ext_adv_start_param start = {

View file

@ -135,7 +135,7 @@ static void adv_thread(void *p1, void *p2, void *p3)
while (!buf) { while (!buf) {
/* Adv timeout may be set by a call from proxy /* Adv timeout may be set by a call from proxy
* to bt_mesh_adv_start: * to bt_mesh_adv_gatt_start:
*/ */
adv_timeout = SYS_FOREVER_MS; adv_timeout = SYS_FOREVER_MS;
if (bt_mesh_is_provisioned()) { if (bt_mesh_is_provisioned()) {
@ -182,7 +182,7 @@ void bt_mesh_adv_buf_relay_ready(void)
/* Will be handled automatically */ /* Will be handled automatically */
} }
void bt_mesh_adv_update(void) void bt_mesh_adv_gatt_update(void)
{ {
bt_mesh_adv_buf_get_cancel(); bt_mesh_adv_buf_get_cancel();
} }
@ -202,9 +202,9 @@ int bt_mesh_adv_enable(void)
return 0; return 0;
} }
int bt_mesh_adv_start(const struct bt_le_adv_param *param, int32_t duration, int bt_mesh_adv_gatt_start(const struct bt_le_adv_param *param, int32_t duration,
const struct bt_data *ad, size_t ad_len, const struct bt_data *ad, size_t ad_len,
const struct bt_data *sd, size_t sd_len) const struct bt_data *sd, size_t sd_len)
{ {
adv_timeout = duration; adv_timeout = duration;
return bt_le_adv_start(param, ad, ad_len, sd, sd_len); return bt_le_adv_start(param, ad, ad_len, sd, sd_len);

View file

@ -359,7 +359,7 @@ int bt_mesh_start(void)
if (IS_ENABLED(CONFIG_BT_MESH_GATT_PROXY)) { if (IS_ENABLED(CONFIG_BT_MESH_GATT_PROXY)) {
(void)bt_mesh_proxy_gatt_enable(); (void)bt_mesh_proxy_gatt_enable();
bt_mesh_adv_update(); bt_mesh_adv_gatt_update();
} }
} }

View file

@ -126,7 +126,7 @@ static int link_accept(const struct prov_bearer_cb *cb, void *cb_data)
} }
(void)bt_mesh_pb_gatt_enable(); (void)bt_mesh_pb_gatt_enable();
bt_mesh_adv_update(); bt_mesh_adv_gatt_update();
link.cb = cb; link.cb = cb;
link.cb_data = cb_data; link.cb_data = cb_data;

View file

@ -203,7 +203,7 @@ int bt_mesh_pb_gatt_disable(void)
bt_gatt_service_unregister(&prov_svc); bt_gatt_service_unregister(&prov_svc);
service_registered = false; service_registered = false;
bt_mesh_adv_update(); bt_mesh_adv_gatt_update();
return 0; return 0;
} }
@ -297,14 +297,14 @@ int bt_mesh_pb_gatt_adv_start(void)
ADV_SLOW_INT, ADV_SLOW_INT,
}; };
return bt_mesh_adv_start(&slow_adv_param, SYS_FOREVER_MS, prov_ad, return bt_mesh_adv_gatt_start(&slow_adv_param, SYS_FOREVER_MS, prov_ad,
ARRAY_SIZE(prov_ad), prov_sd, prov_sd_len); ARRAY_SIZE(prov_ad), prov_sd, prov_sd_len);
} }
/* Advertise 60 seconds using fast interval */ /* Advertise 60 seconds using fast interval */
err = bt_mesh_adv_start(&fast_adv_param, (60 * MSEC_PER_SEC), err = bt_mesh_adv_gatt_start(&fast_adv_param, (60 * MSEC_PER_SEC),
prov_ad, ARRAY_SIZE(prov_ad), prov_ad, ARRAY_SIZE(prov_ad),
prov_sd, prov_sd_len); prov_sd, prov_sd_len);
if (!err) { if (!err) {
prov_fast_adv = false; prov_fast_adv = false;
} }

View file

@ -228,5 +228,5 @@ void bt_mesh_proxy_role_cleanup(struct bt_mesh_proxy_role *role)
bt_conn_unref(role->conn); bt_conn_unref(role->conn);
role->conn = NULL; role->conn = NULL;
bt_mesh_adv_update(); bt_mesh_adv_gatt_update();
} }

View file

@ -393,7 +393,7 @@ int bt_mesh_proxy_identity_enable(void)
} }
if (bt_mesh_subnet_foreach(node_id_start)) { if (bt_mesh_subnet_foreach(node_id_start)) {
bt_mesh_adv_update(); bt_mesh_adv_gatt_update();
} }
return 0; return 0;
@ -455,8 +455,8 @@ static int node_id_adv(struct bt_mesh_subnet *sub, int32_t duration)
memcpy(proxy_svc_data + 3, tmp + 8, 8); memcpy(proxy_svc_data + 3, tmp + 8, 8);
err = bt_mesh_adv_start(&fast_adv_param, duration, node_id_ad, err = bt_mesh_adv_gatt_start(&fast_adv_param, duration, node_id_ad,
ARRAY_SIZE(node_id_ad), NULL, 0); ARRAY_SIZE(node_id_ad), NULL, 0);
if (err) { if (err) {
BT_WARN("Failed to advertise using Node ID (err %d)", err); BT_WARN("Failed to advertise using Node ID (err %d)", err);
return err; return err;
@ -482,8 +482,8 @@ static int net_id_adv(struct bt_mesh_subnet *sub, int32_t duration)
memcpy(proxy_svc_data + 3, sub->keys[SUBNET_KEY_TX_IDX(sub)].net_id, 8); memcpy(proxy_svc_data + 3, sub->keys[SUBNET_KEY_TX_IDX(sub)].net_id, 8);
err = bt_mesh_adv_start(&slow_adv_param, duration, net_id_ad, err = bt_mesh_adv_gatt_start(&slow_adv_param, duration, net_id_ad,
ARRAY_SIZE(net_id_ad), NULL, 0); ARRAY_SIZE(net_id_ad), NULL, 0);
if (err) { if (err) {
BT_WARN("Failed to advertise using Network ID (err %d)", err); BT_WARN("Failed to advertise using Network ID (err %d)", err);
return err; return err;
@ -877,7 +877,7 @@ static void gatt_connected(struct bt_conn *conn, uint8_t err)
/* Try to re-enable advertising in case it's possible */ /* Try to re-enable advertising in case it's possible */
if (conn_count < CONFIG_BT_MAX_CONN) { if (conn_count < CONFIG_BT_MAX_CONN) {
bt_mesh_adv_update(); bt_mesh_adv_gatt_update();
} }
} }

View file

@ -538,7 +538,7 @@ uint8_t bt_mesh_subnet_node_id_set(uint16_t net_idx,
bt_mesh_proxy_identity_stop(sub); bt_mesh_proxy_identity_stop(sub);
} }
bt_mesh_adv_update(); bt_mesh_adv_gatt_update();
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }