michelcandido / btstack

Automatically exported from code.google.com/p/btstack
0 stars 0 forks source link

SDP server #70

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I have done little research with btstack`s sdp server. I have registered 2 
service records in 2 different styles:
de_create_sequence(service);
de_add_number(service, DE_UINT, DE_SIZE_16, SDP_ServiceClassIDList);
de_add_number(service, DE_UUID, DE_SIZE_16, 0x112d);
de_add_number(service, DE_UUID, DE_SIZE_16, 0x1204);
de_add_number(service, DE_UINT, DE_SIZE_16, SDP_ProtocolDescriptorList);
de_add_number(service,  DE_UUID, DE_SIZE_16, 0x0100);
de_add_number(service,  DE_UUID, DE_SIZE_16, 0x0003);

and another 1 like:
de_create_sequence(service);
uint8_t * seq2;

seq2 = de_push_sequence(service);
de_add_number(seq2, DE_UINT, DE_SIZE_16, SDP_ServiceClassIDList);
de_add_number(seq2, DE_UUID, DE_SIZE_16, 0x111f);
de_add_number(seq2, DE_UUID, DE_SIZE_16, 0x1203);
de_pop_sequence(service, seq2);

seq2 = de_push_sequence(service);
de_add_number(seq2, DE_UINT, DE_SIZE_16, SDP_ProtocolDescriptorList);
de_add_number(seq2,  DE_UUID, DE_SIZE_16, 0x0100);
de_add_number(seq2,  DE_UUID, DE_SIZE_16, 0x0003);
de_pop_sequence(service, seq2);

After that a have done some test like:
uint8_t serviceSearchPattern[100];
de_create_sequence(serviceSearchPattern);
de_add_number(serviceSearchPattern, DE_UUID, DE_SIZE_16, 0x112d);
de_dump_data_element(serviceSearchPattern);
printf("service search pattern rSap matches: %u\n", 
sdp_record_matches_service_search_pattern(service, serviceSearchPattern));

Test for both service completed successfully and i`m getting right answers in 
console. But when i`m working with real device second service not able to be 
found with SERVICE_SEARCH_REQUEST. You can see it in attached log file.. 

And another problem... As i can see in sdp.c 
sdp_handle_service_attribute_request is not returning requested by 
SERVICE_ATTRIBUTE_REQUEST attributes. This also can be seen in attached log. It 
returns attribute list byte count but not requested sequence... Also i have 
supposition about returned bytes count...

Original issue reported on code.google.com by 3aka...@gmail.com on 23 Aug 2010 at 8:11

Attachments:

GoogleCodeExporter commented 8 years ago
hi. the code does not create a valid SDP record. please ask on the mailing list 
as this isn't an issue with the SDP server.

(an SDP record contains tuples of key and value pairs - the 1., 3., 5... entry 
is a DE_UINT)

Original comment by matthias.ringwald@gmail.com on 23 Aug 2010 at 8:17