Deleted Added
full compact
sdp.3 (124317) sdp.3 (124758)
1.\" Copyright (c) 2003 Maksim Yevmenkin <m_evmenkin@yahoo.com>
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 9 unchanged lines hidden (view full) ---

18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $Id: sdp.3,v 1.1 2003/09/07 20:34:19 max Exp $
1.\" Copyright (c) 2003 Maksim Yevmenkin <m_evmenkin@yahoo.com>
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 9 unchanged lines hidden (view full) ---

18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $Id: sdp.3,v 1.1 2003/09/07 20:34:19 max Exp $
26.\" $FreeBSD: head/lib/libsdp/sdp.3 124317 2004-01-09 22:44:28Z emax $
26.\" $FreeBSD: head/lib/libsdp/sdp.3 124758 2004-01-20 20:48:26Z emax $
27.\"
28.Dd September 7, 2003
29.Dt SDP 3
30.Os
31.Sh NAME
32.Nm SDP_GET8 ,
33.Nm SDP_GET16 ,
34.Nm SDP_GET32 ,

--- 44 unchanged lines hidden (view full) ---

79.Ft int32_t
80.Fn sdp_error "void *xs"
81.Ft int32_t
82.Fn sdp_search "void *xs" "uint32_t plen" "uint16_t const *pp" "uint32_t alen" "uint32_t const *ap" "uint32_t vlen" "sdp_attr_t *vp"
83.Ft char const * const
84.Fn sdp_attr2desc "uint16_t attr"
85.Ft char const * const
86.Fn sdp_uuid2desc "uint16_t uuid"
27.\"
28.Dd September 7, 2003
29.Dt SDP 3
30.Os
31.Sh NAME
32.Nm SDP_GET8 ,
33.Nm SDP_GET16 ,
34.Nm SDP_GET32 ,

--- 44 unchanged lines hidden (view full) ---

79.Ft int32_t
80.Fn sdp_error "void *xs"
81.Ft int32_t
82.Fn sdp_search "void *xs" "uint32_t plen" "uint16_t const *pp" "uint32_t alen" "uint32_t const *ap" "uint32_t vlen" "sdp_attr_t *vp"
83.Ft char const * const
84.Fn sdp_attr2desc "uint16_t attr"
85.Ft char const * const
86.Fn sdp_uuid2desc "uint16_t uuid"
87.Ft int32_t
88.Fn sdp_register_service "void *xss" "uint16_t uuid" "bdaddr_p const bdaddr" "uint8_t const *data" "uint32_t datalen" "uint32_t *handle"
89.Ft int32_t
90.Fn sdp_unregister_service "void *xss" "uint32_t handle"
91.Ft int32_t
92.Fn sdp_change_service "void *xss" "uint32_t handle" "uint8_t const *data" "uint32_t datalen"
87.Sh DESCRIPTION
88The
89.Fn SDP_GET8 ,
90.Fn SDP_GET16 ,
91.Fn SDP_GET32 ,
92.Fn SDP_GET64
93and
94.Fn SDP_GET128

--- 156 unchanged lines hidden (view full) ---

251records, then all attributes for the secord record etc.
252.Pp
253The
254.Fn sdp_attr2desc
255and
256.Fn sdp_uuid2desc
257functions each take a numeric attribute ID/UUID value and convert it to a
258human readable description.
93.Sh DESCRIPTION
94The
95.Fn SDP_GET8 ,
96.Fn SDP_GET16 ,
97.Fn SDP_GET32 ,
98.Fn SDP_GET64
99and
100.Fn SDP_GET128

--- 156 unchanged lines hidden (view full) ---

