From db09c08d745c978bc51e1abcf0215f8727d1e684 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 9 May 2022 21:47:14 +0200 Subject: [PATCH] platform/daemon: avoid HCI_EVENT_IS_COMMAND_COMPLETE macro --- platform/daemon/example/inquiry.c | 4 ++-- platform/daemon/example/l2cap_server.c | 2 +- platform/daemon/example/l2cap_throughput.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/daemon/example/inquiry.c b/platform/daemon/example/inquiry.c index 435123466..623de9086 100644 --- a/platform/daemon/example/inquiry.c +++ b/platform/daemon/example/inquiry.c @@ -135,13 +135,13 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe case W4_INQUIRY_MODE_COMPLETE: switch(event){ case HCI_EVENT_COMMAND_COMPLETE: - if (HCI_EVENT_IS_COMMAND_COMPLETE(packet, hci_write_inquiry_mode)) { + if (hci_event_command_complete_get_command_opcode(packet) == HCI_OPCODE_HCI_WRITE_INQUIRY_MODE){ start_scan(); state = ACTIVE; } break; case HCI_EVENT_COMMAND_STATUS: - if (HCI_EVENT_IS_COMMAND_STATUS(packet, hci_write_inquiry_mode)) { + if (hci_event_command_complete_get_command_opcode(packet) == HCI_OPCODE_HCI_WRITE_INQUIRY_MODE){ printf("Ignoring error (0x%x) from hci_write_inquiry_mode.\n", packet[2]); start_scan(); state = ACTIVE; diff --git a/platform/daemon/example/l2cap_server.c b/platform/daemon/example/l2cap_server.c index 393f0c7d6..2e5f41a42 100644 --- a/platform/daemon/example/l2cap_server.c +++ b/platform/daemon/example/l2cap_server.c @@ -191,7 +191,7 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint break; case HCI_EVENT_COMMAND_COMPLETE: - if (HCI_EVENT_IS_COMMAND_COMPLETE(packet, hci_write_class_of_device)) { + if (hci_event_command_complete_get_command_opcode(packet) == HCI_OPCODE_HCI_WRITE_CLASS_OF_DEVICE){ printf("Ready\n"); } default: diff --git a/platform/daemon/example/l2cap_throughput.c b/platform/daemon/example/l2cap_throughput.c index 32479cbea..0f44a8a1f 100644 --- a/platform/daemon/example/l2cap_throughput.c +++ b/platform/daemon/example/l2cap_throughput.c @@ -124,7 +124,7 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint case HCI_EVENT_COMMAND_COMPLETE: // use pairing yes/no - if (HCI_EVENT_IS_COMMAND_COMPLETE(packet, hci_write_class_of_device)) { + if (hci_event_command_complete_get_command_opcode(packet) == HCI_OPCODE_HCI_WRITE_CLASS_OF_DEVICE){ bt_send_cmd(&l2cap_create_channel_mtu_cmd, addr, PSM_TEST, PACKET_SIZE); } break;