From owner-svn-src-all@FreeBSD.ORG Tue Nov 25 21:54:42 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C94341065670; Tue, 25 Nov 2008 21:54:42 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC8F38FC16; Tue, 25 Nov 2008 21:54:42 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAPLsgu4036052; Tue, 25 Nov 2008 21:54:42 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAPLsgZo036051; Tue, 25 Nov 2008 21:54:42 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <200811252154.mAPLsgZo036051@svn.freebsd.org> From: Maksim Yevmenkin Date: Tue, 25 Nov 2008 21:54:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185320 - head/usr.sbin/bluetooth/sdpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Nov 2008 21:54:42 -0000 Author: emax Date: Tue Nov 25 21:54:42 2008 New Revision: 185320 URL: http://svn.freebsd.org/changeset/base/185320 Log: 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 MFC after: 3 weeks Modified: head/usr.sbin/bluetooth/sdpd/sd.c Modified: head/usr.sbin/bluetooth/sdpd/sd.c ============================================================================== --- head/usr.sbin/bluetooth/sdpd/sd.c Tue Nov 25 21:14:00 2008 (r185319) +++ head/usr.sbin/bluetooth/sdpd/sd.c Tue Nov 25 21:54:42 2008 (r185320) @@ -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,