257records, then all attributes for the secord record etc.
258.Pp
259The
260.Fn sdp_attr2desc
261and
262.Fn sdp_uuid2desc
263functions each take a numeric attribute ID/UUID value and convert it to a
264human readable description.
265.Pp
266The
267.Fn sdp_register_service
268is used to register service with the local SDP server.
269The
270.Vt xss
271parameter should point to a valid SDP session object obtained from
272.Fn sdp_open_local .
273The
274.Vt uuid
275parameter is a SDP Service Class ID for the service to be registered.
276The
277.Vt bdaddr
278parameter should point to a valid BD_ADDR.
279The service will be only advertised if request was received by the local device
280with
281.Vt bdaddr .
282If
283.Vt bdaddr
284is set to
285.Dv NG_HCI_BDADDR_ANY
286then the service will be advertised to any remote devices that queries for it.
287The
288.Vt data
289and
290.Vt datalen
291parameters specify data and size of the data for the service.
292Upon successful return
293.Fn sdp_register_service
294will populate
295.Vt handle
296with the SDP record handle.
297This parameter is optional and can be set to
298.Dv NULL .
299.Pp
300The
301.Fn sdp_unregister_service
302is used to unregister service with the local SDP server.
303The
304.Vt xss
305parameter should point to a valid SDP session object obtained from
306.Fn sdp_open_local .
307The
308.Vt handle
309parameter should contain a valid SDP record handle of the service to be
310unregistered.
311.Pp
312The
313.Fn sdp_change_service
314function is used to change data associated with the existing service on
315the local SDP server.
316The
317.Vt xss
318parameter should point to a valid SDP session object obtained from
319.Fn sdp_open_local .
320The
321.Vt handle
322parameter should contain a valid SDP record handle of the service to be changed.
323The
324.Vt data
325and
326.Vt datalen
327parameters specify data and size of the data for the service.
328.Sh CAVEAT
329When registering services with the local SDP server the application must
330keep the SDP session open.
331If SDP session is closed then the local SDP server will remove all services
332that were registered over the session.
333The application is allowed to change or unregister service if it was registered
334over the same session.
259.Sh EXAMPLES
260The following example shows how to get
261.Dv SDP_ATTR_PROTOCOL_DESCRIPTOR_LIST
262attribute for the
263.Dv SDP_SERVICE_CLASS_SERIAL_PORT
264service from the remote device.
265.Bd -literal -offset indent
266bdaddr_t remote;

--- 28 unchanged lines hidden (view full) ---

295will return
296.Dv NULL
297if memory allocation for the new SDP session object fails.
298If the new SDP object was created then caller is still expected to call
299.Fn sdp_error
300to check if there was connection error.
301.Pp
302The
335.Sh EXAMPLES
336The following example shows how to get
337.Dv SDP_ATTR_PROTOCOL_DESCRIPTOR_LIST
338attribute for the
339.Dv SDP_SERVICE_CLASS_SERIAL_PORT
340service from the remote device.
341.Bd -literal -offset indent
342bdaddr_t remote;

--- 28 unchanged lines hidden (view full) ---

371will return
372.Dv NULL
373if memory allocation for the new SDP session object fails.
374If the new SDP object was created then caller is still expected to call
375.Fn sdp_error
376to check if there was connection error.
377.Pp
378The
303.Fn sdp_search
304function returns non-zero value on error.
379.Fn sdp_search ,
380.Fn sdp_register_service ,
381.Fn sdp_unregister_service
382and
383.Fn sdp_change_service
384functions return non-zero value on error.
305The caller is expected to call
306.Fn sdp_error
307to find out more about error.
308.Sh SEE ALSO
309.Xr bluetooth 3 ,
385The caller is expected to call
386.Fn sdp_error
387to find out more about error.
388.Sh SEE ALSO
389.Xr bluetooth 3 ,
310.Xr strerror 3
390.Xr strerror 3 ,
391.Xr sdpcontrol 8 ,
392.Xr sdpd 8
311.Sh BUGS
393.Sh BUGS
312This is client only library for now.
394Most likely.
313Please report bugs if found.
314.Sh AUTHORS
315.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com
395Please report bugs if found.
396.Sh AUTHORS
397.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com