Skip to contentSkip to conversation

No more binary SDP registration in new 4.0 API?

Bluez-devel Manuel Naranjo 2 participants 5 messages Jul 7, 2008 – Jul 9, 2008 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hello everyone,

I've been asking this the hole weekend on the irc channel, but yet no one could tell me if this is a bug or a feature, or what ever.

On Dbus api 3.X you could register binary sdp records over dbus, but new api can't I all ready implemented adding records, I need to implement the update records. But I would like to know if it makes sense to commit this patch or not.

Thanks,
Manuel

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#1 lore raw
Quoted 2 lines

On Dbus api 3.X you could register binary sdp records over dbus, but new api can't I all ready implemented adding records, I need to implement the update records. But I would like to know if it makes sense to commit this patch or not.

Just in case it makes sense, here's the patch that implements AddBinServiceRecord and UpdateBinServiceRecord.

Index: doc/adapter-api.txt
===================================================================
RCS file: /cvsroot/bluez/utils/doc/adapter-api.txt,v retrieving revision 1.17

adapter-api.txt +19 -0
diff -u -r1.17 adapter-api.txt
@@ -182,6 +182,25 @@
 			Possible errors: org.bluez.Error.InvalidArguments
 					 org.bluez.Error.NotAvailable
 					 org.bluez.Error.Failed
+		
+		uint32 AddBinServiceRecord(array{byte})
+
+			Adds a new service record from and returns the assigned 
+			record handle.
+
+			Possible errors: org.bluez.Error.InvalidArguments
+					 org.bluez.Error.Failed
+
+		void UpdateBinServiceRecord(uint32 handle, array{byte})
+
+			Updates a given service record.
+
+			Possible errors: org.bluez.Error.InvalidArguments
+					 org.bluez.Error.NotAvailable
+					 org.bluez.Error.Failed
+		
+		
+
 
 		void RemoveServiceRecord(uint32 handle)
 

Index: hcid/adapter.c
===================================================================
RCS file: /cvsroot/bluez/utils/hcid/adapter.c,v
retrieving revision 1.129

adapter.c +56 -1

82 lines not on this page · raw message

Index: hcid/dbus-database.c
===================================================================
RCS file: /cvsroot/bluez/utils/hcid/dbus-database.c,v retrieving revision 1.57

dbus-database.c +50 -28

133 lines not on this page · raw message

Index: hcid/dbus-database.h
===================================================================
RCS file: /cvsroot/bluez/utils/hcid/dbus-database.h,v retrieving revision 1.12

dbus-database.h +4 -0
diff -u -r1.12 dbus-database.h
@@ -27,9 +27,13 @@
 dbus_bool_t database_init(DBusConnection *conn, const char *path);
 void database_cleanup(DBusConnection *conn, const char *path);
 
+int add_bin_record(DBusConnection *conn, const char *sender, bdaddr_t *src,
+		const uint8_t *record, const int len, dbus_uint32_t *handle);
 int add_xml_record(DBusConnection *conn, const char *sender, bdaddr_t *src,
 				const char *record, dbus_uint32_t *handle);
 DBusMessage *update_xml_record(DBusConnection *conn,
 				DBusMessage *msg, bdaddr_t *src);
+DBusMessage *update_bin_record(DBusConnection *conn,
+                                DBusMessage *msg, bdaddr_t *src);
 int remove_record(DBusConnection *conn, const char *sender,
 						dbus_uint32_t handle);

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08

_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

maintainer
#2 lore raw
In reply to Manuel Naranjo

Hi Manuel,

Quoted 7 lines

I've been asking this the hole weekend on the irc channel, but yet no one could tell me if this is a bug or a feature, or what ever.

On Dbus api 3.X you could register binary sdp records over dbus, but new api can't I all ready implemented adding records, I need to implement the update records. But I would like to know if it makes sense to commit this patch or not.

the idea is not to use binary SDP records at all anymore. Also we wanna move the record registration and service authorization into a plugin and don't have this in the Adapter interface anymore.

Regards

Marcel

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#3 lore raw

Hi Marcel,

Quoted 4 lines

the idea is not to use binary SDP records at all anymore. Also we wanna move the record registration and service authorization into a plugin and don't have this in the Adapter interface anymore.

Ok got it. So then to work with binary records you should use bluelib right? Or this is going to be deprecated too?.

Thing is that in cases like BIP you wanna work with binary stuff, embedding xml records in your code might not be a good idea at all.

In fact the patch I created was to start making obex-data-server use the new API, but this was some how a boomer. What shall we do? Use sdplib, or go with xml strings?

Thanks,
Manuel

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

maintainer
#4 lore raw

Hi Manuel,

Quoted 6 lines
Quoted 4 lines

the idea is not to use binary SDP records at all anymore. Also we wanna move the record registration and service authorization into a plugin and don't have this in the Adapter interface anymore.

Ok got it. So then to work with binary records you should use bluelib right? Or this is going to be deprecated too?.

yes, the access via SDP Unix socket will also go away.

Quoted 6 lines

Thing is that in cases like BIP you wanna work with binary stuff, embedding xml records in your code might not be a good idea at all.

In fact the patch I created was to start making obex-data-server use the new API, but this was some how a boomer. What shall we do? Use sdplib, or go with xml strings?

I think the best is to move this all into a plugin and then we could have a plugin that provides binary record registration. However I am not a big fan of doing SDP without XML anymore. Building the record with the current C function is painful and leads to errors or memory leaks.

Regards

Marcel

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel