Git Product home page Git Product logo

albertcbraun / cms50fw Goto Github PK

View Code? Open in Web Editor NEW
25.0 6.0 9.0 711 KB

A library for conveniently connecting over Bluetooth to a Contec Medical Systems Pulse Oximeter (model CMS50FW) and reading data from its input stream. Also includes a test application which displays SpO2 and pulse rate data and alerts the user if the SpO2 values go below a specified threshold or the data stream is interrupted.

License: Other

Java 100.00%

cms50fw's Introduction

Disclaimer

This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

License

Apache Version 2.0

Credits

This library was informed, inspired and guided significantly by Yujia Yan's GitHub project:

https://github.com/Yujia-Yan/CMS50SerialProtocolKit

which works on a slightly earlier version of the Contec CMS50. Many kind thanks to Yujia Yan for that code. Any misunderstandings or misinterpretations belong to me.

Contents of this Android Studio project

There are two Android Studio modules in this project. One is the android library project "cms50fwlib". The other is a test app named "cms50fwlibtestapp".

The cms50fwlib project outputs an aar file. This library tries to simplify the Android code required to detect the CMS50FW Pulse Oximeter, obtain a bluetooth connection to it, read the data stream, and turn it into a convenient object.

The cms50fw test app tries to read the Bluetooth data stream in real-time, writes pulse and oxygen level data to the screen, and also tries to alert the end user if it thinks it has detected a problem (e.g. oxygen level too low).

CMS50FWLib

The basic steps for using the cms50fwlib are:

Implement a custom CMS50FWConnectionListener instance for your app Activity or Fragment. (An example of this is found in the test app project.)

Now, obtain an instance of the CMS50FWBluetoothConnectionManager:

cms50FWBluetoothConnectionManager = new CMS50FWBluetoothConnectionManager("SpO202"); 

Call setCMS50FWConnectionListener on the CMS50FWBluetoothConnectionManager instance, feeding in your custom implementation of CMS50FWConnectionListener:

cms50FWBluetoothConnectionManager.setCMS50FWConnectionListener(cms50fwCallbacks);

At this point, you should have your Contec CMS50FW turned on and the 'wireless' setting should also be set to 'on'.

Once that is done, call connect on the cms50FWBluetoothConnectionManager, feeding it an instance of an Android Context object:

cms50FWBluetoothConnectionManager.connect(aContextObject) 

At this point, there will be a delay while the Bluetooth "machinery" on your Android device carries out discovery and tries to find the CMS50FW. It should take about 10 seconds (or less).

If the connection succeeds, you will be called back on your implementation of the method CMS50FWConnectionListener.onConnectionEstablished.

Once that has happened, you can ask the CMS50FW to start streaming data:

cms50FWBluetoothConnectionManager.startData()

You should start to see callbacks about 60 times per second on your implementation of the method CMS50FWConnectionListener.onDataFrameArrived. The cms50fwlib library feeds onDataFrameArrived a convenient DataFrame object whose properties can be read in your client.

CMS50FWLibTestApp

The test app can be compiled as part of this Android Studio project or installed directly from the Google Play Store.

jCenter Reference

You can get the cms50fwlib directly from the jCenter repository. Add this to your Android Studio project's build.gradle:

compile(group: 'com.albertcbraun.cms50fwlib', name: 'cms50fwlib', version: '0.5.1')

More Disclaimers

This source code is for software testing, entertainment and educational purposes only. This source code is NOT to be used for medical, health care or fitness related purposes. This source code is neither certified nor approved by any government or regulatory agency.

Manufacturer(s) and retailer(s) of the CMS50FW pulse oximeter do not support, endorse, or take responsibility for this source code. Neither the author of this source code nor the publisher accept any responsibility whatsoever for any issues, problems or complaints experienced by anyone who uses or relies upon this source code.

The app author and app publisher accept no responsibility whatsoever for source code bugs, failures, crashes, expected or unexpected behavior. The author of this source code disclaims all liability for its use or abuse.

All responsibility and liability for using this source code belong solely to the user. If you use or in any way rely upon this source code, you agree that you are using it solely at your own risk.

cms50fw's People

Contributors

albertcbraun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cms50fw's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.