From a3bf6c7b6d6a1c1912c2d1ff381e74f65d813fd9 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 17 Mar 2016 11:28:46 +0100 Subject: [PATCH] pan: use pan_create_X_sdp_record --- doc/manual/docs/profiles.md | 2 +- src/classic/pan.c | 6 +++--- src/classic/pan.h | 6 +++--- test/pts/bnep_test.c | 2 +- test/pts/iopt.c | 2 +- tool/migration_to_v1.0/migration.sed | 3 +++ 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/doc/manual/docs/profiles.md b/doc/manual/docs/profiles.md index 7e2690d53..e103048b6 100644 --- a/doc/manual/docs/profiles.md +++ b/doc/manual/docs/profiles.md @@ -244,7 +244,7 @@ service UUID, e.g. the PANU UUID, and a a maximal ethernet frame size, as explained in Section [on BNEP service](protocols/#sec:bnepServiceProtocols). Then, you need to create an SDP record for it and publish it with the SDP server by calling *sdp_register_service*. BTstack provides the -*pan_create_panu_service* function in *src/pan.c* that requires an +*pan_create_panu_sdp_record* function in *src/pan.c* that requires an empty buffer of approximately 200 bytes, a description, and a security description. diff --git a/src/classic/pan.c b/src/classic/pan.c index b2bdaafb5..199e51b89 100644 --- a/src/classic/pan.c +++ b/src/classic/pan.c @@ -217,17 +217,17 @@ static void pan_create_service(uint8_t *service, uint32_t service_record_handle, } -void pan_create_nap_service(uint8_t *service, uint32_t service_record_handle, uint16_t * network_packet_types, const char *name, const char *description, security_description_t security_desc, +void pan_create_nap_sdp_record(uint8_t *service, uint32_t service_record_handle, uint16_t * network_packet_types, const char *name, const char *description, security_description_t security_desc, net_access_type_t net_access_type, uint32_t max_net_access_rate, const char *IPv4Subnet, const char *IPv6Subnet){ pan_create_service(service, service_record_handle, SDP_NAP, network_packet_types, name, description, security_desc, net_access_type, max_net_access_rate, IPv4Subnet, IPv6Subnet); } -void pan_create_gn_service(uint8_t *service, uint32_t service_record_handle, uint16_t * network_packet_types, const char *name, const char *description, security_description_t security_desc, +void pan_create_gn_sdp_service(uint8_t *service, uint32_t service_record_handle, uint16_t * network_packet_types, const char *name, const char *description, security_description_t security_desc, const char *IPv4Subnet, const char *IPv6Subnet){ pan_create_service(service, service_record_handle, SDP_GN, network_packet_types, name, description, security_desc, PAN_NET_ACCESS_TYPE_NONE, 0, IPv4Subnet, IPv6Subnet); } -void pan_create_panu_service(uint8_t *service, uint32_t service_record_handle, uint16_t * network_packet_types, const char *name, const char *description, security_description_t security_desc){ +void pan_create_panu_sdp_record(uint8_t *service, uint32_t service_record_handle, uint16_t * network_packet_types, const char *name, const char *description, security_description_t security_desc){ pan_create_service(service, service_record_handle, SDP_PANU, network_packet_types, name, description, security_desc, PAN_NET_ACCESS_TYPE_NONE, 0, NULL, NULL); } diff --git a/src/classic/pan.h b/src/classic/pan.h index e987c80c9..637f05be6 100644 --- a/src/classic/pan.h +++ b/src/classic/pan.h @@ -64,7 +64,7 @@ extern "C" { * @param description if NULL, the default service description will be assigned * @param security_desc */ -void pan_create_panu_service(uint8_t *service, uint32_t service_record_handle, uint16_t * network_packet_types, const char *name, +void pan_create_panu_sdp_record(uint8_t *service, uint32_t service_record_handle, uint16_t * network_packet_types, const char *name, const char *description, security_description_t security_desc); /** @@ -80,7 +80,7 @@ void pan_create_panu_service(uint8_t *service, uint32_t service_record_handle, u * @param IPv4Subnet is optional subnet definition, e.g. "10.0.0.0/8" * @param IPv6Subnet is optional subnet definition given in the standard IETF format with the absolute attribute IDs */ -void pan_create_gn_service(uint8_t *service, uint32_t service_record_handle, uint16_t * network_packet_types, const char *name, +void pan_create_gn_sdp_service(uint8_t *service, uint32_t service_record_handle, uint16_t * network_packet_types, const char *name, const char *description, security_description_t security_desc, const char *IPv4Subnet, const char *IPv6Subnet); @@ -99,7 +99,7 @@ void pan_create_gn_service(uint8_t *service, uint32_t service_record_handle, uin * @param IPv4Subnet is optional subnet definition, e.g. "10.0.0.0/8" * @param IPv6Subnet is optional subnet definition given in the standard IETF format with the absolute attribute IDs */ -void pan_create_nap_service(uint8_t *service, uint32_t service_record_handle, uint16_t * network_packet_types, const char *name, +void pan_create_nap_sdp_record(uint8_t *service, uint32_t service_record_handle, uint16_t * network_packet_types, const char *name, const char *description, security_description_t security_desc, net_access_type_t net_access_type, uint32_t max_net_access_rate, const char *IPv4Subnet, const char *IPv6Subnet); diff --git a/test/pts/bnep_test.c b/test/pts/bnep_test.c index 2ceb9cc73..7e14a7316 100644 --- a/test/pts/bnep_test.c +++ b/test/pts/bnep_test.c @@ -830,7 +830,7 @@ int btstack_main(int argc, const char * argv[]){ sdp_init(); uint16_t network_packet_types[] = { NETWORK_TYPE_IPv4, NETWORK_TYPE_ARP, 0}; // 0 as end of list - pan_create_panu_service(panu_sdp_record, 0x10002, network_packet_types, NULL, NULL, BNEP_SECURITY_NONE); + pan_create_panu_sdp_record(panu_sdp_record, 0x10002, network_packet_types, NULL, NULL, BNEP_SECURITY_NONE); printf("SDP service record size: %u\n", de_get_len((uint8_t*) panu_sdp_record)); sdp_register_service((uint8_t*)panu_sdp_record); diff --git a/test/pts/iopt.c b/test/pts/iopt.c index 86d272677..5ff653a28 100644 --- a/test/pts/iopt.c +++ b/test/pts/iopt.c @@ -100,7 +100,7 @@ int btstack_main(int argc, const char * argv[]){ sdp_register_service((uint8_t*)spp_service_buffer); uint16_t network_packet_types[] = { NETWORK_TYPE_IPv4, NETWORK_TYPE_ARP, 0}; // 0 as end of list - pan_create_panu_service(pan_service_buffer, 0x10002, network_packet_types, NULL, NULL, BNEP_SECURITY_NONE); + pan_create_panu_sdp_record(pan_service_buffer, 0x10002, network_packet_types, NULL, NULL, BNEP_SECURITY_NONE); sdp_register_service((uint8_t*)pan_service_buffer); hsp_ag_create_sdp_record((uint8_t *)hsp_ag_service_buffer, 0x10003, 2, "HSP AG"); diff --git a/tool/migration_to_v1.0/migration.sed b/tool/migration_to_v1.0/migration.sed index f32341405..2b5deb2cc 100644 --- a/tool/migration_to_v1.0/migration.sed +++ b/tool/migration_to_v1.0/migration.sed @@ -95,6 +95,9 @@ s/swap128/reverse_128/g s/swap32/reverse_32/g s/swap48/reverse_48/g s/swap64/reverse_64/g +s/pan_create_panu_service/pan_create_panu_sdp_record/g +s/pan_create_gn_service/pan_create_gn_sdp_record/g +s/pan_create_nap_service/pan_create_nap_sdp_record/g # Folder structure s|/example/embedded|/example|g