l2cap

Android 10 L2CAP connection IOException timeout Wii Balance Board

ぃ、小莉子 提交于 2020-04-11 17:48:46
问题 Background A long time ago I was tasked with making a android app for the Wii Balance Board, after some screwing around I found that android no longer supported L2CAP. More research lead to understand that it was being re-added in Android 10. With Android 10 out I've been trying to give it a crack now. Problem So my simple goal at the moment is to create a connection with the Wii Balance Board. My approach for connection is: Start discovery Add discovered bluetooth devices to list When you

Trying to understand L2CAP channel

点点圈 提交于 2020-01-16 08:49:07
问题 Now facing some challenges using CoreBlueTooth L2CAP channel . In order to better understand how things work. I have taken the L2CapDemo (master) (https://github.com/paulw11/L2CapDemo) from GitHub and tried to experiment with it. Here is what I have done, along with one question. In have replaced the sendTextTapped function, with this one : @IBAction func sendTextTapped(_ sender: UIButton) { guard let ostream = self.channel?.outputStream else { return } var lngStr = "1234567890" for _ in 1..

Virtual HID-keyboard for OS X

萝らか妹 提交于 2020-01-01 05:07:29
问题 I'm trying to create a virtual bluetooth keyboard client for Mac OS. that means my Mac will serve as a BT KB. I read about the bluetooth API in OS X (in ObjC), and I also found an HID API for Mac (in C) To make this work I understand I need to declare an hid-keyboard-service that should be broadcasted on SDP queries. if I declare an HID service using the HID API, is my service visible/broadcasted on Bluetooth too? (the documents seems to refer to HID with regards to USB only). - are HID

Excessive Bluetooth LE timeouts on Linux?

我们两清 提交于 2019-12-31 04:08:19
问题 I have written an application that uses Bluetooth LE L2CAP connections in nonblocking mode on Linux to read/write ATT packets (using socket(PF_BLUETOOTH, SOCK_SEQPACKET|SOCK_CLOEXEC, BTPROTO_L2CAP) ). Normally, when the device turns off or goes out of range, read() gives errno=ETIMEDOUT. However, read() is giving errno=ETIMEDOUT more often than it should, when the Bluetooth LE device still appears to be working. What is the cause of the timeout? Is the timeout configurable? My Linux

How can I instantiate a L2Cap socket in Android?

孤街浪徒 提交于 2019-12-18 13:39:06
问题 I see that a Bluetooth socket can be of type TYPE_L2CAP, but the constructor for BluetoothSocket seems to be private and I can only find a method to instantiate a socket of type RFCOMM. How can I obtain and use a L2CAP socket? Is it actually supported by Android? 回答1: UPDATE 10/2019 Support is there! Enjoy the new API: BluetoothDevice.createL2capChannel(int) BluetoothDevice.createInsecureL2capChannel(int) BluetoothAdapter.listenUsingL2capChannel() BluetoothAdapter

How can I establish an AVRCP connection from Windows 7 (controller) to phone (target) using L2CAP on Widcomm SDK?

不问归期 提交于 2019-12-10 19:26:45
问题 I am using the CL2Cap class in the Widcomm SDK on Win7. I am able to successfully establish the L2CAP connection and send the UNIT INFO command but the data returned is incorrect. I suspect that the stack has already established a connection and the AVRCP spec says: "Only one L2CAP connection shall be established between AVCTP entities. If the connection already exists, the CT/TG shall not initiate the connection request." Can anyone shed some light on what could be the problem? I have

Using CoreBluetooth CBL2CAPChannel to move data

橙三吉。 提交于 2019-12-08 08:52:38
问题 I have set up some data transfer function, using CoreBluetooth CBL2CAPChannel , in a Swift iOS app. Here is the function for sending data: func sendData(_ outStream: OutputStream) -> Bool { let data = tranferBlock! // tranferBlock holds some .utf8 data. let bytesWritten = data.withUnsafeBytes {outStream.write($0, maxLength: data.count)} if bytesWritten > 0 { tranferBlock = nil return true } return false } And here is the function for receiving data: func receiveData(_ inStream: InputStream) {

CoreBluetooth / L2CAP channels, not working

泄露秘密 提交于 2019-12-08 04:55:13
问题 I have recently been experimenting quite a bit with CoreBluetooth , and now I want to use L2CAP channels. For that I have set up two iOS apps, one is the peripheral and the other one is the central. At this point, when I run them, here is what I see in the Xcode debugging console. On the peripheral side I get this: peripheralManager(_:didAdd:error:) peripheralManager(_:didPublishL2CAPChannel:error:) PSM: 192 peripheralManagerDidStartAdvertising(_:error:) On the central side I get that:

Create and send a bluetooth command frame in Cocoa

て烟熏妆下的殇ゞ 提交于 2019-12-07 18:52:18
问题 I'm using the IOBluetooth Cocoa framework to communicate with a bluetooth device. So far I have gotten down the whole process of discovering the device and its services, pairing with it, connecting to it and now I want to send some actual commands, but I'm having some trouble with it. Below is an graphic from the spec for the AVRCP profile that I'm trying to use. You can view the pdf here. I believe I need to write an 5 byte value as shown by the image: Here is the method I have right now

Create and send a bluetooth command frame in Cocoa

坚强是说给别人听的谎言 提交于 2019-12-06 04:33:47
I'm using the IOBluetooth Cocoa framework to communicate with a bluetooth device. So far I have gotten down the whole process of discovering the device and its services, pairing with it, connecting to it and now I want to send some actual commands, but I'm having some trouble with it. Below is an graphic from the spec for the AVRCP profile that I'm trying to use. You can view the pdf here . I believe I need to write an 5 byte value as shown by the image: Here is the method I have right now that writes the data: - (void)l2capChannelOpenComplete:(IOBluetoothL2CAPChannel*)l2capChannel status: