sdp_open(laddr, raddr)
Open a SDP session to a remote Bluetooth device. laddr refers to the local bluetooth device address and may be NULL in which case it will default to BDADDR_ANY.
sdp_open_local(control)
Open a SDP session to a server using a local socket. The control socket path may be given as NULL in which case the default control path /var/run/sdp will be used.
sdp_close(ss)
Close SDP session and release all resources.
sdp_service_search(ss, ssp, handlep, num)
Perform a complete ServiceSearch transaction on the SDP session. At most num service record handles matching the ServiceSearchPattern ssp will be returned in the array pointed to by handlep.
sdp_service_attribute(ss, handle, ail, response)
Perform a complete ServiceAttribute transaction on the SDP session. The ServiceRecord with ServiceRecordHandle handle will be parsed using the AttributeIDList ail. If the transaction succeeds, the response data buffer will contain a validated data element list of attribute ID/value pairs from the selected record.
sdp_service_search_attribute(ss, ssp, ail, response)
Perform a complete ServiceSearchAttribute transaction on the SDP session. All ServiceRecords matching the ServiceSearchPattern ssp will be parsed using the AttributeIDList ail. If the transaction succeeds, the response data buffer will contain a valid data element list of sequences, where each sequence is the attribute ID/value list from a matched record.
sdp_record_insert(ss, bdaddr, handlep, record)
Insert a ServiceRecord record. If bdaddr is given, the service record will be restricted to clients connecting through the Bluetooth controller with that BD_ADDR. When the handlep pointer is non NULL, the resulting ServiceRecordHandle will be written to the address given. The record will be valid while the session is active and will be purged when the session is closed.
sdp_record_update(ss, handle, record)
Update a ServiceRecord that is owned by this session. handle is the identifier returned by the sdp_record_insert() call, and record is the updated ServiceRecord as described above.
sdp_record_remove(ss, handle)
Remove a ServiceRecord owned by this session. handle is the identifier returned by the sdp_record_insert() call.
A single response buffer is maintained for each session, so the results of a ServiceAttribute or ServiceSearchAttribute request will only be valid until another request is made or the session is closed. The SDP specifications do not mandate a limit on the size of the response buffer but this implementation has a default limit of UINT16_MAX bytes. This limit can be increased at runtime by setting the environment variable
SDP_RESPONSE_MAX to a numeric value.
Records are only allowed to be removed or updated by the session that inserted them, and records will be removed automatically when the session is closed. Further, manipulating service records will normally only be possible for privileged users on a SDP session connected with a local socket. See
sdpd(8) and your local system administrator for details.