Android Bluetooth HDP-Blood Pressure Monitor - android

Hi I have developed an android program to display the readings from an omron bp monitor. In the IEEE specification of BP monitors it is said that the BP monitor can send upto 25 datas in one event report.
I am getting the following as data from the monitor,it has only one reading and sometimes it is not the latest reading but the first one from the device's memory
e7000052005000010101004a0000ffffffff0d1f0040f000000100010038004200030032000100
12000300060062004d005420140327213502000002000a005120140327213502000003000
a000020140327213502000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000
How should I get the program to get the latest data or how can I send request monitor to send multiple measurements in one event report?Pls help

You will need to consult the data sheet for the device which describes all the data, and how it should be interpreted.
This data string, actually should contain all the data.
The data sheet should have the details about which bits or a combination of bits gives you what.
For example:
The first 3 bits would give you the Device short name
The 4th, 5th, 6th and 7th bit would give you the timestamp of the reading.
The 9th and 10th bit could give you the Systolic measurement, and so on.
IEEE doesn't specify how this data should be arranged I guess. I have worked on another BP monitor, whose manuals had elaborate documentation about this.

Related

ANT transmission protocol: Reading Parcel after sending Broadcast Messages

I am a newbie in this forum and I'm not very familiar with app development in general, however I am in the situation in which I have to develop an app to acquire ANT data from 3 nodes. I am basing myself on a previously developed app for Windows in C++ (.exe extension).
I am using a Samsung Galaxy A51 as a mobile phone and my Android Studio API is 29.0.
I am starting with the case of a single node and have implemented the following steps in my app:
bindService() and it returns that it is true;
getChannelProvider() and it returns a name of the channel;
acquireChannel(), with a setup of a default Public network;
assignChannel() to the type of a Shared Bidirectional Master;
open() the channel;
setPeriod() to the user period I chose (1092, corresponding to 30 Hz which is what I want to achieve in order to look for each of my 3 units with a frequency of 10 Hz);
setBroadcastData() with a payload that I need to call one of my units.
At this point, I expect to have sent my broadcast data and I am waiting for an "answer" from my unit. How do I read the message? I am finding many functions that want an AntMessageParcel type as input but I don't know where to get that Parcel from. Also, I am not sure that the logical order of the app is correct or if I need additional steps in between my code.
I thank you for your help.
Have a nice day!

"Best" way for Android Arduino communication via ethernet

I have an Arduino and an Android app which are communicating to each other via ethernet. The arduino shows a very simple webpage with only some values and an ID as seen below.
$1$201 //Value 1 ($1$): Temperature 20.1 degrees
$2$66 //Value 1 ($2$): Humidity 66%
$2$1 //Value 2 ($2$): Heating relay is on (1)
etc. up to 50 values
The Android app will read the data from this webpage as a string using a HTTP get request, filters the data and shows the values on a custom made screen. It is also possible to send some data to the arduino to change some settings or switch a relay or something. You can see is as some kind of thermostat. So far so good.
The "problem" is that I need to manualy update the data using a button. The question is: How can I update my values automatically?
I was thinking to just send a httpRequest every few seconds (polling), but I'm not sure if this is the way to go because it seems to use of lot of data.
Who can advise me what would be a good solution?
Regards,
Bas
The 'best' choice here will depend on your goals. Polling is easy to implement on the client (android) side. You could experiment with the optimal polling time depending on how 'fresh' your data needs to be compared to how much data you want your app to use. Alternatively, you could find or implement an http socket server such as ArduinoWebsocketServer, keeping in mind that the processor in your Arduino may or may not have the power needed to run this.

It takes too long to read data from the bluetooth chip

I'm working on a project which using bluetooth to send two bytes data to HC-05 module and receive from it. Everything is going well but there's one thing that I can't bear with, which is stated below.
I use System.currentTimeMills() to get the time interval between sending data and receiving ,and it takes no more than 1ms`` to detect whether there's data in the buffer ofinputStream. However, it takes about30~200msto readtwo bytesof data from thebluetooth` chip on my cell phone.
Dose anyone know how to reduce the time ? Or it's insolvable?
The primary bottleneck should be the protocol scheduling. I don't know how this particular module works, but in Bluetooth in general you have to wait for your timeslot to send or receive.
Suggestions:
Check if you can send more than 2 bytes at the time. The read time is stable, but you get more data transmitted each time.
Check if the API gives you scheduling options, so the wait time goes down.
For your use case I think things would be simpler with Bluetooth low energy (BLE). You will need another module, but IMO it is worth it.

how to request OBD parameters and receive them

I'm new to android and I thought to develop a bluetooth app to retrieve parameters from an OBDII device. I have downloaded the sample bluetooth chat application and configured it. The problem is how and what is the message that I need to send to the OBDII device in order to receive the parameters? and how should I handle them in the application side?
Thank you.
You're question is not very specific, but I will give you some guidelines.
First of all, test with an exisiting OBD-II reader application if your car actually works.
The ELM327-bluetooth-connector you have (I assumed it's a ELM327) translates ASCII commands to voltages. So all you have to do, is send some ASCII commands, and you get ASCII-values back.
The OBD protocol knows several modes and parameter's, but I will explain to get real-time data. That's mode 1.
Mode 1 Sending
This is kinda simple as it is.
Mode 1 is '01'.
After that part, you have to send a parameter ID with it. 0C is for RPM, 0D is for speed. (Look into the link below).
And after each command you have to send a Carriage Return. (CR = '\r')
So basically, for speed, you have to send:
'010D\r'
Receiving Mode 1
The answer you will get back from a Mode 1 query, starts with '41'.
After that the parameter ID is returned, and then the value.
The value is most of the time in hex. You will have to do some conversion to read a human readable value. For more information, see the link, as formula's to convert are provided too.
Example:
'410D17'
So 17 is the value of your current speed in hex. 17 to decimal is 23, so you're driving with 23 km/h.
This wikipedia page has some good information about it:
OBD-II Parameters

Estimating Delay in WiFi Using Android

I have a simple and clear question: Is it possible to send a set of data packets, one packet at a time after the acknowledgement signal from the access point is received using an Android device? The type of signal is not important just the total time passed into the process( within a resolution of ns or us suits my application) is important for me and I don't know a thing about Android, but if such a task can be pulled off in Android, I will learn Android.
Thanks
You can send a System.nanoTime() value to the other device and then substract...the thing is if the 2 devices dont have exactly the same hour, this value will not be real... Anyways, you can sync. both devices sending a "test package" from a fixed distance, sou you can measure the difference according to the test package.

Categories

Resources