From 6af721e8e4a221b5e3e87f15fef90035c16ed6df Mon Sep 17 00:00:00 2001 From: Anton Maklakov Date: Wed, 29 Aug 2018 00:54:41 +0700 Subject: [PATCH] examples/bluetooth: Fix incompatible cast --- .../main/example_spp_vfs_acceptor_demo.c | 7 +++++-- .../main/example_spp_vfs_initiator_demo.c | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/examples/bluetooth/bt_spp_vfs_acceptor/main/example_spp_vfs_acceptor_demo.c b/examples/bluetooth/bt_spp_vfs_acceptor/main/example_spp_vfs_acceptor_demo.c index 51c23c094e..f14d394484 100644 --- a/examples/bluetooth/bt_spp_vfs_acceptor/main/example_spp_vfs_acceptor_demo.c +++ b/examples/bluetooth/bt_spp_vfs_acceptor/main/example_spp_vfs_acceptor_demo.c @@ -67,8 +67,11 @@ static void spp_read_handle(void * param) spp_wr_task_shut_down(); } -static void esp_spp_cb(esp_spp_cb_event_t event, esp_spp_cb_param_t *param) +static void esp_spp_cb(uint16_t e, void *p) { + esp_spp_cb_event_t event = e; + esp_spp_cb_param_t *param = p; + switch (event) { case ESP_SPP_INIT_EVT: ESP_LOGI(SPP_TAG, "ESP_SPP_INIT_EVT"); @@ -102,7 +105,7 @@ static void esp_spp_cb(esp_spp_cb_event_t event, esp_spp_cb_param_t *param) static void esp_spp_stack_cb(esp_spp_cb_event_t event, esp_spp_cb_param_t *param) { - spp_task_work_dispatch((spp_task_cb_t)esp_spp_cb, event, param, sizeof(esp_spp_cb_param_t), NULL); + spp_task_work_dispatch(esp_spp_cb, event, param, sizeof(esp_spp_cb_param_t), NULL); } void esp_bt_gap_cb(esp_bt_gap_cb_event_t event, esp_bt_gap_cb_param_t *param) diff --git a/examples/bluetooth/bt_spp_vfs_initiator/main/example_spp_vfs_initiator_demo.c b/examples/bluetooth/bt_spp_vfs_initiator/main/example_spp_vfs_initiator_demo.c index f5ef880a7b..fa144215ef 100644 --- a/examples/bluetooth/bt_spp_vfs_initiator/main/example_spp_vfs_initiator_demo.c +++ b/examples/bluetooth/bt_spp_vfs_initiator/main/example_spp_vfs_initiator_demo.c @@ -105,8 +105,11 @@ static bool get_name_from_eir(uint8_t *eir, char *bdname, uint8_t *bdname_len) return false; } -static void esp_spp_cb(esp_spp_cb_event_t event, esp_spp_cb_param_t *param) +static void esp_spp_cb(uint16_t e, void *p) { + esp_spp_cb_event_t event = e; + esp_spp_cb_param_t *param = p; + switch (event) { case ESP_SPP_INIT_EVT: ESP_LOGI(SPP_TAG, "ESP_SPP_INIT_EVT"); @@ -198,7 +201,7 @@ static void esp_bt_gap_cb(esp_bt_gap_cb_event_t event, esp_bt_gap_cb_param_t *pa static void esp_spp_stack_cb(esp_spp_cb_event_t event, esp_spp_cb_param_t *param) { - spp_task_work_dispatch((spp_task_cb_t)esp_spp_cb, event, param, sizeof(esp_spp_cb_param_t), NULL); + spp_task_work_dispatch(esp_spp_cb, event, param, sizeof(esp_spp_cb_param_t), NULL); } void app_main()