From 095d2a06781c369b32fca58c49e44b82e80ea360 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Tue, 15 Mar 2016 15:55:19 +0100 Subject: [PATCH] migration: rfcomm add packet handler to register service and create channel calls --- tool/conversion_to_v1.0/convert.cocci | 68 ++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 2 deletions(-) diff --git a/tool/conversion_to_v1.0/convert.cocci b/tool/conversion_to_v1.0/convert.cocci index 8d87fedc4..7d530efd3 100644 --- a/tool/conversion_to_v1.0/convert.cocci +++ b/tool/conversion_to_v1.0/convert.cocci @@ -152,18 +152,82 @@ type T; + T fn(uint8_t packet_type, uint16_t channel, uint8_t * packet, uint16_t size) { ... } +// SDP Util + +@@ +expression E1, E2, E3; +@@ +- sdp_create_spp_service(E1, E2, E3) ++ // MIGRATION: using 0x10001 as Service Record Handle. Please fix if using multiple services ++ sdp_create_spp_service(E1, 0x10001, E2, E3) + +// SDP Server +@@ +expression E1, E2; +@@ +- sdp_register_service(E1, E2) ++ sdp_register_service(E2) + // RFCOMM // track calls to rfcomm_register_packet_handler @rfcomm_register_packet_handler@ -identifier sdp_client_callback; +identifier rfcomm_callback; +@@ +- rfcomm_register_packet_handler(rfcomm_callback); + +// fix calls to +// rfcomm_register_service +@@ +identifier rfcomm_register_packet_handler.rfcomm_callback; +expression E1, E2, E3; +@@ +- rfcomm_register_service(E1, E2, E3) ++ rfcomm_register_service(rfcomm_callback, E2, E3) + +// rfcomm_register_service_with_initial_credits, +@@ +identifier rfcomm_register_packet_handler.rfcomm_callback; expression E1, E2, E3, E4; @@ -- sdp_query_rfcomm_register_callback(rfcomm_callback); +- rfcomm_register_service_with_initial_credits(E1, E2, E3, E4) ++ rfcomm_register_service_with_initial_credits(rfcomm_callback, E2, E3, E4) + +// rfcomm_create_channel +@@ +identifier rfcomm_register_packet_handler.rfcomm_callback; +expression E1, E2, E3; +@@ +- rfcomm_create_channel(E1, E2, E3) ++ rfcomm_create_channel(rfcomm_callback, E2, E3) + +// rfcomm_create_channel_with_initial_credits +@@ +identifier rfcomm_register_packet_handler.rfcomm_callback; +expression E1, E2, E3, E4; +@@ +- rfcomm_create_channel_with_initial_creditis(E1, E2, E3, E4) ++ rfcomm_create_channel_with_initial_creditis(rfcomm_callback, E2, E3, E4) + // GATT Client +// HSP +@@ +expression E1, E2, E3, E4; +@@ +- hsp_hs_create_sdp_record(E1, E2, E3, E4) ++ // MIGRATION: using 0x10002 as Service Record Handle. Please fix if using multiple services ++ hsp_hs_create_sdp_record(E1, 0x10002, E2, E3, E4) + +@@ +expression E1, E2, E3, E4; +@@ +- hsp_ag_create_sdp_record(E1, E2, E3) ++ // MIGRATION: using 0x10002 as Service Record Handle. Please fix if using multiple services ++ hsp_ag_create_sdp_record(E1, 0x10002, E2, E3) +