diff --git a/example/embedded/sdp_rfcomm_query.c b/example/embedded/sdp_rfcomm_query.c index ded37cb11..ade4c71ba 100644 --- a/example/embedded/sdp_rfcomm_query.c +++ b/example/embedded/sdp_rfcomm_query.c @@ -57,6 +57,7 @@ #include "hci_dump.h" #include "l2cap.h" #include "classic/sdp_query_rfcomm.h" +#include "btstack_event.h" // static bd_addr_t remote = {0x04,0x0C,0xCE,0xE4,0x85,0xD3}; static bd_addr_t remote = {0x84, 0x38, 0x35, 0x65, 0xD1, 0x15}; @@ -84,7 +85,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack } } -static void store_found_service(uint8_t * name, uint8_t port){ +static void store_found_service(const char * name, uint8_t port){ printf("APP: Service name: '%s', RFCOMM port %u\n", name, port); channel_nr[service_index] = port; service_name[service_index] = (char*) malloc(SDP_SERVICE_NAME_LEN+1); @@ -108,12 +109,13 @@ static void report_found_services(void){ } static void handle_query_rfcomm_event(sdp_query_event_t * event, void * context){ - sdp_query_rfcomm_service_event_t * ve; + const uint8_t * ve; switch (event->type){ case SDP_QUERY_RFCOMM_SERVICE: - ve = (sdp_query_rfcomm_service_event_t*) event; - store_found_service(ve->service_name, ve->channel_nr); + ve = (const uint8_t *) event; + store_found_service(sdp_query_rfcomm_service_event_get_name(ve), + sdp_query_rfcomm_service_event_get_rfcomm_channel(ve)); break; case SDP_QUERY_COMPLETE: report_found_services(); diff --git a/example/embedded/spp_streamer.c b/example/embedded/spp_streamer.c index b2fd3bcbd..b42298d3c 100644 --- a/example/embedded/spp_streamer.c +++ b/example/embedded/spp_streamer.c @@ -58,6 +58,7 @@ #include "l2cap.h" #include "classic/sdp_query_rfcomm.h" #include "classic/rfcomm.h" +#include "btstack_event.h" #define NUM_ROWS 25 #define NUM_COLS 40 @@ -150,7 +151,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack } } -static void handle_found_service(char * name, uint8_t port){ +static void handle_found_service(const char * name, uint8_t port){ printf("APP: Service name: '%s', RFCOMM port %u\n", name, port); if (strncmp(name, spp_service_name_prefix, strlen(spp_service_name_prefix)) != 0) return; @@ -161,12 +162,13 @@ static void handle_found_service(char * name, uint8_t port){ } static void handle_query_rfcomm_event(sdp_query_event_t * event, void * context){ - sdp_query_rfcomm_service_event_t * ve; + const uint8_t * ve; switch (event->type){ case SDP_QUERY_RFCOMM_SERVICE: - ve = (sdp_query_rfcomm_service_event_t*) event; - handle_found_service((char*) ve->service_name, ve->channel_nr); + ve = (const uint8_t *) event; + handle_found_service(sdp_query_rfcomm_service_event_get_name(ve), + sdp_query_rfcomm_service_event_get_rfcomm_channel(ve)); break; case SDP_QUERY_COMPLETE: if (state != W4_SDP_COMPLETE){ diff --git a/platform/daemon/daemon.c b/platform/daemon/daemon.c index f43baefa0..4f67d07a9 100644 --- a/platform/daemon/daemon.c +++ b/platform/daemon/daemon.c @@ -1577,14 +1577,9 @@ static void rfcomm_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t static void handle_sdp_rfcomm_service_result(sdp_query_event_t * rfcomm_event, void * context){ switch (rfcomm_event->type){ case SDP_QUERY_RFCOMM_SERVICE: { - sdp_query_rfcomm_service_event_t * service_event = (sdp_query_rfcomm_service_event_t*) rfcomm_event; - int name_len = (int)strlen((const char*)service_event->service_name); - int event_len = 3 + name_len; - uint8_t event[event_len]; - event[0] = rfcomm_event->type; - event[1] = 1 + name_len; - event[2] = service_event->channel_nr; - memcpy(&event[3], service_event->service_name, name_len); + // already an HCI Event + const uint8_t * event = (const uint8_t *) event; + int event_len = 2 + event[1]; hci_dump_packet(HCI_EVENT_PACKET, 0, event, event_len); socket_connection_send_packet(context, HCI_EVENT_PACKET, 0, event, event_len); break; diff --git a/src/btstack_defines.h b/src/btstack_defines.h index 98f21a86d..2779bc596 100644 --- a/src/btstack_defines.h +++ b/src/btstack_defines.h @@ -374,8 +374,6 @@ */ #define RFCOMM_EVENT_PERSISTENT_CHANNEL 0x86 -// data: event (8), len(8), rfcomm_cid (16), modem status (8) - /** * @format 21 * @param rfcomm_cid @@ -383,31 +381,26 @@ */ #define RFCOMM_EVENT_REMOTE_MODEM_STATUS 0x87 -// data: event (8), len(8), rfcomm_cid (16), rpn_data_t (67) /** - * TODO: format for variable data + * TODO: format for variable data 2? * @param rfcomm_cid * @param rpn_data */ #define RFCOMM_EVENT_PORT_CONFIGURATION 0x88 - -// data: event(8), len(8), status(8), service_record_handle(32) - /** +/** * @format 14 * @param status * @param service_record_handle */ #define SDP_SERVICE_REGISTERED 0x90 -// data: event(8), len(8), status(8) /** * @format 1 * @param status */ #define SDP_QUERY_COMPLETE 0x91 -// data: event(8), len(8), rfcomm channel(8), name(var) /** * @format 1T * @param rfcomm_channel diff --git a/src/btstack_event.h b/src/btstack_event.h new file mode 100644 index 000000000..bbe065133 --- /dev/null +++ b/src/btstack_event.h @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2016 BlueKitchen GmbH + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the copyright holders nor the names of + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * 4. Any redistribution, use, or modification is done solely for + * personal benefit and not for any commercial purpose or for + * monetary gain. + * + * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MATTHIAS + * RINGWALD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Please inquire about commercial licensing options at + * contact@bluekitchen-gmbh.com + * + */ + + +/* + * btstack_event.h + * + * @brief BTstack event getter/setter + * @note Don't edit - generated by tool/btstack_event_generator.py + * + */ + +#ifndef __BTSTACK_EVENT_H +#define __BTSTACK_EVENT_H + +#if defined __cplusplus +extern "C" { +#endif + +#include "btstack_util.h" +#include + +/* API_START */ + + +/** + * @brief Get field status from event sdp_query_complete_event + * @param Event packet + * @return status + * @note: btstack_type 1 + */ +static inline uint8_t sdp_query_complete_event_get_status(const uint8_t * event){ + return event[2]; +} + +/** + * @brief Get field rfcomm_channel from event sdp_query_rfcomm_service_event + * @param Event packet + * @return rfcomm_channel + * @note: btstack_type 1 + */ +static inline uint8_t sdp_query_rfcomm_service_event_get_rfcomm_channel(const uint8_t * event){ + return event[2]; +} + +/** + * @brief Get field name from event sdp_query_rfcomm_service_event + * @param Event packet + * @return name + * @note: btstack_type T + */ +static inline const char * sdp_query_rfcomm_service_event_get_name(const uint8_t * event){ + return (const char *) &event[3]; +} + + +/* API_END */ + +#if defined __cplusplus +} +#endif + +#endif // __BTSTACK_EVENT_H diff --git a/src/classic/hfp.c b/src/classic/hfp.c index 3d21dfb39..231153a15 100644 --- a/src/classic/hfp.c +++ b/src/classic/hfp.c @@ -59,6 +59,7 @@ #include "classic/sdp_query_rfcomm.h" #include "classic/sdp.h" #include "btstack_debug.h" +#include "btstack_event.h" #define HFP_HF_FEATURES_SIZE 10 #define HFP_AG_FEATURES_SIZE 12 @@ -414,7 +415,7 @@ void hfp_create_sdp_record(uint8_t * service, uint32_t service_record_handle, ui static hfp_connection_t * connection_doing_sdp_query = NULL; static void handle_query_rfcomm_event(sdp_query_event_t * event, void * context){ - sdp_query_rfcomm_service_event_t * ve; + const uint8_t * ve; sdp_query_complete_event_t * ce; hfp_connection_t * connection = connection_doing_sdp_query; @@ -422,12 +423,12 @@ static void handle_query_rfcomm_event(sdp_query_event_t * event, void * context) switch (event->type){ case SDP_QUERY_RFCOMM_SERVICE: - ve = (sdp_query_rfcomm_service_event_t*) event; + ve = (const uint8_t *) event; if (!connection) { - log_error("handle_query_rfcomm_event alloc connection for RFCOMM port %u failed", ve->channel_nr); + log_error("handle_query_rfcomm_event alloc connection for RFCOMM port %u failed", sdp_query_rfcomm_service_event_get_rfcomm_channel(ve)); return; } - connection->rfcomm_channel_nr = ve->channel_nr; + connection->rfcomm_channel_nr = sdp_query_rfcomm_service_event_get_rfcomm_channel(ve); break; case SDP_QUERY_COMPLETE: connection_doing_sdp_query = NULL; diff --git a/src/classic/hsp_ag.c b/src/classic/hsp_ag.c index ae0dd4c40..5d1007868 100644 --- a/src/classic/hsp_ag.c +++ b/src/classic/hsp_ag.c @@ -48,17 +48,17 @@ #include #include -#include "hci_cmd.h" -#include "btstack_run_loop.h" - -#include "hci.h" -#include "btstack_memory.h" -#include "hci_dump.h" -#include "l2cap.h" -#include "classic/sdp_query_rfcomm.h" -#include "classic/sdp.h" #include "btstack_debug.h" +#include "btstack_event.h" +#include "btstack_memory.h" +#include "btstack_run_loop.h" +#include "classic/sdp.h" +#include "classic/sdp_query_rfcomm.h" +#include "hci.h" +#include "hci_cmd.h" +#include "hci_dump.h" #include "hsp_ag.h" +#include "l2cap.h" #define RFCOMM_SERVER_CHANNEL 1 @@ -626,14 +626,14 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack } static void handle_query_rfcomm_event(sdp_query_event_t * event, void * context){ - sdp_query_rfcomm_service_event_t * ve; + const uint8_t * ve; sdp_query_complete_event_t * ce; switch (event->type){ case SDP_QUERY_RFCOMM_SERVICE: - ve = (sdp_query_rfcomm_service_event_t*) event; - channel_nr = ve->channel_nr; - printf("** Service name: '%s', RFCOMM port %u\n", ve->service_name, channel_nr); + ve = (const uint8_t *) event; + channel_nr = sdp_query_rfcomm_service_event_get_rfcomm_channel(ve); + printf("** Service name: '%s', RFCOMM port %u\n", sdp_query_rfcomm_service_event_get_name(ve), channel_nr); break; case SDP_QUERY_COMPLETE: ce = (sdp_query_complete_event_t*) event; diff --git a/src/classic/hsp_hs.c b/src/classic/hsp_hs.c index 5773ef5b2..554b549a1 100644 --- a/src/classic/hsp_hs.c +++ b/src/classic/hsp_hs.c @@ -48,18 +48,17 @@ #include #include -#include "hci_cmd.h" -#include "btstack_run_loop.h" - -#include "hci.h" -#include "btstack_memory.h" -#include "hci_dump.h" -#include "l2cap.h" -#include "classic/sdp_query_rfcomm.h" -#include "classic/sdp.h" #include "btstack_debug.h" +#include "btstack_event.h" +#include "btstack_memory.h" +#include "btstack_run_loop.h" +#include "classic/sdp.h" +#include "classic/sdp_query_rfcomm.h" +#include "hci.h" +#include "hci_cmd.h" +#include "hci_dump.h" #include "hsp_hs.h" - +#include "l2cap.h" #define HSP_AG_OK "OK" #define HSP_AG_ERROR "ERROR" @@ -575,14 +574,14 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack } static void handle_query_rfcomm_event(sdp_query_event_t * event, void * context){ - sdp_query_rfcomm_service_event_t * ve; + const uint8_t * ve; sdp_query_complete_event_t * ce; switch (event->type){ case SDP_QUERY_RFCOMM_SERVICE: - ve = (sdp_query_rfcomm_service_event_t*) event; - channel_nr = ve->channel_nr; - printf("** Service name: '%s', RFCOMM port %u\n", ve->service_name, channel_nr); + ve = (const uint8_t*) event; + channel_nr = sdp_query_rfcomm_service_event_get_rfcomm_channel(ve); + printf("** Service name: '%s', RFCOMM port %u\n", sdp_query_rfcomm_service_event_get_name(ve), channel_nr); break; case SDP_QUERY_COMPLETE: ce = (sdp_query_complete_event_t*) event; diff --git a/src/classic/sdp_query_rfcomm.c b/src/classic/sdp_query_rfcomm.c index 1bb48e8d6..b950ab327 100644 --- a/src/classic/sdp_query_rfcomm.c +++ b/src/classic/sdp_query_rfcomm.c @@ -75,6 +75,7 @@ const uint8_t des_attributeIDList[] = { 0x35, 0x05, 0x0A, 0x00, 0x01, 0x01, 0 static uint8_t des_serviceSearchPattern[5] = {0x35, 0x03, 0x19, 0x00, 0x00}; static uint8_t sdp_service_name[SDP_SERVICE_NAME_LEN+1]; +static uint8_t sdp_service_name_len = 0; static uint8_t sdp_rfcomm_channel_nr = 0; static uint8_t sdp_service_name_header_size; @@ -96,12 +97,13 @@ static void (*sdp_app_callback)(sdp_query_event_t * event, void * context) = dum static void dummy_notify_app(sdp_query_event_t* event, void * context){} static void emit_service(void){ - sdp_query_rfcomm_service_event_t value_event = { - SDP_QUERY_RFCOMM_SERVICE, - sdp_rfcomm_channel_nr, - (uint8_t *) sdp_service_name - }; - (*sdp_app_callback)((sdp_query_event_t*)&value_event, sdp_app_context); + uint8_t event[3+SDP_SERVICE_NAME_LEN+1]; + event[0] = SDP_QUERY_RFCOMM_SERVICE; + event[1] = sdp_service_name_len + 1; + event[2] = sdp_rfcomm_channel_nr; + memcpy(&event[3], sdp_service_name, sdp_service_name_len); + event[3+sdp_service_name_len] = 0; + (*sdp_app_callback)((sdp_query_event_t*)event, sdp_app_context); sdp_rfcomm_channel_nr = 0; } @@ -237,12 +239,14 @@ static void handleServiceNameData(uint32_t attribute_value_length, uint32_t data // terminate if name complete if (name_pos >= name_len){ - sdp_service_name[name_pos] = 0; + sdp_service_name[name_pos] = 0; + sdp_service_name_len = name_pos; } // terminate if buffer full if (name_pos == SDP_SERVICE_NAME_LEN){ sdp_service_name[name_pos] = 0; + sdp_service_name_len = name_pos; } } @@ -296,6 +300,7 @@ static void handle_sdp_parser_event(sdp_query_event_t * event){ } void sdp_query_rfcomm_init(void){ + printf("sdp_query_rfcomm_init\n"); // init de_state_init(&de_header_state); de_state_init(&sn_de_header_state); diff --git a/src/classic/sdp_query_rfcomm.h b/src/classic/sdp_query_rfcomm.h index 70b9b322f..56989c94d 100644 --- a/src/classic/sdp_query_rfcomm.h +++ b/src/classic/sdp_query_rfcomm.h @@ -54,15 +54,6 @@ extern "C" { /* API_START */ -/** - * @brief SDP Query RFCOMM event to deliver channel number and service name byte by byte. - */ -typedef struct sdp_query_rfcomm_service_event { - uint8_t type; - uint8_t channel_nr; - uint8_t * service_name; -} sdp_query_rfcomm_service_event_t; - /** * @brief Registers a callback to receive RFCOMM service and query complete event. */ diff --git a/test/hfp/mock.c b/test/hfp/mock.c index a0ce4279e..968bcedce 100644 --- a/test/hfp/mock.c +++ b/test/hfp/mock.c @@ -215,12 +215,14 @@ static void sdp_query_complete_response(uint8_t status){ } static void sdp_query_rfcomm_service_response(uint8_t status){ - sdp_query_rfcomm_service_event_t service_event = { - SDP_QUERY_RFCOMM_SERVICE, - sdp_rfcomm_channel_nr, - (uint8_t *)sdp_rfcomm_service_name - }; - (*registered_sdp_app_callback)((sdp_query_event_t*)&service_event, registered_sdp_app_context); + int sdp_service_name_len = strlen(sdp_rfcomm_service_name); + uint8_t event[3+SDP_SERVICE_NAME_LEN+1]; + event[0] = SDP_QUERY_RFCOMM_SERVICE; + event[1] = sdp_service_name_len + 1; + event[2] = sdp_rfcomm_channel_nr; + memcpy(&event[3], sdp_rfcomm_service_name, sdp_service_name_len); + event[3+sdp_service_name_len] = 0; + (*registered_sdp_app_callback)((sdp_query_event_t*)&event, registered_sdp_app_context); } void sdp_query_rfcomm_channel_and_name_for_uuid(bd_addr_t remote, uint16_t uuid){ diff --git a/test/pts/classic_test.c b/test/pts/classic_test.c index 476bf6f1d..f8fd88daa 100644 --- a/test/pts/classic_test.c +++ b/test/pts/classic_test.c @@ -396,12 +396,13 @@ static void handle_found_service(char * name, uint8_t port){ } static void handle_query_rfcomm_event(sdp_query_event_t * event, void * context){ - sdp_query_rfcomm_service_event_t * ve; + const uint8_t * ve; switch (event->type){ case SDP_QUERY_RFCOMM_SERVICE: - ve = (sdp_query_rfcomm_service_event_t*) event; - handle_found_service((char*) ve->service_name, ve->channel_nr); + ve = (const uint8_t*) event; + handle_found_service(sdp_query_rfcomm_service_event_get_name(ve), + sdp_query_rfcomm_service_event_get_rfcomm_channel(ve)); break; case SDP_QUERY_COMPLETE: printf("SDP SPP Query complete\n"); diff --git a/test/pts/hfp_test.c b/test/pts/hfp_test.c index 0966dfffc..0888ea8e0 100644 --- a/test/pts/hfp_test.c +++ b/test/pts/hfp_test.c @@ -140,14 +140,14 @@ static void packet_handler(void * connection, uint8_t packet_type, uint16_t chan } void handle_query_rfcomm_event(sdp_query_event_t * event, void * context){ - sdp_query_rfcomm_service_event_t * ve; + const uint8_t * ve; sdp_query_complete_event_t * ce; switch (event->type){ case SDP_QUERY_RFCOMM_SERVICE: - ve = (sdp_query_rfcomm_service_event_t*) event; - channel_nr = ve->channel_nr; - printf("** Service name: '%s', RFCOMM port %u\n", ve->service_name, channel_nr); + ve = (const uint8_t*) event; + channel_nr = sdp_query_rfcomm_service_event_get_name(ve); + printf("** Service name: '%s', RFCOMM port %u\n", sdp_query_rfcomm_service_event_get_rfcomm_channel(ve), channel_nr); break; case SDP_QUERY_COMPLETE: ce = (sdp_query_complete_event_t*) event; diff --git a/test/sdp_client/sdp_rfcomm_query.c b/test/sdp_client/sdp_rfcomm_query.c index 9c982572c..fa6c0d1d3 100644 --- a/test/sdp_client/sdp_rfcomm_query.c +++ b/test/sdp_client/sdp_rfcomm_query.c @@ -20,6 +20,7 @@ #include "btstack_memory.h" #include "hci_dump.h" #include "l2cap.h" +#include "btstack_event.h" #include "CppUTest/TestHarness.h" #include "CppUTest/CommandLineTestRunner.h" @@ -90,15 +91,16 @@ void sdp_query_rfcomm_init(); void handle_query_rfcomm_event(sdp_query_event_t * event, void * context){ - sdp_query_rfcomm_service_event_t * ve; sdp_query_complete_event_t * ce; + uint8_t * ve = (uint8_t *) event; + + printf("handle_query_rfcomm_event\n"); switch (event->type){ case SDP_QUERY_RFCOMM_SERVICE: - ve = (sdp_query_rfcomm_service_event_t*) event; - channel_nr[service_index] = ve->channel_nr; + channel_nr[service_index] = sdp_query_rfcomm_service_event_get_rfcomm_channel(ve); service_name[service_index] = (char*) malloc(SDP_SERVICE_NAME_LEN+1); - strncpy(service_name[service_index], (char*) ve->service_name, SDP_SERVICE_NAME_LEN); + strncpy(service_name[service_index], sdp_query_rfcomm_service_event_get_name(ve), SDP_SERVICE_NAME_LEN); service_name[service_index][SDP_SERVICE_NAME_LEN] = 0; // printf("CALLBACK: Service name: '%s', RFCOMM port %u, service index %d\n", service_name[service_index], channel_nr[service_index], service_index); service_index++; diff --git a/tool/btstack_event_generator.py b/tool/btstack_event_generator.py index d409fa61e..9feb0b32f 100755 --- a/tool/btstack_event_generator.py +++ b/tool/btstack_event_generator.py @@ -136,8 +136,9 @@ param_read = { '3' : 'return READ_BT_24(event, {offset});', '4' : 'return READ_BT_32(event, {offset});', 'H' : 'return READ_BT_16(event, {offset});', - 'B' : 'bt_flip_addr({result_name}, (uint8_t*) &event[{offset}]);', - 'R' : 'return &event[{offset}];' + 'B' : 'swap48(&event[{offset}], {result_name});', + 'R' : 'return &event[{offset}];', + 'T' : 'return (const char *) &event[{offset}];' } def c_type_for_btstack_type(type): @@ -146,7 +147,7 @@ def c_type_for_btstack_type(type): 'R' : 'const uint8_t *', 'S' : 'const uint8_t *', 'J' : 'int', 'L' : 'int', 'V' : 'const uint8_t *', 'U' : 'BT_UUID', 'X' : 'GATTService', 'Y' : 'GATTCharacteristic', 'Z' : 'GATTCharacteristicDescriptor', - 'T' : 'String'} + 'T' : 'const char *'} return param_types[type] def size_for_type(type): @@ -155,7 +156,10 @@ def size_for_type(type): return param_sizes[type] def format_function_name(event_name): - return event_name.lower() + event_name = event_name.lower() + if 'event' in event_name: + return event_name; + return event_name+'_event' def template_for_type(field_type): global c_prototoype_simple_return @@ -198,6 +202,8 @@ def create_events(events): fout.write(copyright) fout.write(hfile_header_begin) for event_type, event_name, format, args in events: + if not event_name in ['SDP_QUERY_COMPLETE', 'SDP_QUERY_RFCOMM_SERVICE', 'SDP_QUERY_ATTRIBUTE_VALUE', 'SDP_QUERY_SERVICE_RECORD_HANDLE']: + continue event_name = format_function_name(event_name) offset = 2 supported = all_fields_supported(format) @@ -208,7 +214,7 @@ def create_events(events): break text = create_getter(event_name, field_name, field_type, offset, supported) fout.write(text) - if field_type == 'R': + if field_type in 'RT': break offset += size_for_type(field_type)