I'm trying to read the pulse of a heart rate monitor bluetooth. Now I connect the device via Bluetooth and see their name, status, etc., but do not know how to read pulses.
I have read that it was easier by smartgattlib library, but neither him. Someone could tell me how or made used the library to read a device smartgattlib?
Thank you
On Android you need to subscribe for notifications on the pulse characteristic.
Please check the bluetooth low energy sample: https://github.com/googlesamples/android-BluetoothLeGatt
On the sample after subscribing for notifications onCharacteristicChanged() callback will be called, you will need to read the pulse data there.
You can use library but before use that, get the detail documentation of heart rate monitor (What all services it host and what all characteristic it has). After knowing the device properties, you can read and write those characteristic. Hope it will help !!!
Sensor Tag
IBM blueMix
Related
I am new to Arduino development and just started trying some of the provided examples for the MXChip devkit. What I'm trying to do now is accessing the analog readout from the microphone to get a rough estimation of sound levels. I tried to find information on how to do this and found some articles that use an Arduino board and an external microphone wired to the analog inputs. Since the dev kit has a built-in microphone, I want to use that, but I don't know how to access it, and I can't find any information on pin layout. Any help would be appreciated!
The microphone is not connected to the analog pins. It is connected to dedicated Audio codec hardware.
See https://microsoft.github.io/azure-iot-developer-kit/docs/apis/audio-v2/
The hardware does not seem to give you direct access to incoming values. It looks like you will need to record and the read the buffer to get audio input levels.
I have this sensors https://lonauto.en.alibaba.com/product/60692809352-806479288/4pcs_Sensor_one_set_intelligent_Tpms_tire_pressure_monitoring_system_free_app_on_iso_android_phone.html?spm=a2700.icbuShop.prewdfa4cf.7.1b29ca9abaaU3n from which I want to get some data over Bluetooth, it's low energy device which isn't discoverable - don't really know how pairing works at all so I need a lot of informations about pairing and everything. Any ideas would be welcome.
They have offcourse official app, but customer want custom app so therefore pairing should be in this custom app.
Bluetooth low energy overview AndroidDeveloperGuide
This guide will help you with creating the logic for connecting and exchanging information from the Sensor.
Please follow all the classes mentioned in the Guide in detail, the various classes' constant variables and methods will give you good knowledge of what sorts of information you can get from the sensor.
We have bought BLED112 to interface our target via BT.
An android app interacting with target via BT & USB (HID).
We have used some Bluetooth communication to write a program and send data to dongle.
Now can somebody here having any experince in converting that BT data to a HID signal.
Have anybody tried that?
Is there any BGScript code which we need to write to achieve that?
Please let me know if the thought is completely wrong.
Referring to a comment above which states,
We are writing an Android App which can send data to BLED112 over BLE interface or GATT. My question is how can I convert that data (basically a command) to an HID (key event), correct me if my understanding is wrong?
If I understand the use-case correctly, I think, in the initial stages of the development, you will need to use the BLE-GUI utility that BlueGiga provides.
With that utility you can see the communication between the BLED112 Dongle and the BLE112 Module. BLED112 shall be simulating what the android app would do?
First, you will need to know the GATT structure stored in BLED112 to write to or read from the BLED112.
Secondly, the way BLE112 works is an event-based implementation. Going through the API reference document for BLE112 shall help you understand the events generation conditions and codes that are generated modified when a characteristic value is updated by the android application, or read by android application. You get events for connection, disconnection, read from, write to, notification enabled for, indication enabled for, etc.
On the BLE112 side, depending upon what service and what characteristics in that service is going to be used for data transfer between Client (Android App) and Server (BLE112), you need to write suitable implementation in event callback handlers.
There is a standard service called Human Interface Device which has a reserved UUID: 0x1812.
Once you configure your BLE112 as a HID over GATT device, your android app shall see a service with UUID: 0x1812. Parse the service descriptor and get the characteristics bundled up into the service. You can read from or write to that service depending upon access parameters set in gatt.xml
As an example, say, if it is a Keyboard, you can send the scancode for (make and break) of the key depending upon what key is pressed. How to get a scancode is out of the scope of this question anyway, and sadly I had worked on PS2 keyboards, so I don't really know how to get the scancode from a USB keyboard.
So, you have the scancode for the key pressed, and you know the characteristics to write that into. Write it, the application should enable the Notifications for that characteristics, so that it is notified whenever the key is pressed and value is written into the characteristics. To let application enable notifications or indications for the characteristics, study the developer guide that talks about how to write a gatt.xml for Bluegiga-based BLE devices. I'll give you a hint: in xml, in the characteristics configuration you have to write notify="true".
About parsing of the service and characteristics in Android, Unfortunately I am not an android developer, but an embedded developer, I know how the BLE112 module part is to be implemented, while I have no insight of how android parses the data. But, there are plenty of question and discussions about it online, which you might understand better than me since you have an android background.
I am using a generic BLE plugin for PhoneGap when developing a BLE enabled application. It gives me beacons identification and RSSI, but reading more advanced attributes like battery status or TX power require specific communication with a beacon, which is manufacture dependant as far as I know. Does anybody of you know, how to read for example the battery status from Stick'n'Find BLE beacons. So far I have been able to discover, that it's necessary to connect to the beacon and after it a characteristic has to be read. But here, I am lost.
Marek
You must use a manufacturer SDK to do this. One user reported:
I reached out to the manufacture and they have an SDK (and sample app), you have to sign up for a free account to get access: https://bluvision.com/developer/beeks-beacons-sdk/ http://bluvision.com/developer/wp-content/uploads/sites/2/2014/09/Android-SDK.zip
See here: https://stackoverflow.com/a/26424648/1461050
I am experimenting with Bluetooth Low-Energy (BLE) for the purpose of connecting a hardware device to an Android application. My goal is to send a recognizable piece of data to an Android phone.
I am using the keyfob from Texas Instrument's CC2541 Mini-development kit, and am programming it using the IAR Workbench (which I am learning on the fly). My issue is that I cannot figure out what code should be used to send data from the keyfob to the phone.
I understand that this is somewhat vague, but because of the non-disclosure policies of my company I cannot share the code that I am working with. Does anyone have any references to code for the IAR Workbench that will allow the CC2541 to send a piece of data? Right now, I prefer to use GATT if that helps.
Thanks, and please ask me more questions if I need to clarify anything.
Assuming you're working from a pre-existing service profile, there is a function for every service called ServiceName_SetParameter(). Calling that function will change the characteristic value. When the characteristic is read by the phone, it will receive this value. If the characteristic supports notifications, and your phone has registered for notifications on that characteristic, the new value will be transmitted whenever SetParameter is called.
You can implement any proprietary protcol to connect to and interact with your beacon device. It can assume other roles than just the beacon task. It can also listen to and respond to connection attempts thus expanding into a lot more than a regular beacon.
If you study the cc2541 close you realize it is a pretty advanced IO controller that offers a lot of IO signal possibilities. That way you could use the cc2541 as the heart of an IO control application where you measure and control equipment. Mobile apps can then easily connect to your beacon/IO Controller device and interact with the machinery it is hooked up to. As you see, it´s a remarkably versatile system on chip and a cool circuit to learn to program.