Skip to contentSkip to conversation

BlueTooth RFCOMM?

Qemu-devel Samuel Thibault 1 participant 1 message Mar 28, 2010 Kbuild

lore
Share & tools
lore
#0 lore raw

Hello,

I am trying to add support for Bluetooth braille devices, but I seem to be missing something. Basically, it should be using the RFCOMM PSM, but running

rfcomm connect 0 BA:BE:BA:D0:00:01

in the Linux guest hangs for some time and then the connect() system call returns EINPROGRESS. Am I perhaps missing some call to the qemu bt core?

Samuel

Makefile.objs +1 -1
index e791dd5..b7c8fa6 100644
@@ -78,7 +78,7 @@ common-obj-y += msmouse.o ps2.o
 common-obj-y += qdev.o qdev-properties.o
 common-obj-y += qemu-config.o block-migration.o
 
-common-obj-$(CONFIG_BRLAPI) += baum.o
+common-obj-$(CONFIG_BRLAPI) += baum.o bt-baum.o
 common-obj-$(CONFIG_POSIX) += migration-exec.o migration-unix.o migration-fd.o
 
 audio-obj-y = audio.o noaudio.o wavaudio.o mixeng.o
hw/baum.h +4 -0
index 8af710f..1fe30a7 100644
@@ -22,5 +22,9 @@
  * THE SOFTWARE.
  */
 
+#include "qemu-char.h"
+#include "bt.h"
 /* char device */
 CharDriverState *chr_baum_init(QemuOpts *opts);
+/* bluetooth device */
+struct bt_device_s *bt_baum_init(struct bt_scatternet_s *net);
hw/bt-baum.c new file +158 -0

158 lines not on this page · raw message

hw/bt.h +4 -0
index 4a702ad..720b974 100644
@@ -23,6 +23,9 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifndef BT_H
+#define BT_H
+
 /* BD Address */
 typedef struct {
     uint8_t b[6];
@@ -2181,3 +2184,4 @@ enum bt_sdp_attribute_id {
     SDP_ATTR_NORMALLY_CONNECTABLE		= 0x020d,
     SDP_ATTR_BOOT_DEVICE			= 0x020e,
 };
+#endif
vl.c +3 -0
index 10d8e34..2d89bfd 100644
@@ -1741,6 +1741,9 @@ static struct bt_device_s *bt_device_add(const char *opt)
     if (!strcmp(devname, "keyboard"))
         return bt_keyboard_init(vlan);
 
+    if (!strcmp(devname, "braille"))
+        return bt_baum_init(vlan);
+
     fprintf(stderr, "qemu: unsupported bluetooth device `%s'\n", devname);
     return 0;
 }