Date: Tue, 10 Feb 2009 20:08:03 +0000 (UTC) From: Maksim Yevmenkin <emax@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r188451 - stable/7/usr.sbin/bluetooth/sdpd Message-ID: <200902102008.n1AK83fs003103@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: emax Date: Tue Feb 10 20:08:03 2009 New Revision: 188451 URL: http://svn.freebsd.org/changeset/base/188451 Log: MFC r185320 Straighten out those pesky SDP records for the Bluetooth Service Discovery Application Profile. Discussed with: Iain Hibbert of NetBSD plunky at rya dash online dot net Modified: stable/7/usr.sbin/bluetooth/sdpd/ (props changed) stable/7/usr.sbin/bluetooth/sdpd/sd.c Modified: stable/7/usr.sbin/bluetooth/sdpd/sd.c ============================================================================== --- stable/7/usr.sbin/bluetooth/sdpd/sd.c Tue Feb 10 20:04:20 2009 (r188450) +++ stable/7/usr.sbin/bluetooth/sdpd/sd.c Tue Feb 10 20:08:03 2009 (r188451) @@ -52,6 +52,22 @@ sd_profile_create_service_class_id_list( } static int32_t +sd_profile_create_bluetooth_profile_descriptor_list( + uint8_t *buf, uint8_t const * const eob, + uint8_t const *data, uint32_t datalen) +{ + static uint16_t profile_descriptor_list[] = { + SDP_SERVICE_CLASS_SERVICE_DISCOVERY_SERVER, + 0x0100 + }; + + return (common_profile_create_bluetooth_profile_descriptor_list( + buf, eob, + (uint8_t const *) profile_descriptor_list, + sizeof(profile_descriptor_list))); +} + +static int32_t sd_profile_create_service_id( uint8_t *buf, uint8_t const * const eob, uint8_t const *data, uint32_t datalen) @@ -89,25 +105,23 @@ sd_profile_create_protocol_descriptor_li uint8_t *buf, uint8_t const * const eob, uint8_t const *data, uint32_t datalen) { - if (buf + 13 > eob) + if (buf + 12 > eob) return (-1); SDP_PUT8(SDP_DATA_SEQ8, buf); - SDP_PUT8(11, buf); + SDP_PUT8(10, buf); SDP_PUT8(SDP_DATA_SEQ8, buf); - SDP_PUT8(9, buf); - + SDP_PUT8(3, buf); SDP_PUT8(SDP_DATA_UUID16, buf); SDP_PUT16(SDP_UUID_PROTOCOL_L2CAP, buf); - SDP_PUT8(SDP_DATA_UINT16, buf); - SDP_PUT16(NG_L2CAP_PSM_SDP, buf); - - SDP_PUT8(SDP_DATA_UINT16, buf); - SDP_PUT16(1, buf); /* version */ + SDP_PUT8(SDP_DATA_SEQ8, buf); + SDP_PUT8(3, buf); + SDP_PUT8(SDP_DATA_UUID16, buf); + SDP_PUT16(SDP_UUID_PROTOCOL_SDP, buf); - return (13); + return (12); } static int32_t @@ -182,6 +196,8 @@ static attr_t sd_profile_attrs[] = { common_profile_create_service_record_handle }, { SDP_ATTR_SERVICE_CLASS_ID_LIST, sd_profile_create_service_class_id_list }, + { SDP_ATTR_BLUETOOTH_PROFILE_DESCRIPTOR_LIST, + sd_profile_create_bluetooth_profile_descriptor_list }, { SDP_ATTR_SERVICE_ID, sd_profile_create_service_id }, { SDP_ATTR_LANGUAGE_BASE_ATTRIBUTE_ID_LIST,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902102008.n1AK83fs003103>