pan: use pan_create_X_sdp_record

This commit is contained in:
Matthias Ringwald 2016-03-17 11:28:46 +01:00
parent efda0b48f9
commit a3bf6c7b6d
6 changed files with 12 additions and 9 deletions

View File

@ -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.

View File

@ -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);
}

View File

@ -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);

View File

@ -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);

View File

@ -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");

View File

@ -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