-
Notifications
You must be signed in to change notification settings - Fork 33
Bugfix/fix bluetooth bt tool adv moudle cb change to const #435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
102bb26
3a22964
c720266
87e380a
23b4b65
c18022b
b784126
94557a9
620988d
1e6f503
cb1ca15
ed8fc42
52fa65c
acd98bd
8cbc23d
4f8316b
866dc40
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -107,7 +107,10 @@ static enum bt_security_err zblue_on_pairing_accept(struct bt_conn* conn, const | |
| static void zblue_register_callback(void); | ||
| static void zblue_unregister_callback(void); | ||
|
|
||
| static struct bt_conn_cb g_conn_cbs = { | ||
| static le_conn_info_t* le_conn_add(const bt_address_t* addr); | ||
| static le_conn_info_t* le_conn_find(const bt_address_t* addr); | ||
|
|
||
| static const struct bt_conn_cb g_conn_cbs = { | ||
| .connected = zblue_on_connected, | ||
| .disconnected = zblue_on_disconnected, | ||
| #ifdef CONFIG_BT_SMP | ||
|
|
@@ -119,15 +122,15 @@ static struct bt_conn_cb g_conn_cbs = { | |
| #endif | ||
| }; | ||
|
|
||
| static struct bt_conn_auth_info_cb g_conn_auth_info_cbs = { | ||
| static const struct bt_conn_auth_info_cb g_conn_auth_info_cbs = { | ||
| .pairing_complete_ctkd = zblue_on_pairing_complete_ctkd, | ||
| .pairing_complete = zblue_on_pairing_complete, | ||
| .pairing_failed = zblue_on_pairing_failed, | ||
| .bond_deleted = zblue_on_bond_deleted, | ||
| }; | ||
|
|
||
| #if defined(CONFIG_SETTINGS_ZBLUE) | ||
| static struct bt_settings_zblue_cb g_setting_cbs = { | ||
| static const struct bt_settings_zblue_cb g_setting_cbs = { | ||
| .irk_notify = zblue_on_irk_notify, | ||
| .irk_load = zblue_on_irk_load, | ||
| .ltk_notify = zblue_on_ltk_notify, | ||
|
|
@@ -758,22 +761,22 @@ static void zblue_on_bond_deleted(uint8_t id, const bt_addr_le_t* peer) | |
|
|
||
| static void zblue_register_callback(void) | ||
| { | ||
| bt_conn_cb_register(&g_conn_cbs); | ||
| bt_conn_cb_register((struct bt_conn_cb *)&g_conn_cbs); | ||
|
||
| #ifdef CONFIG_BT_SMP | ||
| bt_conn_le_auth_cb_register(&g_conn_auth_cbs); | ||
| bt_conn_auth_info_cb_register(&g_conn_auth_info_cbs); | ||
| bt_conn_le_auth_cb_register((struct bt_conn_auth_cb *)&g_conn_auth_cbs); | ||
| bt_conn_auth_info_cb_register((struct bt_conn_auth_info_cb *)&g_conn_auth_info_cbs); | ||
| #endif | ||
| #ifdef CONFIG_SETTINGS_ZBLUE | ||
| bt_setting_cb_register(&g_setting_cbs); | ||
| bt_setting_cb_register((struct bt_settings_zblue_cb *)&g_setting_cbs); | ||
| #endif | ||
| } | ||
|
|
||
| static void zblue_unregister_callback(void) | ||
| { | ||
| bt_conn_cb_unregister(&g_conn_cbs); | ||
| bt_conn_cb_unregister((struct bt_conn_cb *)&g_conn_cbs); | ||
| #ifdef CONFIG_BT_SMP | ||
| bt_conn_le_auth_cb_register(NULL); | ||
| bt_conn_auth_info_cb_unregister(&g_conn_auth_info_cbs); | ||
| bt_conn_auth_info_cb_unregister((struct bt_conn_auth_info_cb *)&g_conn_auth_info_cbs); | ||
| #endif | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cast to non-const pointer is unnecessary. The function signature for scanner_start_scan already accepts
const scanner_callbacks_t*as seen in scan_manager.h. Remove the cast and pass&g_scanner_socket_cbdirectly without casting.