diff options
| -rw-r--r-- | hcid/dbus-api.txt | 3 | ||||
| -rw-r--r-- | hcid/dbus-sdp.c | 18 | 
2 files changed, 14 insertions, 7 deletions
| diff --git a/hcid/dbus-api.txt b/hcid/dbus-api.txt index 3687000f..d5c5a276 100644 --- a/hcid/dbus-api.txt +++ b/hcid/dbus-api.txt @@ -755,7 +755,8 @@ Methods		string GetAddress()  		array{uint32} GetRemoteServiceHandles(string address, string match)  			This method will request the SDP database of a remote -			device and retrieve the service record handles. +			device and retrieve the service record handles. To request +			service browse send an empty match string.  			Possible errors: org.bluez.Error.InvalidArguments  					 org.bluez.Error.InProgress diff --git a/hcid/dbus-sdp.c b/hcid/dbus-sdp.c index 7fc4e451..f538d297 100644 --- a/hcid/dbus-sdp.c +++ b/hcid/dbus-sdp.c @@ -946,8 +946,12 @@ static int remote_svc_handles_conn_cb(struct transaction_context *ctxt)  			DBUS_TYPE_STRING, &svc,  			DBUS_TYPE_INVALID); -	class = sdp_str2svclass(svc); -	sdp_uuid16_create(&uuid, class); +	if (strlen(svc) > 0 ){ +		class = sdp_str2svclass(svc); +		sdp_uuid16_create(&uuid, class); +	} else +		sdp_uuid16_create(&uuid, PUBLIC_BROWSE_GROUP); +  	search = sdp_list_append(0, &uuid);  	/* Create/send the search request and set the callback to indicate the request completion */ @@ -977,10 +981,12 @@ DBusHandlerResult get_remote_svc_handles(DBusConnection *conn, DBusMessage *msg,  			DBUS_TYPE_INVALID))  		return error_invalid_arguments(conn, msg); -	class = sdp_str2svclass(svc); -	if (!class) { -		error("Invalid service class name"); -		return error_invalid_arguments(conn, msg); +	if (strlen(svc) > 0) { +		class = sdp_str2svclass(svc); +		if (!class) { +			error("Invalid service class name"); +			return error_invalid_arguments(conn, msg); +		}  	}  	if (find_pending_connect(dst)) | 
