I have found the some BLE device will allow you to do concurrent "LE Set Scan Enable" and "LE Create Connection" commands, and others (mainly CSR) will not. Other than trying it on each device, is there a way to tell if device will allow this capability (i.e something like "LE Read Local Supported Features" command)?
Yes!
See the LE Read Supported States command in the Bluetooth specification.
Please note that some Intel chips report that they support concurrent scanning/connection but actually fail to create a connection when you have a scan running. See https://github.com/sandeepmistry/noble/issues/165. I also tried to report it here: https://communities.intel.com/thread/104509.
Related
We are integrating a new barcode reader (Newland NLS-FM430) in one of our products and we need to control its functionality. We have already implemented this behavior with another reader but it was an RS232 version, so we were able to send commands and wait for its input. The new one is a USB version which makes things different.
Generally, we want to initialize the barcode reader when the application is started (e.g. to disable reading setup codes) and turn it off. Then we want to enable it at the moment we need input from it and disable it again once we have read the data. There are commands for all these operations, documented in the user guide.
The issue comes when trying to communicate with the USB device. When connected to the computer it acts as a normal keyboard (Human Interface Device, HID in Device Manager) and we need to send commands to it. For this we need to open a stream to the device and write in it. We tried different libraries and solutions and opening the device always fails with an ACCESS_DENIED error. My suspicion is that the device is locked because Windows uses it as a keyboard.
I found this topic which discusses a similar problem. They found a workaround by deleting the suffix /kbd in the Device Path (and ours also has as this suffix) but removing it does not work for us - it says it cannot find the device.
I am looking into a solution in C# or C/C++ that would make it possible to open a connection to the USB device and write to it. Any help is highly appreciated.
Your introduced user guide states that the scanner still supports serial port mode.
Page 76 : USB CDC
Page 79 : IBM SurePOS (Handheld)
Page 79 : IBM SurePOS (Tabletop)
You can stop using it in keyboard input emulation mode and use serial port mode.
This is because, also on page 14 Chapter 3 System Settings of the User Guide, it is stated that the user can program by serial command.
Command Programming
The FM430 can also be configured by serial commands sent from the host device.
Users can design an application program to send those command strings to the scanners to perform device configuration
For more information, refer to the Programming Guide Based on Newland Unified Command s Set.
What's more, the vendor-provided configuration tool, also on page 13 Chapter 2 EasySet of the User Guide, does not support configuration in keyboard input simulation mode.
EasySet can communicate with device via one of the following interface: RS 232, USB COM Port Emulation (UFCOM driver required), USB CDC (UFCOM driver required), USB DataPipe (UFCOM driver required), USB HID POS.
In addition, the HID POS (POS HID Barcode Scanner) mode on page 77 allows for configuration and input/output as a variant of HID as described in the USB.org specification HID Point of Sale Usage Tables 1.02.
However, that method will not be able to notify the barcode read by the keyboard input emulation method. And it will require more complicated programming than setting/input/output in serial port mode.
I implemented the org.bluez.Agent1 interface using QDbus and I would like to set a fixed pin (that I will provide to the users) in order to authenticate all the pairing request and reject them if the pin is wrong. The agent capabilities should be "NoInputNoOutput" because the project will be deployed on the RaspberryPi 3 without keyboard or display. Is there a way to deal with this? Thank you
You should not initialize the capability as "NoInputOutput" for fixed key pairing. NoInputOutput means there is not display and there is no keyboard/UI possible for this device. Mentioning this capability for your Agent when registering with BlueZ means, instructing BlueZ (bluetoothd) not to call any Agent API for authentication.
This is typically useful to autopair without any manual intervention. You can see this sample code, which uses NoInputOutput capability to connect the device without any intervention.
What you need is "DisplayOnly" capability to instruct BlueZ to call "DisplayPinCode" or "DisplayPasskey" based on SSP support of your device.
You can implement DisplayPinCode/DisplayPasskey in your Agent to reply constant PIN always. So the Bluetooth device which tries to connect can use the same constant PIN for pairing.
Here Display Pin /Passkey is just the naming convention or hint to Agent developers to write wizard/UI or any form of display operations. But you can completely ignore the displaying operation and reply with static/constant 6 digit key for pairing.
Typically this Agent API is called by Bluez (in rasperry pi) when the device (iPhone/Android mobile/any bluetooth capable device) trying pair calls "RequestPasskey" or "RequestPinCode" from the device end.
We had the same issue in a project, and i moved on LE device do to the fact that apple device are only capable to connect to LE device for "safety" reasons.
I don't have that much ref to that but if this could help you in your researches.
The scenario:
I have one device (Android Phone) that I can control and I want to analyse the Bluetooth capabilities of a different device of which I have limited control/ information - I can only accept/ reject pairing, but I don't known what versions or features are supported (this is that I want to find out).
Question:
From the recorded HCI logs (in the Android Phone), can you determine what version/ technology was actually used in a successful pairing?
In other words, how can you tell whether Bluetooth low energy was used or the Classic Bluetooth (BR/EDR)?
Note: I am not looking for:
the LMP advertisement of the "remote host" as this will only tell
which Bluetooth version is supported (e.g. 4.1) but will not tell
which technology is actually used
also, not looking for the remote extended features telling what
technologies are supported (such as BR/EDR and LE) but without giving
details about which technology is actually used
Thanks :)
If the LE link is set up, HCI LE Meta Event 0x3E with sub event LE Connection Complete 0x01 will be seen in the logs. See core spec v5 Vol 2, part E.
If pairing occurs over the LE link, then SMP PDUs related to pairing will be seen in the HCI logs as pairing occurs on the host. See core spec Vol 3, Part H.
In LE, GATT is used to discover services of the remote device.
If the BR/EDR link is up, HCI Connection Complete event 0x03 will be seen in the logs. In BR/EDR, SDP is used to discover services of the remote device.
Background:
I’m looking to enable A2DP audio streaming SINK support on my Nexus 4 & 5 devices (running Lollipop) . I also need concurrent SPP/RFCOMM bidirectional traffic for my application command and control. I’ll be sending serial traffic to a microcontroller via a Bluetooth module (such as the BlueGiga WT32i or ) which will be controlling various other hardware. As such, I believe AVRCP isn’t up to the task.
Question:
Has anyone enabled A2DP SINK support in Android (Target Lollipop or earlier) and either successfully got an concurrent SPP/RFCOMM channel working OR can offer options on how to achieve this?
For A2DP Sink support -
Yes. It is possible. I have done it in Android JB.
https://stackoverflow.com/a/28892944/987500 - Please read my reply.
Is it possible to set a bluetooth le device into broadcast mode via command line (on Linux)? Is this available through hciconfig or hcitool commands?
I continue to read about broadcast mode, but can't find a way to enter into it in order to explore it.
I'm treating "broadcaster" as this article treats "broadcaster" http://rtcmagazine.com/articles/view/102266. And the wiki article states that "broadcast mode" is "little used" http://en.wikipedia.org/wiki/Bluetooth.
Thanks!
I didn't look at the wikipedia article, but the first article seems to be talking about "advertising broadcasts". You basically set up your system to periodically send out an advertising packet for other devices to "hear" to know that they can connect to it. That's completely all iBeacons are on the BLE side (as far as I can tell). And since it's the only way to find devices to connect to it's very very common.
The advertising packet has a data field so that you can broadcast information out without other devices needing to connect to get data. iBeacons use that to broadcast a GUID, but you could broadcast almost anything with the only restriction being the length
Radius Networks has published a how-to make an ibeacon from a raspberry pi and that gives you the linux commands to send advertising packets from the command line.