Ubuntu usb蓝牙没有/dev/rfcomm串口,无法进行串口通信
RT
Ubuntu 连接USB蓝牙后,装好驱动(怀疑有问题),使用hcitool或bluetoothctl都能pair成功,但是connect的时候会出现:
[bluetooth]# connect 30:96:FB:C4:CB:22
Attempting to connect to 30:96:FB:C4:CB:22
[CHG] Device 30:96:FB:C4:CB:22 Connected: yes
[CHG] Device 30:96:FB:C4:CB:22 ServicesResolved: yes
Failed to connect: org.bluez.Error.InProgress
[CHG] Device 30:96:FB:C4:CB:22 ServicesResolved: no
[CHG] Device 30:96:FB:C4:CB:22 Connected: no
另外,因主要需要做手机蓝牙与ubuntu蓝牙通信,上面这个也并不在意,但是使用sdptool browse 30:96:FB:C4:CB:22,并没有看到SP(0x1101)串口的信息(RFCOMM以及Channel等),所以也无法与手机蓝牙通信。检查/dev/里面也没有rfcomm;
s = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
// bind socket to port 1 of the first available
// local bluetooth adapter
loc_addr.rc_family = AF_BLUETOOTH;
loc_addr.rc_bdaddr = *BDADDR_ANY;
loc_addr.rc_channel = (uint8_t) 1;
bind(s, (struct sockaddr *)&loc_addr, sizeof(loc_addr));
listen(s, 1);
用这个服务端,手机串口连接也没有反应,是不是驱动有问题?
或者正确的流程应该是什么样的呢?
是需要bluez蓝牙转串口?
多谢