May 15, 2009 posted by Adam Hamsik
When initially writing the Bluetooth stack for NetBSD, I imported the
Service Discovery suite directly from FreeBSD with few changes as the spec
seemed a bit obtuse, and it saved a huge bunch of time. After working with
some software using that API since though, I found it quite limiting and
really thought something better was needed.
So, I have deprecated the libsdp functions and replaced them with
something that reflects the specification more closely, allowing much
more flexibility and added an API to deal with the raw data in a fairly
simple manner. While working on it, I found that the SDP spec was not
that obtuse and the data streams were fairly easy to work with.
SDP daemon, sdpquery
Along the way I rewrote the SDP daemon sdpd(8) to be much simpler, and
finally updated the sdpquery(1) program to display complete service
records in a meaningful manner:
% sdpquery -a phone search OPUSH
RFCOMM (channel 9)
Public Browse Root
en.UTF-8 base 0x0100
Object Push, v1.0
ServiceName: "OBEX Object Push"
All programs in base are converted to use the new API and compatibility
is provided at source level by defining SDP_COMPAT and the old ABI is