From 83bc5d0953d739a6977d31078c2b0472dd301ac0 Mon Sep 17 00:00:00 2001 From: Lingao Meng Date: Thu, 18 Nov 2021 09:23:08 +0800 Subject: [PATCH] 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 --- subsys/bluetooth/mesh/adv.h | 8 ++++---- subsys/bluetooth/mesh/adv_ext.c | 8 ++++---- subsys/bluetooth/mesh/adv_legacy.c | 10 +++++----- subsys/bluetooth/mesh/main.c | 2 +- subsys/bluetooth/mesh/pb_gatt.c | 2 +- subsys/bluetooth/mesh/pb_gatt_srv.c | 12 ++++++------ subsys/bluetooth/mesh/proxy_msg.c | 2 +- subsys/bluetooth/mesh/proxy_srv.c | 12 ++++++------ subsys/bluetooth/mesh/subnet.c | 2 +- 9 files changed, 29 insertions(+), 29 deletions(-) diff --git a/subsys/bluetooth/mesh/adv.h b/subsys/bluetooth/mesh/adv.h index f491816f1d5..b9588320fe4 100644 --- a/subsys/bluetooth/mesh/adv.h +++ b/subsys/bluetooth/mesh/adv.h @@ -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); -void bt_mesh_adv_update(void); +void bt_mesh_adv_gatt_update(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); -int bt_mesh_adv_start(const struct bt_le_adv_param *param, int32_t duration, - const struct bt_data *ad, size_t ad_len, - const struct bt_data *sd, size_t sd_len); +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 *sd, size_t sd_len); static inline void bt_mesh_adv_send_start(uint16_t duration, int err, struct bt_mesh_adv *adv) diff --git a/subsys/bluetooth/mesh/adv_ext.c b/subsys/bluetooth/mesh/adv_ext.c index ba544f59ba9..5da626d3b2a 100644 --- a/subsys/bluetooth/mesh/adv_ext.c +++ b/subsys/bluetooth/mesh/adv_ext.c @@ -303,7 +303,7 @@ static bool schedule_send(struct ext_adv *adv) 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); } @@ -435,9 +435,9 @@ int bt_mesh_adv_enable(void) return 0; } -int bt_mesh_adv_start(const struct bt_le_adv_param *param, int32_t duration, - const struct bt_data *ad, size_t ad_len, - const struct bt_data *sd, size_t sd_len) +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 *sd, size_t sd_len) { struct ext_adv *adv = BT_MESH_ADV_EXT_GATT_SEPARATE_INS; struct bt_le_ext_adv_start_param start = { diff --git a/subsys/bluetooth/mesh/adv_legacy.c b/subsys/bluetooth/mesh/adv_legacy.c index 85cc35a25e9..0318ecde1e6 100644 --- a/subsys/bluetooth/mesh/adv_legacy.c +++ b/subsys/bluetooth/mesh/adv_legacy.c @@ -135,7 +135,7 @@ static void adv_thread(void *p1, void *p2, void *p3) while (!buf) { /* 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; if (bt_mesh_is_provisioned()) { @@ -182,7 +182,7 @@ void bt_mesh_adv_buf_relay_ready(void) /* Will be handled automatically */ } -void bt_mesh_adv_update(void) +void bt_mesh_adv_gatt_update(void) { bt_mesh_adv_buf_get_cancel(); } @@ -202,9 +202,9 @@ int bt_mesh_adv_enable(void) return 0; } -int bt_mesh_adv_start(const struct bt_le_adv_param *param, int32_t duration, - const struct bt_data *ad, size_t ad_len, - const struct bt_data *sd, size_t sd_len) +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 *sd, size_t sd_len) { adv_timeout = duration; return bt_le_adv_start(param, ad, ad_len, sd, sd_len); diff --git a/subsys/bluetooth/mesh/main.c b/subsys/bluetooth/mesh/main.c index 8ae1d0ea6b3..9f87e645bf9 100644 --- a/subsys/bluetooth/mesh/main.c +++ b/subsys/bluetooth/mesh/main.c @@ -359,7 +359,7 @@ int bt_mesh_start(void) if (IS_ENABLED(CONFIG_BT_MESH_GATT_PROXY)) { (void)bt_mesh_proxy_gatt_enable(); - bt_mesh_adv_update(); + bt_mesh_adv_gatt_update(); } } diff --git a/subsys/bluetooth/mesh/pb_gatt.c b/subsys/bluetooth/mesh/pb_gatt.c index 742d0d28a40..4341b47d9ce 100644 --- a/subsys/bluetooth/mesh/pb_gatt.c +++ b/subsys/bluetooth/mesh/pb_gatt.c @@ -126,7 +126,7 @@ static int link_accept(const struct prov_bearer_cb *cb, void *cb_data) } (void)bt_mesh_pb_gatt_enable(); - bt_mesh_adv_update(); + bt_mesh_adv_gatt_update(); link.cb = cb; link.cb_data = cb_data; diff --git a/subsys/bluetooth/mesh/pb_gatt_srv.c b/subsys/bluetooth/mesh/pb_gatt_srv.c index cf9a29a1b50..0b93212c7f1 100644 --- a/subsys/bluetooth/mesh/pb_gatt_srv.c +++ b/subsys/bluetooth/mesh/pb_gatt_srv.c @@ -203,7 +203,7 @@ int bt_mesh_pb_gatt_disable(void) bt_gatt_service_unregister(&prov_svc); service_registered = false; - bt_mesh_adv_update(); + bt_mesh_adv_gatt_update(); return 0; } @@ -297,14 +297,14 @@ int bt_mesh_pb_gatt_adv_start(void) ADV_SLOW_INT, }; - return bt_mesh_adv_start(&slow_adv_param, SYS_FOREVER_MS, prov_ad, - ARRAY_SIZE(prov_ad), prov_sd, prov_sd_len); + return bt_mesh_adv_gatt_start(&slow_adv_param, SYS_FOREVER_MS, prov_ad, + ARRAY_SIZE(prov_ad), prov_sd, prov_sd_len); } /* Advertise 60 seconds using fast interval */ - err = bt_mesh_adv_start(&fast_adv_param, (60 * MSEC_PER_SEC), - prov_ad, ARRAY_SIZE(prov_ad), - prov_sd, prov_sd_len); + err = bt_mesh_adv_gatt_start(&fast_adv_param, (60 * MSEC_PER_SEC), + prov_ad, ARRAY_SIZE(prov_ad), + prov_sd, prov_sd_len); if (!err) { prov_fast_adv = false; } diff --git a/subsys/bluetooth/mesh/proxy_msg.c b/subsys/bluetooth/mesh/proxy_msg.c index f6fec6c655d..6756048c7de 100644 --- a/subsys/bluetooth/mesh/proxy_msg.c +++ b/subsys/bluetooth/mesh/proxy_msg.c @@ -228,5 +228,5 @@ void bt_mesh_proxy_role_cleanup(struct bt_mesh_proxy_role *role) bt_conn_unref(role->conn); role->conn = NULL; - bt_mesh_adv_update(); + bt_mesh_adv_gatt_update(); } diff --git a/subsys/bluetooth/mesh/proxy_srv.c b/subsys/bluetooth/mesh/proxy_srv.c index 8c54dc2feee..ddbfa9a6a1d 100644 --- a/subsys/bluetooth/mesh/proxy_srv.c +++ b/subsys/bluetooth/mesh/proxy_srv.c @@ -393,7 +393,7 @@ int bt_mesh_proxy_identity_enable(void) } if (bt_mesh_subnet_foreach(node_id_start)) { - bt_mesh_adv_update(); + bt_mesh_adv_gatt_update(); } 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); - err = bt_mesh_adv_start(&fast_adv_param, duration, node_id_ad, - ARRAY_SIZE(node_id_ad), NULL, 0); + err = bt_mesh_adv_gatt_start(&fast_adv_param, duration, node_id_ad, + ARRAY_SIZE(node_id_ad), NULL, 0); if (err) { BT_WARN("Failed to advertise using Node ID (err %d)", 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); - err = bt_mesh_adv_start(&slow_adv_param, duration, net_id_ad, - ARRAY_SIZE(net_id_ad), NULL, 0); + err = bt_mesh_adv_gatt_start(&slow_adv_param, duration, net_id_ad, + ARRAY_SIZE(net_id_ad), NULL, 0); if (err) { BT_WARN("Failed to advertise using Network ID (err %d)", 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 */ if (conn_count < CONFIG_BT_MAX_CONN) { - bt_mesh_adv_update(); + bt_mesh_adv_gatt_update(); } } diff --git a/subsys/bluetooth/mesh/subnet.c b/subsys/bluetooth/mesh/subnet.c index 04b8e8a6744..c9469929b79 100644 --- a/subsys/bluetooth/mesh/subnet.c +++ b/subsys/bluetooth/mesh/subnet.c @@ -538,7 +538,7 @@ uint8_t bt_mesh_subnet_node_id_set(uint16_t net_idx, bt_mesh_proxy_identity_stop(sub); } - bt_mesh_adv_update(); + bt_mesh_adv_gatt_update(); return STATUS_SUCCESS; }