From f8f6a918bd501369bc24dad53ba7cb5610239083 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 31 Mar 2016 23:37:33 +0200 Subject: [PATCH] events: RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE -> RFCOMM_EVENT_CHANNEL_OPENED --- doc/manual/docs/appendix/events_errors.md | 6 ++--- doc/manual/docs/protocols.md | 6 ++--- example/hfp_ag_demo.c | 8 +++---- example/hfp_hf_demo.c | 4 ++-- example/spp_and_le_counter.c | 2 +- example/spp_counter.c | 6 ++--- example/spp_flowcontrol.c | 2 +- example/spp_streamer.c | 2 +- platform/daemon/example/rfcomm_cat.c | 2 +- platform/daemon/example/rfcomm_echo.c | 2 +- platform/daemon/example/rfcomm_test.c | 2 +- platform/daemon/src/daemon.c | 4 ++-- port/ez430-rf2560/example/ant_test.c | 2 +- port/ez430-rf2560/example/spp_accel.c | 2 +- .../example/ant_test.c | 2 +- .../example/spp_accel.c | 2 +- src/btstack_defines.h | 2 +- src/btstack_event.h | 24 +++++++++---------- src/classic/hfp.c | 6 ++--- src/classic/hsp_ag.c | 4 ++-- src/classic/hsp_hs.c | 4 ++-- src/classic/rfcomm.c | 4 ++-- test/hfp/hfp_ag_client_test.c | 4 ++-- test/hfp/mock.c | 4 ++-- test/pts/classic_test.c | 2 +- test/pts/hfp_ag_test.c | 8 +++---- test/pts/hfp_hf_test.c | 4 ++-- test/pts/hfp_test.c | 4 ++-- tool/migration_to_v1.0/migration.sed | 1 + 29 files changed, 63 insertions(+), 62 deletions(-) diff --git a/doc/manual/docs/appendix/events_errors.md b/doc/manual/docs/appendix/events_errors.md index 3f9ee1e87..8c8565221 100644 --- a/doc/manual/docs/appendix/events_errors.md +++ b/doc/manual/docs/appendix/events_errors.md @@ -70,7 +70,7 @@ by RFCOMM: - RFCOMM_EVENT_CHANNEL_CLOSED - emitted when channel is closed. No status information is provided. -- RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE - sent if channel +- RFCOMM_EVENT_CHANNEL_OPENED - sent if channel establishment is done. Status not equal zero indicates an error. Possible errors: an L2CAP error, out of memory. @@ -87,7 +87,7 @@ by RFCOMM: Event | Event Code -----------|----------------------------- -RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE | 0x80 +RFCOMM_EVENT_CHANNEL_OPENED | 0x80 RFCOMM_EVENT_CHANNEL_CLOSED | 0x81 RFCOMM_EVENT_INCOMING_CONNECTION | 0x82 RFCOMM_EVENT_CREDITS | 0x84 @@ -98,7 +98,7 @@ Table: RFCOMM Events. {#tbl:rfcommEvents} RFCOMM event paramaters, with size in bits: -- RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE: +- RFCOMM_EVENT_CHANNEL_OPENED: - *event(8), len(8), status(8), address(48), handle(16), server_channel(8), rfcomm_cid(16), max_frame_size(16)* - RFCOMM_EVENT_CHANNEL_CLOSED: - *event(8), len(8), rfcomm_cid(16)* diff --git a/doc/manual/docs/protocols.md b/doc/manual/docs/protocols.md index 051ec2255..69e907279 100644 --- a/doc/manual/docs/protocols.md +++ b/doc/manual/docs/protocols.md @@ -347,7 +347,7 @@ see Section [on manual credit assignement](#sec:manualCreditsProtocols). The packet handler that is given as an input parameter of the RFCOMM create channel function will be assigned to the new outgoing channel. -This handler receives the RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE and +This handler receives the RFCOMM_EVENT_CHANNEL_OPENED and RFCOMM_EVENT_CHANNEL_CLOSED events, and RFCOMM data packets, as shown in Listing [below](#lst:RFCOMMremoteService). @@ -358,7 +358,7 @@ Listing [below](#lst:RFCOMMremoteService). switch (packet_type){ case HCI_EVENT_PACKET: switch (hci_event_packet_get_type(packet)){ - case RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE: + case RFCOMM_EVENT_CHANNEL_OPENED: if (rfcomm_event_open_channel_complete_get_status(packet)) { printf("Connection failed\n\r"); } else { @@ -415,7 +415,7 @@ Listing [below](#lst:RFCOMMService) provides the RFCOMM service example code. rfcomm_channel_id = rfcomm_event_incoming_connection_get_rfcomm_cid(packet); rfcomm_accept_connection(rfcomm_channel_id); break; - case RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE: + case RFCOMM_EVENT_CHANNEL_OPENED: if (rfcomm_event_open_channel_complete_get_status(packet)){ printf("RFCOMM channel open failed."); break; diff --git a/example/hfp_ag_demo.c b/example/hfp_ag_demo.c index 3b97fb92b..64cb96d3e 100644 --- a/example/hfp_ag_demo.c +++ b/example/hfp_ag_demo.c @@ -549,16 +549,16 @@ static void stdin_process(btstack_data_source_t *ds, btstack_data_source_callbac static void packet_handler(uint8_t * event, uint16_t event_size){ - if (event[0] == RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE){ + if (event[0] == RFCOMM_EVENT_CHANNEL_OPENED){ handle = little_endian_read_16(event, 9); - printf("RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE received for handle 0x%04x\n", handle); + printf("RFCOMM_EVENT_CHANNEL_OPENED received for handle 0x%04x\n", handle); return; } switch (event[0]){ - case RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE: + case RFCOMM_EVENT_CHANNEL_OPENED: handle = little_endian_read_16(event, 9); - printf("RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE received for handle 0x%04x\n", handle); + printf("RFCOMM_EVENT_CHANNEL_OPENED received for handle 0x%04x\n", handle); return; case HCI_EVENT_INQUIRY_RESULT: diff --git a/example/hfp_hf_demo.c b/example/hfp_hf_demo.c index 23202f823..2737446f8 100644 --- a/example/hfp_hf_demo.c +++ b/example/hfp_hf_demo.c @@ -445,9 +445,9 @@ static void stdin_process(btstack_data_source_t *ds, btstack_data_source_callbac #endif static void packet_handler(uint8_t * event, uint16_t event_size){ - if (event[0] == RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE){ + if (event[0] == RFCOMM_EVENT_CHANNEL_OPENED){ handle = little_endian_read_16(event, 9); - printf("RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE received for handle 0x%04x\n", handle); + printf("RFCOMM_EVENT_CHANNEL_OPENED received for handle 0x%04x\n", handle); return; } if (event[0] != HCI_EVENT_HFP_META) return; diff --git a/example/spp_and_le_counter.c b/example/spp_and_le_counter.c index b53253018..27f401c97 100644 --- a/example/spp_and_le_counter.c +++ b/example/spp_and_le_counter.c @@ -129,7 +129,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack rfcomm_accept_connection(rfcomm_channel_id); break; - case RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE: + case RFCOMM_EVENT_CHANNEL_OPENED: // data: event(8), len(8), status (8), address (48), server channel(8), rfcomm_cid(16), max frame size(16) if (packet[2]) { printf("RFCOMM channel open failed, status %u\n", packet[2]); diff --git a/example/spp_counter.c b/example/spp_counter.c index 69a9f471c..0d4855184 100644 --- a/example/spp_counter.c +++ b/example/spp_counter.c @@ -141,7 +141,7 @@ static void one_shot_timer_setup(void){ * - HCI_EVENT_PIN_CODE_REQUEST (Standard pairing) or * - HCI_EVENT_USER_CONFIRMATION_REQUEST (Secure Simple Pairing), * - RFCOMM_EVENT_INCOMING_CONNECTION, - * - RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE, and + * - RFCOMM_EVENT_CHANNEL_OPENED, and * - RFCOMM_EVENT_CHANNEL_CLOSED */ @@ -158,7 +158,7 @@ static void one_shot_timer_setup(void){ * channel number used during the SPP setup phase and the newly assigned RFCOMM * channel ID that is used by all BTstack commands and events. * - * If RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE event returns status greater then 0, + * If RFCOMM_EVENT_CHANNEL_OPENED event returns status greater then 0, * then the channel establishment has failed (rare case, e.g., client crashes). * On successful connection, the RFCOMM channel ID and MTU for this * channel are made available to the heartbeat counter. After opening the RFCOMM channel, @@ -208,7 +208,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack rfcomm_accept_connection(rfcomm_channel_id); break; - case RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE: + case RFCOMM_EVENT_CHANNEL_OPENED: // data: event(8), len(8), status (8), address (48), server channel(8), rfcomm_cid(16), max frame size(16) if (packet[2]) { printf("RFCOMM channel open failed, status %u\n", packet[2]); diff --git a/example/spp_flowcontrol.c b/example/spp_flowcontrol.c index 712f48a60..2247d2803 100644 --- a/example/spp_flowcontrol.c +++ b/example/spp_flowcontrol.c @@ -175,7 +175,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack rfcomm_accept_connection(rfcomm_channel_id); break; - case RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE: + case RFCOMM_EVENT_CHANNEL_OPENED: // data: event(8), len(8), status (8), address (48), server channel(8), rfcomm_cid(16), max frame size(16) if (packet[2]) { printf("RFCOMM channel open failed, status %u\n\r", packet[2]); diff --git a/example/spp_streamer.c b/example/spp_streamer.c index a35313642..ca6077a6e 100644 --- a/example/spp_streamer.c +++ b/example/spp_streamer.c @@ -160,7 +160,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack sdp_client_query_rfcomm_channel_and_name_for_uuid(&handle_query_rfcomm_event, remote, SDP_PublicBrowseGroup); } break; - case RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE: + case RFCOMM_EVENT_CHANNEL_OPENED: // data: event(8), len(8), status (8), address (48), handle(16), server channel(8), rfcomm_cid(16), max frame size(16) if (packet[2]) { state = DONE; diff --git a/platform/daemon/example/rfcomm_cat.c b/platform/daemon/example/rfcomm_cat.c index 9ccbcda72..450fbcb47 100644 --- a/platform/daemon/example/rfcomm_cat.c +++ b/platform/daemon/example/rfcomm_cat.c @@ -99,7 +99,7 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint bt_send_cmd(&hci_pin_code_request_reply, &event_addr, 4, "0000"); break; - case RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE: + case RFCOMM_EVENT_CHANNEL_OPENED: // data: event(8), len(8), status (8), address (48), handle(16), server channel(8), rfcomm_cid(16), max frame size(16) if (packet[2]) { printf("RFCOMM channel open failed, status %u\n", packet[2]); diff --git a/platform/daemon/example/rfcomm_echo.c b/platform/daemon/example/rfcomm_echo.c index 9f42cd5d3..274d445e9 100644 --- a/platform/daemon/example/rfcomm_echo.c +++ b/platform/daemon/example/rfcomm_echo.c @@ -125,7 +125,7 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint bt_send_cmd(&rfcomm_accept_connection_cmd, rfcomm_channel_id); break; - case RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE: + case RFCOMM_EVENT_CHANNEL_OPENED: // data: event(8), len(8), status (8), address (48), handle(16), server channel(8), rfcomm_cid(16), max frame size(16) if (packet[2]) { printf("RFCOMM channel open failed, status %u\n", packet[2]); diff --git a/platform/daemon/example/rfcomm_test.c b/platform/daemon/example/rfcomm_test.c index 0ed5267d2..0fc1ee23a 100644 --- a/platform/daemon/example/rfcomm_test.c +++ b/platform/daemon/example/rfcomm_test.c @@ -146,7 +146,7 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint bt_send_cmd(&rfcomm_accept_connection_cmd, rfcomm_channel_id); break; - case RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE: + case RFCOMM_EVENT_CHANNEL_OPENED: // data: event(8), len(8), status (8), address (48), handle(16), server channel(8), rfcomm_cid(16), max frame size(16) if (packet[2]) { printf("RFCOMM channel open failed, status %u\n", packet[2]); diff --git a/platform/daemon/src/daemon.c b/platform/daemon/src/daemon.c index 2b71256ea..093a3eada 100644 --- a/platform/daemon/src/daemon.c +++ b/platform/daemon/src/daemon.c @@ -747,7 +747,7 @@ static void send_rfcomm_create_channel_failed(void * connection, bd_addr_t addr, uint8_t event[16]; memset(event, 0, sizeof(event)); uint8_t pos = 0; - event[pos++] = RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE; + event[pos++] = RFCOMM_EVENT_CHANNEL_OPENED; event[pos++] = sizeof(event) - 2; event[pos++] = status; reverse_bd_addr(addr, &event[pos]); pos += 6; @@ -1554,7 +1554,7 @@ static void daemon_packet_handler(void * connection, uint8_t packet_type, uint16 daemon_retry_parked(); break; - case RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE: + case RFCOMM_EVENT_CHANNEL_OPENED: cid = little_endian_read_16(packet, 13); connection = connection_for_rfcomm_cid(cid); if (!connection) break; diff --git a/port/ez430-rf2560/example/ant_test.c b/port/ez430-rf2560/example/ant_test.c index 204e6fdb9..288b7fa3e 100644 --- a/port/ez430-rf2560/example/ant_test.c +++ b/port/ez430-rf2560/example/ant_test.c @@ -133,7 +133,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack rfcomm_accept_connection(rfcomm_channel_id); break; - case RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE: + case RFCOMM_EVENT_CHANNEL_OPENED: // data: event(8), len(8), status (8), address (48), server channel(8), rfcomm_cid(16), max frame size(16) if (packet[2]) { printf("RFCOMM channel open failed, status %u\n\r", packet[2]); diff --git a/port/ez430-rf2560/example/spp_accel.c b/port/ez430-rf2560/example/spp_accel.c index d80a54ea3..272432b75 100644 --- a/port/ez430-rf2560/example/spp_accel.c +++ b/port/ez430-rf2560/example/spp_accel.c @@ -169,7 +169,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack rfcomm_accept_connection(rfcomm_channel_id); break; - case RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE: + case RFCOMM_EVENT_CHANNEL_OPENED: // data: event(8), len(8), status (8), address (48), server channel(8), rfcomm_cid(16), max frame size(16) if (packet[2]) { printf("RFCOMM channel open failed, status %u\n\r", packet[2]); diff --git a/port/msp-exp430f5438-cc2564b/example/ant_test.c b/port/msp-exp430f5438-cc2564b/example/ant_test.c index b13226db5..27852b674 100644 --- a/port/msp-exp430f5438-cc2564b/example/ant_test.c +++ b/port/msp-exp430f5438-cc2564b/example/ant_test.c @@ -132,7 +132,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack rfcomm_accept_connection(rfcomm_channel_id); break; - case RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE: + case RFCOMM_EVENT_CHANNEL_OPENED: // data: event(8), len(8), status (8), address (48), server channel(8), rfcomm_cid(16), max frame size(16) if (packet[2]) { printf("RFCOMM channel open failed, status %u\n\r", packet[2]); diff --git a/port/msp-exp430f5438-cc2564b/example/spp_accel.c b/port/msp-exp430f5438-cc2564b/example/spp_accel.c index e4aa58d2b..2fab5e519 100644 --- a/port/msp-exp430f5438-cc2564b/example/spp_accel.c +++ b/port/msp-exp430f5438-cc2564b/example/spp_accel.c @@ -170,7 +170,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack rfcomm_accept_connection(rfcomm_channel_id); break; - case RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE: + case RFCOMM_EVENT_CHANNEL_OPENED: // data: event(8), len(8), status (8), address (48), server channel(8), rfcomm_cid(16), max frame size(16) if (packet[2]) { printf("RFCOMM channel open failed, status %u\n\r", packet[2]); diff --git a/src/btstack_defines.h b/src/btstack_defines.h index f170feece..33c08eae1 100644 --- a/src/btstack_defines.h +++ b/src/btstack_defines.h @@ -406,7 +406,7 @@ typedef uint8_t sm_key_t[16]; * @param rfcomm_cid * @param max_frame_size */ -#define RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE 0x80 +#define RFCOMM_EVENT_CHANNEL_OPENED 0x80 /** * @format 2 diff --git a/src/btstack_event.h b/src/btstack_event.h index e8731d3cb..5c37da4bd 100644 --- a/src/btstack_event.h +++ b/src/btstack_event.h @@ -978,57 +978,57 @@ static inline uint16_t l2cap_event_can_send_now_get_local_cid(const uint8_t * ev } /** - * @brief Get field status from event rfcomm_event_open_channel_complete + * @brief Get field status from event rfcomm_event_channel_opened * @param event packet * @return status * @note: btstack_type 1 */ -static inline uint8_t rfcomm_event_open_channel_complete_get_status(const uint8_t * event){ +static inline uint8_t rfcomm_event_channel_opened_get_status(const uint8_t * event){ return event[2]; } /** - * @brief Get field bd_addr from event rfcomm_event_open_channel_complete + * @brief Get field bd_addr from event rfcomm_event_channel_opened * @param event packet * @param Pointer to storage for bd_addr * @note: btstack_type B */ -static inline void rfcomm_event_open_channel_complete_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ +static inline void rfcomm_event_channel_opened_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ reverse_bd_addr(&event[3], bd_addr); } /** - * @brief Get field con_handle from event rfcomm_event_open_channel_complete + * @brief Get field con_handle from event rfcomm_event_channel_opened * @param event packet * @return con_handle * @note: btstack_type 2 */ -static inline uint16_t rfcomm_event_open_channel_complete_get_con_handle(const uint8_t * event){ +static inline uint16_t rfcomm_event_channel_opened_get_con_handle(const uint8_t * event){ return little_endian_read_16(event, 9); } /** - * @brief Get field server_channel from event rfcomm_event_open_channel_complete + * @brief Get field server_channel from event rfcomm_event_channel_opened * @param event packet * @return server_channel * @note: btstack_type 1 */ -static inline uint8_t rfcomm_event_open_channel_complete_get_server_channel(const uint8_t * event){ +static inline uint8_t rfcomm_event_channel_opened_get_server_channel(const uint8_t * event){ return event[11]; } /** - * @brief Get field rfcomm_cid from event rfcomm_event_open_channel_complete + * @brief Get field rfcomm_cid from event rfcomm_event_channel_opened * @param event packet * @return rfcomm_cid * @note: btstack_type 2 */ -static inline uint16_t rfcomm_event_open_channel_complete_get_rfcomm_cid(const uint8_t * event){ +static inline uint16_t rfcomm_event_channel_opened_get_rfcomm_cid(const uint8_t * event){ return little_endian_read_16(event, 12); } /** - * @brief Get field max_frame_size from event rfcomm_event_open_channel_complete + * @brief Get field max_frame_size from event rfcomm_event_channel_opened * @param event packet * @return max_frame_size * @note: btstack_type 2 */ -static inline uint16_t rfcomm_event_open_channel_complete_get_max_frame_size(const uint8_t * event){ +static inline uint16_t rfcomm_event_channel_opened_get_max_frame_size(const uint8_t * event){ return little_endian_read_16(event, 14); } diff --git a/src/classic/hfp.c b/src/classic/hfp.c index 83c4e9b50..31e3ecfdd 100644 --- a/src/classic/hfp.c +++ b/src/classic/hfp.c @@ -463,9 +463,9 @@ void hfp_handle_hci_event(uint8_t packet_type, uint8_t *packet, uint16_t size){ rfcomm_accept_connection(hfp_connection->rfcomm_cid); break; - case RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE: + case RFCOMM_EVENT_CHANNEL_OPENED: // data: event(8), len(8), status (8), address (48), handle(16), server channel(8), rfcomm_cid(16), max frame size(16) - printf("RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE packet_handler type %u, size %u\n", packet_type, size); + printf("RFCOMM_EVENT_CHANNEL_OPENED packet_handler type %u, size %u\n", packet_type, size); reverse_bd_addr(&packet[3], event_addr); hfp_connection = get_hfp_connection_context_for_bd_addr(event_addr); @@ -476,7 +476,7 @@ void hfp_handle_hci_event(uint8_t packet_type, uint8_t *packet, uint16_t size){ remove_hfp_connection_context(hfp_connection); } else { hfp_connection->acl_handle = little_endian_read_16(packet, 9); - printf("RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE con_handle 0x%02x\n", hfp_connection->acl_handle); + printf("RFCOMM_EVENT_CHANNEL_OPENED con_handle 0x%02x\n", hfp_connection->acl_handle); hfp_connection->rfcomm_cid = little_endian_read_16(packet, 12); uint16_t mtu = little_endian_read_16(packet, 14); diff --git a/src/classic/hsp_ag.c b/src/classic/hsp_ag.c index ca19ba204..b177256da 100644 --- a/src/classic/hsp_ag.c +++ b/src/classic/hsp_ag.c @@ -611,8 +611,8 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack rfcomm_accept_connection(rfcomm_cid); break; - case RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE: - log_info("RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE packet_handler type %u, packet[0] %x", packet_type, packet[0]); + case RFCOMM_EVENT_CHANNEL_OPENED: + log_info("RFCOMM_EVENT_CHANNEL_OPENED packet_handler type %u, packet[0] %x", packet_type, packet[0]); // data: event(8), len(8), status (8), address (48), handle(16), server channel(8), rfcomm_cid(16), max frame size(16) if (packet[2]) { log_info("RFCOMM channel open failed, status %u§", packet[2]); diff --git a/src/classic/hsp_hs.c b/src/classic/hsp_hs.c index 8bc39db3f..c35e9df36 100644 --- a/src/classic/hsp_hs.c +++ b/src/classic/hsp_hs.c @@ -532,8 +532,8 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack rfcomm_accept_connection(rfcomm_cid); break; - case RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE: - // printf("RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE packet_handler type %u, packet[0] %x\n", packet_type, packet[0]); + case RFCOMM_EVENT_CHANNEL_OPENED: + // printf("RFCOMM_EVENT_CHANNEL_OPENED packet_handler type %u, packet[0] %x\n", packet_type, packet[0]); // data: event(8), len(8), status (8), address (48), handle(16), server channel(8), rfcomm_cid(16), max frame size(16) if (hsp_state != HSP_W4_RFCOMM_CONNECTED) return; if (packet[2]) { diff --git a/src/classic/rfcomm.c b/src/classic/rfcomm.c index 5470aef5c..8d09415cd 100644 --- a/src/classic/rfcomm.c +++ b/src/classic/rfcomm.c @@ -160,12 +160,12 @@ static void rfcomm_emit_connection_request(rfcomm_channel_t *channel) { // next Cydia release will use SVN version of this // data: event(8), len(8), status (8), address (48), handle (16), server channel(8), rfcomm_cid(16), max frame size(16) static void rfcomm_emit_channel_opened(rfcomm_channel_t *channel, uint8_t status) { - log_info("RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE status 0x%x addr %s handle 0x%x channel #%u cid 0x%02x mtu %u", + log_info("RFCOMM_EVENT_CHANNEL_OPENED status 0x%x addr %s handle 0x%x channel #%u cid 0x%02x mtu %u", status, bd_addr_to_str(channel->multiplexer->remote_addr), channel->multiplexer->con_handle, channel->dlci>>1, channel->rfcomm_cid, channel->max_frame_size); uint8_t event[16]; uint8_t pos = 0; - event[pos++] = RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE; // 0 + event[pos++] = RFCOMM_EVENT_CHANNEL_OPENED; // 0 event[pos++] = sizeof(event) - 2; // 1 event[pos++] = status; // 2 reverse_bd_addr(channel->multiplexer->remote_addr, &event[pos]); pos += 6; // 3 diff --git a/test/hfp/hfp_ag_client_test.c b/test/hfp/hfp_ag_client_test.c index 88f67e110..4f41ca8c7 100644 --- a/test/hfp/hfp_ag_client_test.c +++ b/test/hfp/hfp_ag_client_test.c @@ -349,9 +349,9 @@ static void simulate_test_sequence(hfp_test_item_t * test_item){ } void packet_handler(uint8_t * event, uint16_t event_size){ - if (event[0] == RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE){ + if (event[0] == RFCOMM_EVENT_CHANNEL_OPENED){ handle = little_endian_read_16(event, 9); - printf("RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE received for handle 0x%04x\n", handle); + printf("RFCOMM_EVENT_CHANNEL_OPENED received for handle 0x%04x\n", handle); return; } diff --git a/test/hfp/mock.c b/test/hfp/mock.c index 64b43bf16..d925136c1 100644 --- a/test/hfp/mock.c +++ b/test/hfp/mock.c @@ -226,10 +226,10 @@ void sdp_client_query_rfcomm_channel_and_name_for_uuid(btstack_packet_handler_t uint8_t rfcomm_create_channel(btstack_packet_handler_t handler, bd_addr_t addr, uint8_t channel, uint16_t * out_cid){ - // RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE + // RFCOMM_EVENT_CHANNEL_OPENED uint8_t event[16]; uint8_t pos = 0; - event[pos++] = RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE; + event[pos++] = RFCOMM_EVENT_CHANNEL_OPENED; event[pos++] = sizeof(event) - 2; event[pos++] = 0; diff --git a/test/pts/classic_test.c b/test/pts/classic_test.c index d20735832..faa416071 100644 --- a/test/pts/classic_test.c +++ b/test/pts/classic_test.c @@ -355,7 +355,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack rfcomm_accept_connection(rfcomm_channel_id); break; - case RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE: + case RFCOMM_EVENT_CHANNEL_OPENED: // data: event(8), len(8), status (8), address (48), server channel(8), rfcomm_cid(16), max frame size(16) if (packet[2]) { printf("RFCOMM channel open failed, status %u\n\r", packet[2]); diff --git a/test/pts/hfp_ag_test.c b/test/pts/hfp_ag_test.c index e31e22310..8d7d84ed8 100644 --- a/test/pts/hfp_ag_test.c +++ b/test/pts/hfp_ag_test.c @@ -570,16 +570,16 @@ static int stdin_process(btstack_data_source_t *ds){ static void packet_handler(uint8_t * event, uint16_t event_size){ - if (event[0] == RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE){ + if (event[0] == RFCOMM_EVENT_CHANNEL_OPENED){ handle = little_endian_read_16(event, 9); - printf("RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE received for handle 0x%04x\n", handle); + printf("RFCOMM_EVENT_CHANNEL_OPENED received for handle 0x%04x\n", handle); return; } switch (event[0]){ - case RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE: + case RFCOMM_EVENT_CHANNEL_OPENED: handle = little_endian_read_16(event, 9); - printf("RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE received for handle 0x%04x\n", handle); + printf("RFCOMM_EVENT_CHANNEL_OPENED received for handle 0x%04x\n", handle); return; case HCI_EVENT_INQUIRY_RESULT: diff --git a/test/pts/hfp_hf_test.c b/test/pts/hfp_hf_test.c index 39cc1ed38..eada5aab4 100644 --- a/test/pts/hfp_hf_test.c +++ b/test/pts/hfp_hf_test.c @@ -461,9 +461,9 @@ static int stdin_process(btstack_data_source_t *ds){ static void packet_handler(uint8_t * event, uint16_t event_size){ - if (event[0] == RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE){ + if (event[0] == RFCOMM_EVENT_CHANNEL_OPENED){ handle = little_endian_read_16(event, 9); - printf("RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE received for handle 0x%04x\n", handle); + printf("RFCOMM_EVENT_CHANNEL_OPENED received for handle 0x%04x\n", handle); return; } if (event[0] != HCI_EVENT_HFP_META) return; diff --git a/test/pts/hfp_test.c b/test/pts/hfp_test.c index 09d5b866d..d7dc1776a 100644 --- a/test/pts/hfp_test.c +++ b/test/pts/hfp_test.c @@ -118,8 +118,8 @@ static void packet_handler(void * connection, uint8_t packet_type, uint16_t chan hci_send_cmd(&hci_pin_code_request_reply, &event_addr, 4, "0000"); break; - case RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE: - printf("RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE packet_handler type %u, packet[0] %x\n", packet_type, packet[0]); + case RFCOMM_EVENT_CHANNEL_OPENED: + printf("RFCOMM_EVENT_CHANNEL_OPENED packet_handler type %u, packet[0] %x\n", packet_type, packet[0]); // data: event(8), len(8), status (8), address (48), handle(16), server channel(8), rfcomm_cid(16), max frame size(16) if (packet[2]) { printf("RFCOMM channel open failed, status %u\n", packet[2]); diff --git a/tool/migration_to_v1.0/migration.sed b/tool/migration_to_v1.0/migration.sed index 540845510..d24b85266 100644 --- a/tool/migration_to_v1.0/migration.sed +++ b/tool/migration_to_v1.0/migration.sed @@ -28,6 +28,7 @@ s/HAVE_TIME_MS/HAVE_EMBEDDED_TIME_MS/g s/HAVE_TICK/HAVE_EMBEDDED_TICK/g s/HAVE_TIME/HAVE_POSIX_TIME/g s/HAVE_STDIO/HAVE_POSIX_STDIN/g +s/RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE/RFCOMM_EVENT_CHANNEL_OPENED/g s/SDP_QUERY_ATTRIBUTE_BYTE/SDP_EVENT_QUERY_ATTRIBUTE_BYTE/g s/SDP_QUERY_ATTRIBUTE_VALUE/SDP_EVENT_QUERY_ATTRIBUTE_VALUE/g s/SDP_QUERY_COMPLETE/SDP_EVENT_QUERY_COMPLETE/g